Local-first · macOS · no account

Every agent you've ever talked to,
searchable.

Your conversations with Claude Code, Codex, OpenCode and the Gemini CLI family are scattered across four different folder layouts. TokenBook indexes all of them into one local database — so you can search every task you've ever handed an agent, across every project, in one place.

git clone https://github.com/dmxj/tokenbook && cd tokenbook && pnpm i && npm run install:mac

Free and MIT licensed. Reads your agent history read-only — it never writes to those folders.

TokenBook showing 17 indexed sessions across three agents, with a Codex session open in the transcript pane

Three panes: agents on the left, sessions in the middle, the full transcript on the right. Screenshots use a demo dataset.

It's not about keeping history.
It's about never solving the same problem twice.

Three things no single agent can do for you

Search across every agent at once

A SQLite FTS5 index over your questions and the agents' answers. Type ⌘K, get hits from every agent and every project, ranked — single-digit milliseconds on a 580 MB index.

Grouped by the directory you worked in

Every session records the folder it ran in. Pick a project and see all of it — the Claude Code sessions, the Codex ones, the Gemini ones — in one list, split into tabs per agent.

Get the transcript back out

Export a whole session or a single turn as Markdown or JSON — full fidelity, not the truncated copy the UI shows. Hand a debugging session to a colleague or paste it into an issue.

Project view

One project, every agent that touched it

Sessions are grouped by the working directory they recorded — not by which folder the agent happens to write its logs to. Tabs count them per agent, and an “include subdirectories” switch rolls up anything nested underneath.

  • Pin the projects you live in; pins float above whatever sort you pick
  • Sort by session count, recency, first-created, turn count or name
  • Agents that only store a hash of the project path get resolved back to the real folder
The directory pane for a project called pulseboard: 6 sessions, 27 turns, and tabs for All, Claude Code and Codex

Search

Search the reasoning, not just the answers

By default only your questions and the agents' answers are matched, so results stay about the work. Flip one switch to include thinking blocks, tool calls and intermediate output — which is usually where the answer to “why did it do that?” is hiding.

  • Scope to the open session, one agent, or everything; filter by time range
  • CJK substring search works from a single character — a bigram index, not word tokens
  • Deep search streams the raw session files for text that never made it into the index
The ⌘K search palette: 18 hits for the word percentile in 5 ms, each row showing the matching line highlighted, the role, the project and the turn number

Reading

Structure preserved, tool noise folded away

Each turn keeps its original shape: your question on the right, the agent's answer on the left, with thinking and tool calls one click away in a side panel. Long tool output collapses so the transcript stays readable.

The side panel for one turn, listing its thinking block and two tool calls with their sizes
What export gives you session.md
# Dashboard chart grid re-renders on every poll

- **Agent**: Claude Code
- **Project**: pulseboard
- **Turns**: 4   ·   **Tool calls**: 8

---

## Turn 1

### Question

The dashboard re-renders the whole chart grid…

### Answer

## Cause

`usePolling` returns a **new array on every tick**…

Supported

Six agents, four on-disk formats

Each agent writes its history somewhere different. TokenBook has a parser for each layout, and auto-detects which one a folder uses.

Claude Codeprojects/<cwd>/*.jsonl
Codexsessions/YYYY/MM/DD/*.jsonl
OpenCodestorage/{session,message,part}
Gemini CLItmp/<hash>/chats/*.json
Qwen Codetmp/<hash>/chats/*.json
iFlowtmp/<hash>/chats/*.json

Using something else? Add a custom source, point it at the folder and pick a parser — or let the auto-detector work it out.

Getting started

Running in about three minutes

  1. 1

    Install

    Build it and drop it in /Applications. Or run npm run pack:mac if you'd rather place it yourself.

  2. 2

    Let it index

    It probes the standard locations for each agent and indexes what it finds on first launch. A few hundred sessions takes seconds.

  3. 3

    Search

    ⌘K searches everything, ⌘F searches inside the session you're reading. Open a session to read it turn by turn.

Under the hood

Built so it stays fast on a large history

On the machine this was written on: 842 sessions and 6,466 turns index to 583 MB. Searches land in single-digit milliseconds.

  • Conversation bodies are never copied into the database — only a search index and session metadata. The transcript is parsed from the original file when you open it.
  • Indexing yields the main thread between batches, so a background sync never blocks a search you're typing.
  • Sessions are paginated by turn: a 300 MB, 35,000-turn session opens on its first 30 turns and loads the rest as you scroll.
  • A file watcher hot-reloads the session you're reading while the agent is still writing to it.
TokenBook with its interface switched to Chinese while the conversation content stays in English
The interface speaks English, 简体中文, 日本語 and 한국어. Conversation content is never translated — switching language changes the chrome only.

Questions worth asking

Does it send anything over the network?

No. There is no account, no telemetry and no update check. It reads local files and writes one SQLite database in ~/Library/Application Support.

Will it touch or rewrite my agent history?

Everything under ~/.claude, ~/.codex and friends is opened read-only. TokenBook never writes there, and deleting its index only costs you a re-index.

Why is the index hundreds of megabytes?

It stores a searchable copy of the text. You can shrink it a lot by leaving “index tool output” off, which keeps large tool results out of the full-text index — they stay searchable through deep search, just slower.

Does it run on Windows or Linux?

It's an Electron app, so probably — but it has only been built and used on macOS (arm64). The install helper is macOS-only. Treat other platforms as untested.

Can it show a live session while the agent is working?

Yes. With the file watcher on, a session being written to right now re-indexes within a second or two, and the session list marks it as in progress.

Your history is already on disk.
Might as well be able to search it.