Adding memory to Claw Code
append-only JSONL logs under ~/.claw/sessions and recall across all forty-seven agents
Claw Code (claw) writes append-only session logs and legacy snapshots on disk and can resume a specific run, but a fresh session reads none of your earlier runs — and nothing recorded in Claude Code, Codex, Cursor, or opencode. This page covers wiring deja into Claw Code.
What Claw Code already has
Transcripts live in ${CLAW_CONFIG_HOME:-~/.claw}/sessions/*.jsonl alongside legacy *.json files (DEJA_CLAWCODE_ROOT and DEJA_CLAWCODE_ROOTS override the paths). deja parses session_meta headers, prompt_history entries, and message turns including tool_use and tool_result blocks (read_file, write_file, edit_file, bash), while skipping .meta.json and .deleted.json sidecars. To reopen a specific transcript directly, run claw --resume <id> from its recorded workspace_root.
Adding recall
deja install clawcode
That writes three pieces under ${CLAW_CONFIG_HOME:-~/.claw}, all reversible with deja uninstall clawcode:
- The MCP server in
settings.jsonundermcpServers.deja, exposingrecall,fix,blame,how,orient,context,remember, andhandoff. - The
deja-historyskill atskills/deja-history/SKILL.md. - The
/dejacommand atcommands/deja.md.
Pre-tool and error hooks
deja install clawcode-auto
Everything above, plus three hooks written into ${CLAW_CONFIG_HOME:-~/.claw}/settings.json (reversible with deja uninstall clawcode-auto):
PreToolUse(deja hook-tool): injects file decisions before reads/edits or prior error fixes before shell runs.PostToolUseandPostToolUseFailure(deja hook-tool-after): captures failed-command outcomes so the next attempt carries the repair that worked earlier.
Claw Code does not expose a user statusLine hook in its terminal chrome, so deja leaves status output out.
The part that is not about Claw Code
The local BM25 index (~/.cache/deja/index.db) covers every agent's transcripts on the machine — forty-seven of them today, each in its own format — so fixes recorded in Claude Code, Codex, or opencode answer questions inside Claw Code, and vice versa. Indexing and search stay local, with API keys and tokens scrubbed as the index is built.
Getting started · Switching between agents · The Claw Code session format
Found this useful? Star deja-vu on GitHub.