Adding memory to Kilo Code

two stores, and a plugin seam in the CLI

Kilo Code keeps two stores, and which one holds your history depends on how you use it. The extension writes Roo's task shape under the editor's global storage — tasks/<taskId>/api_conversation_history.json — and the CLI writes OpenCode's message schema to ~/.local/share/kilo/kilo.db. Kilo vendors OpenCode and its own legacy-migration imports the task directory into that database, so the task files are the history of anyone who used Kilo before the migration and the database is where it goes afterwards. deja reads both.

Adding recall

deja install kilocode

That writes three things:

  • The MCP server, into <globalStorage>/kilocode.kilo-code/settings/mcp_settings.json for every host that carries the extension, and into the CLI's own <config>/kilo/kilo.jsonc — Kilo vendors OpenCode, so the CLI takes OpenCode's mcp block. One tool with a mode: search past sessions, read one in full, see a file's history, ask what fixed an error, ask how a command is really run here, get the commands and files this project's past sessions worked with, store a decision.
  • The deja-history skill, into ~/.kilocode/skills, which is where Kilo's loader looks first. It is what tells the model when to look: before the first edit in a task, before calling a change done, before re-debugging an error, when you say "didn't we fix this".
  • The /deja command, at <config>/kilo/commands/deja.md, where Kilo's workflows doc puts global commands, for asking directly.

On a machine with the CLI and no editor, the CLI config, the skill and the command are still written, and the run says the extension's settings were not, rather than reporting a server it wired nowhere.

Session-start recall in the CLI and the extension

deja install kilocode-auto

Everything above, plus <config>/kilo/plugins/deja.js. Kilo's CLI is OpenCode vendored and kept its plugin loader, so this is the plugin opencode-auto writes: the project digest goes in front of the first request of each session, the prompt you just typed gets its own recall, and a file read or a failed command gets one line about its history. It is always the OpenCode 1.x shape, because that is the loader Kilo 7.8.3 carries; it refuses the 2.x one.

The extension gets the same plugin. Kilo 7.x's VS Code extension starts its bundled CLI as kilo serve and keeps your XDG_CONFIG_HOME, so the server it runs loads ~/.config/kilo/plugins/deja.js as a terminal session does.

Reading the CLI store

The database half needs the sqlite3 CLI, and deja doctor says so by name when it is missing rather than reporting a store with no sessions in it.

The part that is not about this harness

The index covers every agent's transcripts on the machine — forty-three of them, each in its own format — so a fix found in Kilo Code answers a question asked in Claude Code, and the Roo tasks you had before switching are read too. Nothing here writes memories, so there is nothing to hallucinate into your history; indexing and search are local, and credentials are stripped as the index is built (privacy).

Getting started · Switching between agents · The Kilo Code session format

Found this useful? Star deja-vu on GitHub.