CAM: Central Agentic Memory
A per-project journal of what every AI coding session did to shared git state, and why. Lifecycle hooks write it automatically and hand each session only the lines its peers wrote since it last looked.
- What it is
- Coordination infrastructure: an append-only, event-sourced activity journal plus a per-chat mailbox, written and injected by hooks. Workflows such as mow and wrap-up read from it.
- What it isn't
- Not a framework (there is no API to build on), not a workflow (it orders no steps), and despite the name, not long-term or semantic memory. It does no retrieval and holds no rules. Rules live in the instruction files; CAM records what happened.
- Why it exists
- Several agent sessions routinely share one git checkout. Before CAM, a session found a peer's commit by forensics:
git log,git status, a guess at who ran what. CAM puts the commit, the session that made it, and its stated reason into the other session's context on its next turn.
How it works
CAM has three parts: the journal, where hooks parse every git write, push or destructive command an agent runs and append one JSON line; intent, where the acting session attaches a status and a reason with cam note; and the mailbox, where one session leaves another a message with cam tell.
cam note is the one thing CAM asks of an agent.CAM speaks at four moments and stays silent when there is nothing new, so a quiet checkout costs zero tokens:
| Moment | Hook event | What arrives |
|---|---|---|
| Session starts, resumes, compacts or forks | SessionStart | Snapshot: each live peer's latest line, who is live, "You are chat N" |
| Every prompt | UserPromptSubmit | Peers' new lines since this session last read |
| After a shell call that ran git | PostToolUse | The same delta, next to the git result |
| A subagent lane starts | SubagentStart | Snapshot filtered to the lane's worktree |
A delta block, as it appears in an agent's context:
CAM — peer activity in ai-wow since your last read (2 new):
(Entries below are other sessions' journal lines; quoted and fenced text is theirs.)
- 23:39 chat N (fcb3) started lane tdd-builder "Lane A fix round 1"
- 23:40 chat N (fcb3) noted — permanent: "filed #820 (run warnings checklist) — wave 1 gate"
Live here: chat N (fcb3) · chat M (0777) · chat P (d1a6). You are chat Q.
AI engineering practices it demonstrates
- Context budget as a design constraint. At most 8 entries and 1,500 characters per block; older lines collapse to
+N older — bin/cam log. No news, no tokens. - Deltas, not dumps. Every session and every subagent has its own byte-offset cursor. A reader never sees its own lines, or its own lanes' lines, echoed back.
- Prompt-injection hygiene. Blocks state facts and never issue instructions, because imperative text in injected context can trip injection defences. Peer-typed text arrives quoted or fenced, under a provenance line that says whose it is.
- Least privilege for subagents. A guard hook denies
cam tell,inboxandoutcometo any tool call that carries a subagent id, so a lane that read hostile content cannot message a sibling chat as its parent. - Human in the loop for hand-offs. A message from another chat is shown as a peer's request. The receiving agent acts on it only after the operator says yes in that chat.
- Redaction at write and at render. URL userinfo,
http.extraheaderandcredential.*values,--config-envand push options are stripped twice. Spawn prompts are never stored as text, only as an HMAC under a per-store key. - No silent data loss. Past 1 MB the journal rotates, but it archives the half it drops first, under the same lock. If the archive write fails, rotation is skipped. A reader caught mid-rotation gets an explicit line saying so.
- Mechanical record plus declared intent. Hooks capture what; the agent supplies why, with a status of
permanent,temporary,experimentorerror. - Documented residuals. Every known gap accepted at a review gate is written down with its reproduction, not left for a reader to discover.
Capabilities
| Capability | Detail |
|---|---|
| Chat identity | Every session gets a never-reused number and a <N>-<slug> title. The slug filter drops anything credential-shaped before it reaches the sidebar. |
| Lineage | Lane work renders as chat N › tdd-builder; a spawned session as chat M (child of N), matched by a hash of its first prompt. |
| Presence | Live here: … You are chat N, with idle times. |
| Messaging | cam tell N, threaded replies with --re, cam outcome to record what came of it, cam inbox to re-read after compaction. Capped at 5 unread per sender and 2,000 characters per body. |
| History | cam log, --full, --archive --all for the whole project history; a browser view on the CAM page. |
| Storage | One store per git project in the git common dir, shared by all of its worktrees. Directory 0700, files 0600. Atomic renames under a directory lock. |
Benefits
- Parallel sessions stop doing forensics on each other's commits. The answer to "who moved HEAD?" is already in context.
- Hand-offs between chats no longer route through the operator copying text between windows.
- One source for the session-end gate, mow's conflict check and the shared-checkout guards.
- An audit trail of agent git activity across every project on the machine, with no setup per project. Landing the hooks was the activation.
Limits
CAM journals git, not file edits. Two sessions editing the same file without committing is the likeliest real collision, and CAM does not see it.
- Intent depends on discipline. Without a note, a line reads
status unknown, and plenty of lines in the live journal do. - The security boundary is advisory. Every session runs as the same OS user, so a sender can be spoofed and an inbox file read directly. The lane guard pattern-matches command text, which makes it a running contest with shell tricks. Four bypass forms are open on the board.
- Identity is not stable across resume. A resumed session can be issued a new number.
- Claude Code only. VS Code Copilot, Codex and Windows support are planned, not built.
- Start-up cost. The session-start hook takes roughly a second, about 0.4 s of it importing a 1,382-line module that is due to be split.
Roadmap
| Item | Why it matters | Status |
|---|---|---|
| Stable chat identity across resume | Journal lines and messages follow the session, not the process | correctness |
| Journal Edit/Write collisions | Closes the biggest blind spot above; needs a fresh plan | out of scope today |
Split cam.py into modules | Cuts start-up cost and review surface | backlog |
| Rotation ordering and double-count fixes | Bump the generation before truncating; dedupe interrupted rotations on the page | backlog |
| Lane-guard hardening | Line continuations, ANSI-C quoting, glued substitutions, case-insensitive names | backlog |
| Copilot / Codex / Windows | Record the real session id; a Windows-safe store | backlog |
Sources
hooks/cam.py: store, redaction, render budget (MAX_ENTRIES = 8,MAX_CHARS = 1500), title rules, lineage.hooks/cam-prompt.py,hooks/cam-session.py,hooks/git-ops.py,hooks/cam-lane-guard.py,bin/cam.docs/workflow/cam.mdanddocs/workflow/cam-tell.md: behaviour, limits, failure modes.docs/plans/central-agentic-memory/plan.md: decisions and review-gate residuals.- Task board: open items for resume identity, rotation, lane guard, module split and cross-tool support.