Where Kimi Code stores session history
Kimi Code groups sessions by working directory, then gives each session its own folder:
$KIMI_CODE_HOME/sessions/wd_<name>_<hash>/session_<uuid>/KIMI_CODE_HOME defaults to ~/.kimi-code. There is also a flat index at the root of that directory:
~/.kimi-code/session_index.jsonlThe wd_ group directory
The wd_ prefix stands for working directory. The name that follows is the project folder's own name plus a short hash of its full path:
~/.kimi-code/sessions/wd_blog_dbc648dfdf98/The hash keeps two projects named blog in different parents from landing in the same bucket, so the directory listing is enough to tell projects apart.
What is in a Kimi Code session directory
state.json ← session metadata
agents/main/wire.jsonl ← the transcript
logs/
media/wire.jsonl under agents/main/ is the primary transcript. The agents/ level exists because a session can run more than one agent, and main is the one you talked to.
Reading a Kimi Code session from the terminal
List your sessions with their titles, newest first:
jq -r '[.updated_at, .title] | @tsv' ~/.kimi-code/session_index.jsonl | sort -rPrint a transcript:
jq -r 'select(.type) | .text // .content // empty' \
~/.kimi-code/sessions/wd_blog_*/session_<uuid>/agents/main/wire.jsonlInspect one session's metadata:
jq . ~/.kimi-code/sessions/wd_blog_*/session_<uuid>/state.jsonOr open it in an app
Sessions Viewer reads wire.jsonl into the same conversation view as every other agent, keeps the media/ attachments inline, and treats the session directory as the unit for renaming and deleting. It also reads Claude Code, Codex, Grok Build, Pi, Antigravity CLI and opencode.
