Adding memory to prime-agent

no hooks, an extension API — and one file is the whole install

prime-agent writes every session to ~/.prime/agent/sessions as JSONL and can list them. A new session reads none of them, and none of the sessions the other agents on this machine wrote either — including the one where the same problem was already solved.

Adding recall

deja install prime

That writes two things: the deja MCP server into ~/.prime/agent/settings.json, so the model can ask for history itself, and an extension at ~/.prime/agent/extensions/deja.ts, which is what makes recall arrive without being asked:

  • The project digest on the first turn — what this machine settled here — followed by recall on every prompt, both through before_agent_start.
  • Forgetting on compaction: when session_compact throws away the blocks the session was shown, the list that stops them repeating goes too, so recall can say them again.
  • A /deja command in the same session, for asking directly.

What is deliberately not wired

The repair beside a failed command, which Claude Code, Codex, Gemini and Qwen all get, is missing here for a measured reason: on prime-agent 0.9.1 the tool_call and tool_result events never fire, so a handler on them is a process spawned for nothing. It becomes work the day they do.

The part that is not about this harness

The index covers every agent's transcripts on the machine — twenty-five of them, each in its own format — so a fix found in Claude Code answers a question asked here, including sessions from before any of this was installed. An injection is capped at 1,536 bytes per prompt — what memory costs has the measured comparison. 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 prime-agent session format