Search Claude Code session history: kioku

Claude Code keeps every session on disk, but it has no way to search across them. kioku is a terminal tool that indexes those transcripts and returns the individual messages that match, so you can find the conversation and pick it up again.

Where Claude Code keeps its sessions

kioku reads Claude Code transcripts from ~/.claude/projects. If you set $CLAUDE_CONFIG_DIR, it reads $CLAUDE_CONFIG_DIR/projects instead. To point it somewhere else, set KIOKU_CLAUDE_DIR to the transcript folder.

It only reads. kioku never edits Claude Code transcripts; the one thing it writes is its own index in ~/.cache/kioku.

Search the sessions

brew install Ray0907/kioku/kioku
kioku --harness claude "rate limit"
kioku --harness claude --since 7d 部署
kioku results list with the matching messages on top and the session transcript below

Resume the session you found

Select a result and press Enter. kioku runs claude --resume <id> in the session’s original directory, so the agent opens with that conversation loaded. Press y to copy the command instead, or o to open the project in your editor.

Let Claude Code search its own history

kioku ships a Claude Code plugin. Install the binary first, then run:

/plugin marketplace add Ray0907/kioku
/plugin install kioku@kioku

After a restart, Claude Code gets four read-only tools (kioku_search, kioku_sessions, kioku_show, kioku_context) and a skill that tells it when to use them. A SessionStart hook also runs kioku context, so each new session starts with the project’s recent sessions listed.

Related