Inside .ctg
Before I ever tuned a query plan, I was right-clicking moves in a Fritz opening book at midnight, marking my lines green and my opponents' lines red so the engine would always, always steer into a Ruy Lopez. That little book window was my first database — a tree of positions with stats attached, editable by hand. Here's what a .ctg book actually is, how the manufacturers built them, and how a young college student with no code could program an engine's openings with a mouse.
Not a list of games — a tree of positions
The first thing to understand is that a real opening book isn't a list of games or a list of move sequences. It's a tree of positions, keyed by a hash of the board. That distinction is the whole trick: because the book is indexed by position rather than by move order, every route that reaches the same position — every transposition — collapses onto the same node. Reach the Ruy Lopez by 1.e4 e5 2.Nf3 Nc6 3.Bb5 or by some odd move order, and the book lands you on one shared node either way.
Each move node carries a little dossier: how many games went down this move, its win/draw/loss split, a performance percentage, the average Elo of the players who chose it, an editable weight or probability, and a learning value that shifts with results. In ChessBase's world that book is a .ctg file, and it travels as a trio — .ctg (the data) plus .ctb and .cto index files. Lose one of the three and the book won't open; they belong together.
A .ctg book is a warmed result cache keyed by a hash. The engine doesn't search the opening — it does a lookup, exactly the way a transposition table (a plan cache) short-circuits a position it has already seen. Position-hash keying so that different move orders resolve to one entry is precisely how you'd design a cache to dedupe logically-identical requests that arrive in different shapes. The .ctg/.ctb/.cto trio is data-plus-indexes: the same reason you don't ship a table without its indexes.
Two very different pipelines: aggregate, or author
Where did the shipped books come from? Two routes, and the contrast is telling.
Database aggregation was the industrial method. Pour a huge master database — ChessBase's Mega Database, millions of games — into an empty tree, walking each game move by move and merging by position. Filter by Elo, minimum game count, and recency, and what falls out is a Powerbook: a machine-built opening tree distilled from the strongest slice of recorded chess. The 2026 Powerbook takes 1.7 million high-class games and expands them into roughly 25 million positions. It's the exact same format I hand-edited in 2004, just at a scale no individual could ever curate.
Human book authors were the surprise. Alongside the aggregated books, professionals — names like Jeroen Noomen and Sedat Canbaz — hand-tuned repertoires: pruning losing lines, forcing engine-favorable openings, testing candidate books in engine-vs-engine games and keeping what scored. These weren't generated; they were edited, by strong players, move by move. And most books shipped with learning enabled so they'd keep refining themselves on your machine after you bought them.
Chessmaster — a book built to feel human, not to win
While ChessBase built books to win, the other pole of my childhood was Chessmaster, and its whole philosophy was the opposite. Under the hood ran an engine called "The King," by Johan de Koning, across the editions a lot of us grew up on — 8000 (2000), 9000 (2002), 10th Edition (2004), and the Grandmaster Edition (2007). Its signature was personalities: dozens of tuned opponents, each with its own style and its own opening repertoire, calibrated to feel like a specific human at a specific level rather than to play the objectively best move. Josh Waitzkin's Academy sat on top, teaching. Chessmaster was built to feel human at every rating; ChessBase's books were built to be correct at the top. Same underlying idea — a curated opening tree — pointed at two completely different goals.
| ChessBase books (Fritz / Powerbook) | Chessmaster (The King) | |
|---|---|---|
| Built to | Win — steer the engine into strong, tested lines | Feel human — play like a believable opponent at a set level |
| Repertoire | Aggregated from master games or authored by pros | Hand-tuned per personality, for character not strength |
| Audience | The serious analyst and the competing engine | The learning player who wants a human-feeling game |
Steering the engine by hand — no code required
Here's the part that hooked the young college student and never let go. You didn't need to write a line of code to program the engine's openings. You opened the book window, right-clicked a move, and dictated the repertoire with a handful of controls:
- Main / !Mark a move green to tell the engine: prefer this line. This is your repertoire.
- Don't playMark a move red to prune it entirely — force the engine off it and down the line you want.
- TournamentFlag a move as tournament, and with "use tournament book only" set, the engine plays only your curated lines until it runs out of book.
- Weight %Set a move's weight or probability to bias the odds — 70/30 between two lines — for controlled variety instead of the same game every time.
And when your knowledge ran past where the shipped book ended, you just played moves on the board to add new nodes, extending the tree with your own theory. The example I lived: as Black, always meet 1.e4 with the Najdorf; here prefer 6…e5, and never allow 6…e6. Green the moves I wanted, red the ones I didn't, and the engine would obey — authoring an opening repertoire by point-and-click. It was the most intoxicating kind of control: I was teaching the machine which chess I loved.
This is the piece of computer chess I remember most physically — the book window open, the position on the board, right-clicking my way through a Ruy Lopez, greening the Closed lines and red-flagging everything that led somewhere I didn't want to defend. I wasn't strong enough yet to play those lines flawlessly, but I could make my engine play them, over and over, in gauntlets I staged overnight. That's how I learned them.
Book learning — the tree that edits itself
On top of the hand-editing sat an automatic layer: book learning. Each move node's learning value shifted with your results — win with a line and it drifts up, lose with it and it drifts down — so over time the book quietly steered away from moves that kept scoring badly for you, even ones you hadn't touched by hand.
Book learning is a precomputed result set with feedback-driven eviction of poor entries — a cache that demotes what performs badly against live outcomes. It's cache-warming with an aging policy: the hot, high-scoring paths stay prominent; the cold, losing ones get down-weighted out of the way. You've built this whenever a cache's replacement policy is keyed to hit-value rather than just recency.
Shared Shredder learn files — inheriting another machine's analysis
There's a second kind of learning worth separating from book learning, and it produced one of the strangest, most communal moments of the era. Shredder kept a distinct learn / hash-learning file — not an opening book, but a store of hard-won deep evaluations, so it wouldn't have to re-solve difficult positions it had already ground through. Because that file was just data, players shared them. Import someone else's Shredder learn file and your engine got instantly stronger in exactly the positions they'd already analyzed — you inherited another machine's overnight work for free.
A shared learn file is a portable, shareable computation cache — like shipping a warmed cache or a set of precomputed, materialized results between servers so the second machine skips work the first already paid for. Trading Shredder learn files in 2004 was, structurally, moving a materialized result set from one box to another to avoid recomputation. We just didn't call it that; we called it "here, this made my Shredder scary."
Curated openings, computed endgames
It's worth setting this page beside its mirror image, the endgame tablebases. The two are opposites in method, and together they bookend the game. Opening books are curated: human judgment applied over human games, editable, biased, full of taste and preference. Tablebases are computed: pure retrograde proof, zero human judgment, the same for everyone. The start of the game is solved by taste; the end of the game is solved by brute force. The middlegame — the part no book or table can reach — is where the engine actually has to think.
Formats footnote: beyond ChessBase's .ctg, the open standard is Polyglot (.bin), a position-hash book supported across many GUIs and engines; the Arena GUI uses .abk / .gbk / .obk. The .ctg tree described here is the ChessBase/Fritz/Shredder lineage specifically.
Opening books & .ctg — FAQ
What is a .ctg file?
ChessBase's proprietary opening-book format, used by Fritz, Shredder, and Junior. It stores openings as a hash-keyed tree of positions (so transpositions collapse onto one node), and each move node holds game counts, win/draw/loss, performance %, average Elo, an editable weight, and a learning value. It ships as a .ctg/.ctb/.cto trio that must stay together.
How do I edit a Fritz or ChessBase opening book?
Open the .ctg in Fritz or ChessBase, go to a position, and right-click a move in the book window: mark it Main (green) to prefer it, Don't Play (red) to prune it, or Tournament to restrict the engine to your curated lines. You can also set a weight/probability, or play moves on the board to add new nodes past where theory ends.
How do I make my engine play a specific opening?
Steer it with the book: green-light your repertoire's moves (or mark them tournament moves) and red-flag the alternatives, then enable "use tournament book only." To force a Najdorf as Black, for instance, green 1…c5 / 2…d6 / 5…a6 and your preferred sixth moves, and red the lines you never want.
What's the difference between book learning and a Shredder learn file?
Book learning adjusts move weights inside the opening book based on results. A Shredder learn (hash-learning) file is separate — a store of deep evaluations from actual search, so the engine skips re-solving hard positions. The learn file was shareable, so importing someone else's made your engine instantly stronger in the positions they'd already analyzed.
Are .ctg books still used in 2026?
Yes. The format long outlived the engines that made it famous — the 2026 Fritz Powerbook is a .ctg tree of about 25 million positions built from 1.7 million high-class games, opening in the same book window players used two decades ago.
- ChessBase / Fritz documentation on opening books, the .ctg format, and the .ctg/.ctb/.cto file trio.
- Fritz Powerbook 2026 — bundled with StrongBook and CorrBook; ~1.7M games → ~25M positions (en.chessbase.com).
- Human book authors — Jeroen Noomen and Sedat Canbaz, per published Rybka/engine book credits and interviews.
- Chessmaster editions (8000, 9000, 10th, Grandmaster) and "The King" engine by Johan de Koning.
- Polyglot (.bin) open book format; Arena GUI .abk/.gbk/.obk formats.
- The hand-editing and shared-learn-file recollections are the author's first-hand experience from the 2000s.
The other half of the board
Opening books are curated by taste; endgame tablebases are computed by brute force. See the mirror image — or step back to how an engine thinks in the middle, where neither applies.
Solving the Endgame → · Search vs. Evaluation → · Back to the Hub →