Adding memory to CodeWhale

every session is one JSON file, and nothing reads the old ones

CodeWhale writes one pretty-printed JSON file per session under ~/.codewhale/sessions/ and can resume one. The next session starts from nothing, and nothing in it knows about the Claude Code or Cursor session in the same repo last week. This page is about making that history reachable.

What CodeWhale already has

The session files, and a way back into one. $CODEWHALE_HOME moves the whole store, and a machine that has not finished the rebrand still keeps ~/.deepseek/sessions, which CodeWhale itself migrates on first access — deja walks both roots. A session is {schema_version, metadata, messages}, and the message blocks are the Anthropic shape, so the tool calls, the files they touched and what they printed come apart with the same code the Cline and Claude readers use. Messages carry no timestamps of their own, so deja clocks them from the session's created_at, a millisecond per record, which is what keeps two identical turns in order.

This is not the DeepSeek Harness deja reads as deepseek: that one keeps zstd-framed JSONL under ~/.dsh and has its own page.

Adding recall

deja install codewhale-auto

That writes the MCP server into ~/.codewhale/mcp.json, adds its tool to tools.always_load (CodeWhale starts a server only when a tool of it is named there), puts deja's hooks in config.toml and the deja-history skill under ~/.agents/skills. Your own entries in those files stay as they are, and deja uninstall codewhale-auto takes out only deja's.

What arrives

  • The MCP server, with the deja tool and the modes it serves everywhere.
  • A digest of where you left off in the repo, with the session's first message: CodeWhale drops what session_start prints, so message_submit carries it.
  • Recall for each message, and before an edit the file's history, on tool_call_before. For a call that failed to run, the line waits for the next tool call or message.
  • After a failed command, the fix that worked last time. tool_call_after output never reaches the model, and it fires after the next tool has already started, so the pair rides your next message.
  • After a compaction, the state of the work, on the next message or tool call.
  • /deja in the slash menu, from ~/.codewhale/commands/deja.md.

CodeWhale's footer takes only its built-in items, so there is no deja status line here.

The part that is not about CodeWhale

The index covers every agent's transcripts on the machine — forty-three of them, each in its own format — so a fix found in Claude Code answers a question asked in CodeWhale, 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 CodeWhale session format

Found this useful? Star deja-vu on GitHub.