Adding memory to ZCode
two stores hold the history, and one config file holds the wiring
ZCode keeps two stores: a JSONL log per project under ~/.zcode/projects/ and the CLI's own SQLite database at ~/.zcode/cli/db/db.sqlite. deja reads both — the database needs sqlite3 on PATH — and neither is read back by ZCode itself, so a new session starts from nothing. This page is about adding that.
What ZCode already has
The two stores, and one config file that holds every surface worth wiring: ~/.zcode/cli/config.json, with servers under mcp.servers and hooks under hooks in Claude Code's shape, down to the nesting. A --resume <SESSION_ID> flag exists in its headless contract, but every documented invocation runs the app bundle's own runtime with a mandatory --prompt, which is a turn rather than reopening a session for a person to continue — so deja hands you a paste instead of printing a command that needs one.
Adding recall
deja install zcode-auto
One file is touched, and both halves are reversible with deja uninstall zcode-auto:
- The server under
mcp.servers— a level deeper than themcpServersevery other client here uses, which is why it gets its own writer rather than the shared one. - Two hooks under
hooks, the two events deja has something to say at:SessionStartputs the project's memory in front of the model before the first prompt, andUserPromptSubmitanswers the prompt that was just typed.
Three details about that hook block, taken from the surface a third-party memory plugin established against a live install rather than from guesswork:
- Hooks declared in the config file run only with
hooks.enabledset. - There is no template expansion in a config hook, so the command carries an absolute path — deja writes its launcher,
~/.config/deja/bin/deja-hook, so the wiring survives the binary moving. - The output schema is strict enough to discard a whole response over one unrecognised key, which is what deja's
--strictmode is for.
ZCode has no user-level skill directory anyone has found and no custom-command surface, so guidance reaches the model through the tool descriptions and the injected session block instead of a file.
What arrives
Before the first prompt, a short digest of what this machine has done on the project — decisions, the commands that worked, the errors that recurred. On each prompt, the history that prompt is about, when there is any. Silence is the common case, and an injection is capped at 1,536 bytes per prompt and about 4 KB per tool call. What memory costs has the measured comparison.
The part that is not about ZCode
The index covers every agent's transcripts on the machine — thirty-four of them, each in its own format — so a fix found in Claude Code answers a question asked in ZCode, including sessions from before any of this was installed. A transcript a client later deletes stays searchable; only deja forget drops one on purpose. 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 ZCode session format
Found this useful? Star deja-vu on GitHub.