How to delete Kimi Code session history, and what you lose

Each session is a directory; remove the whole directory, not just the conversation file

Kimi Code keeps one directory per session. The conversation and the session's title and timestamps live in different files inside it, so deleting only one of them leaves a half-deleted session.

Where the sessions are

${KIMI_CODE_HOME:-~/.kimi-code}/sessions/<workDirKey>/<sessionId>/
  agents/main/wire.jsonl
  state.json

wire.jsonl is the conversation. state.json beside it holds the title, the working directory and the timestamps. Setting KIMI_CODE_HOME moves the whole tree. <workDirKey> groups sessions by the directory they ran in.

How to delete one session

Close Kimi Code first so a running session cannot rewrite its files, then remove the session's directory:

rm -r "${KIMI_CODE_HOME:-$HOME/.kimi-code}/sessions/<workDirKey>/<sessionId>"

Do not delete only wire.jsonl: the state.json left behind still lists the session, now with no conversation behind it.

To clear everything, remove the sessions directory. That removes every session of every project; the rest of the tree, such as config.toml and mcp.json, is not touched.

What you lose

The conversation, the tool calls and results, and the title and timestamps that identify the session. Sub-agent histories under agents/<agent-id>/ go with the directory. Kimi Code cannot bring a deleted session back, and kimi --session <sessionId> no longer finds it unless you have a separate backup.

Keeping it searchable instead

deja reads Kimi Code sessions, alongside the other agents' histories, into one local index:

curl -fsSL https://raw.githubusercontent.com/vshulcz/deja-vu/main/install.sh | sh
deja "Kimi Code session about the refactor"

Indexing and search stay local, credentials are stripped, and deja forget removes a session from the index when you do want it gone. deja reads KIMI_CODE_HOME too; DEJA_KIMI_ROOT overrides it for deja's reads only, so set it to point deja at a copy or a backup of the tree.

Where every agent keeps its history · Memory for Kimi Code · The Kimi Code format

Found this useful? Star deja-vu on GitHub.