All projects
Building

Codexscope

A macOS app and CLI that indexes your local Codex sessions, opens a search hit at the exact turn, and rebuilds subagent families from the logs.

Codexscope search results beside a session transcript

A search hit opens at the matching turn, with the whole transcript beside it. The sessions shown are bundled fixtures.

Finding one turn in 2,228 files

Codex saves every session to ~/.codex/sessions as a JSONL file, one event per line. By June I had 2,228 of them. grep tells you which file mentions something. Then you're scrolling a long log of tool calls for the one turn that matters, and grep can't tell you whether that turn is still part of the conversation. Codexscope indexes messages, reasoning, tool calls, and tool output as separate search hits, so a result opens the transcript at that turn.

The macOS app and the codexscope CLI share one Rust engine and one SQLite index. In the terminal, codexscope search --exact does a plain substring match, so src/app/page.tsx doesn't get split into words first.

Rewinds stay in the file

When you rewind a Codex session and edit an earlier message, Codex doesn't start a new file. It appends a thread_rolled_back event with the number of turns to drop, then keeps writing below it. The abandoned branch is still in the log, so a plain text search will happily match messages that are no longer part of the conversation. Codexscope replays those events while parsing and marks the dropped turns as superseded. The app's search skips them by default, and the transcript has a toggle to bring them back. In the CLI, --active does the same.

Codexscope displaying a session and its related subagent family

A root session and the subagents it spawned, as one family you can click through. Also fixture data.

Rebuilding the subagent tree

Subagents get their own session files. A child's file opens with its own session_meta, which names its parent and its depth, and then carries copies of the metadata it inherited from the parent. An older Codex log parser let those later copies overwrite the first record, so grandchildren got filed under the wrong parent. Codexscope trusts the first session_meta in each file and builds the family from there.

What my real archive broke

My June smoke test on the real archive failed three checklist items, and a fourth was blocked.

Pointing the app at a 50-session test folder took 72 seconds. Fifty files! Worse, the switch deleted the index for the other 2,228 sessions, because the indexer treated anything outside the current folder as stale. Switching back took about two minutes to re-parse everything it had just thrown away. Now each indexed file remembers which folder it came from, the other folder's index stays put, and a switch only processes files that are new or changed. Keeping that data around needed one guard: an unplugged drive often leaves an empty folder behind, which looks exactly like "you deleted all your sessions." A folder that suddenly has no files, but used to, is treated as unavailable instead of empty.

Saving that folder change also froze the whole app on a beach ball. The save ran on the macOS main thread and waited for the indexer to finish its pass. It runs off the main thread now.

What's still rough

Every launch shows a "Loading sessions" screen while the app checks the index, even when nothing has changed and everything it needs is already on disk. In a June run, after a full index of about 2,000 sessions, the progress counter sat at its maximum for another 30 seconds. I never figured out why. The unplugged-drive guard has a cost too: if you really do empty a folder, its old sessions stay indexed until you remove that folder and purge them in settings. And there's no signed build or public release yet.