Adding memory to Command Code

it logs a session per project and starts each one cold

Command Code writes a JSONL log per project under ~/.commandcode/projects/ and reads none of it back: a new session knows nothing about the last one, or about what you did in Claude Code or Cursor in the same repo. This page is about adding that.

What Command Code already has

The project logs, and four user-scoped surfaces under ~/.commandcode: mcp.json for servers, settings.json for hooks in Claude's shape, skills/<name>/SKILL.md, and commands/<name>.md for slash commands. No resume flag is documented, so deja hands you a paste rather than a command that may not exist.

Adding recall

deja install commandcode-auto

All of it reversible with deja uninstall commandcode-auto:

  • The MCP server in ~/.commandcode/mcp.json — search past sessions, read one in full, see a file's history, ask what fixed an error, store a decision.
  • Three hooks in settings.json: SessionStart carries the project digest, PreToolUse answers before a SHELL, EDIT or WRITE call, and PostToolUse answers after a SHELL one. Command Code documents no per-prompt event, so the digest rides session start and the rest is the tool-time pair. Timeouts are in seconds here — its unit, default 30 and 600 at most — not the milliseconds other settings.json clients take.
  • The slash command at commands/deja.md, so /deja what did we decide about retries works without the model choosing to look.
  • The skill at skills/deja-history/SKILL.md.

One trap worth knowing before you test: the matcher is a regex over Command Code's own tool names — SHELL, READ, EDIT, WRITE, SEARCH, GLOB, LIST — so a Claude-shaped Bash matcher copied from another config never fires.

And what is actually verified: the reader and the paths. A Command Code store indexes and searches, and the installer writes those four files on a machine that has never run the tool. The hook behaviour comes from two independent integrations citing the vendor's docs rather than from a run against the CLI, which is closed — the registry entry says as much.

What arrives

At session start, a short digest of what this machine has done on the project. Before a shell or edit call, the history that call is about, when there is any; after a failing one, what fixed that error last time. 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 Command Code

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 Command Code, 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 Command Code session format

Found this useful? Star deja-vu on GitHub.