DEV Community

Little Pan
Little Pan

Posted on Originally published at ponymux.com

How to Search Your Claude Code Conversation History

You talked through an approach with your agent a few days ago. The agent explained the tradeoffs, you picked a direction, and it wrote the code. Now you need that reasoning again — maybe for a code review, maybe because you're hitting an edge case the original conversation anticipated.

You know it's somewhere. Claude Code saves every conversation as JSONL under ~/.claude/projects/. Codex groups them by date under ~/.codex/sessions/. The full record is on your disk — your prompts, the agent's reasoning, every tool call. The problem isn't storage. It's retrieval.

What you can do today

Claude Code's --resume flag opens a session picker. You can scroll through recent sessions and select one to continue. It works when you remember roughly when the conversation happened and can recognize it in a list.

It doesn't search content. If you're looking for "that conversation where we discussed the migration" and it happened across three sessions over two days, --resume won't find it by topic.

The common workaround is grep:

grep -r "migration" ~/.claude/projects/
Enter fullscreen mode Exit fullscreen mode

This works, technically. It also returns raw JSONL with tool-call metadata, system prompts, base64-encoded images, and content blocks nested several levels deep. Finding the actual conversation inside that output is its own project.

There are third-party tools that index these files — CLI searchers, desktop apps, VS Code extensions. They're useful, but they all live outside the terminal where the conversations happened.

The conversations are on your disk. The search isn't.

What if search lived where you work?

PonyMux 0.10 added full-text search across your Claude Code and Codex conversation history, built into the same Cmd+K search you already use to find Terminals.

Search: Searching 'polish' — Terminal metadata results and transcript matches appear together, with the matched conversation highlighted on the right.

Press Cmd+K, type a keyword, and results appear in two layers. The first layer matches Terminal names and metadata — the same search from 0.9. The second layer searches conversation content: every prompt you've typed, every response the agent gave, every tool it used. Both layers share one search bar and one set of scope pills.

The Transcripts pill filters to just conversation matches. Each result shows the session title, a matched snippet, the agent type, and when it was last active. Select one and the right side shows the matched messages with your search terms highlighted.

How the index works

The first time you launch 0.10, PonyMux builds a full-text index from your transcript files. It takes around 10–30 seconds depending on how many conversations you have. After that, new conversations are picked up within seconds via filesystem events.

The index uses FTS5 with trigram tokenization, which means it handles substring matches and CJK text without special configuration. A search for "migrat" finds "migration", "migrating", and "migrate". Chinese and Japanese terms match the same way.

Settings — Advanced: Transcript Index in Settings → Advanced. The status row shows how many sessions and messages are indexed.

The index is a separate SQLite database (search.db). It doesn't touch your metadata or your Terminals — you can rebuild it, pause it, or turn it off entirely from Settings → Advanced without affecting anything else.

Your agents have been keeping a complete record of every conversation. Now you can actually use it.

What changes about ended Terminals

This one is a side effect that turned out to matter more than I expected.

Before 0.10, selecting a sleeping Terminal showed a static screen capture — a frozen frame of whatever the terminal surface looked like when the process exited. It told you what was on screen, but not what the agent was thinking or what you'd asked it to do.

Now it shows the last conversation. The actual messages — your prompt, the agent's response, the tools it called — rendered directly in the Terminal area. You can read the exchange, decide whether to resume, and choose Resume or Shell Only.

The difference sounds small until you use it. A screenshot of a terminal says "the cursor was here." A conversation says "here's what we were working on and here's where we stopped."

Resume finds the right session

One more thing that fell out of transcript search: when you find a Terminal through search and hit Resume, PonyMux targets the matched session, not the most recent one. If search found a conversation from three days ago, that's what resumes.

A banner at the top shows the session name and date so you're never guessing which conversation you're about to continue.

The state of agent conversation search

This is still early. Claude Code deletes transcripts older than 30 days by default, so the search window has a built-in limit. Codex compresses older files to .zst, which PonyMux can't index. And the index itself is local — there's no cloud sync or cross-machine search.

But for the conversations that are on your disk right now, having them searchable from the same place you run your agents changes the daily workflow more than I expected. I stopped grep-ing JSONL files on day two.

For the full details — scopes, ranking, index management — see the Search docs.

Top comments (0)