Coding agents start every session lost.
Cairn is institutional memory for coding agents. Run one command in a repository and your agents get a map of the code, the intent behind it, what happened to it, what the team learned and what earlier agent sessions did. One CLI, one MCP server, one local page.
$ uv tool install --python 3.12 cairn-brain
The repository, mapped, before the agent touches a file.
The map: files, symbols, calls and imports, read from the code itself. Specs: the requirement and task that produced each file. Timeline: fixes, reverts and the files that change together. Memory: conventions, decisions and gotchas the team recorded. Sessions: what earlier agents did, summarised for the next one.
- What is the code?Map
- What did we intend?Specs
- What happened to it?Timeline
- What did we learn?Memory
- What did agents do?Sessions
Useful on day one, with no model at all.
These are built from Tree-sitter ASTs, git history, specs and the memory the repository already contains. Evidence is tagged extracted or inferred so the agent knows what to trust.
cairn impactDependents, tests likely affected, files that usually change together, past fixes and reverts, the spec task that owns the code, team conventions, recent agent work and a risk level.
cairn whyRationale comments, the commits behind the lines, the requirement and task that produced the code, and recorded decisions.
cairn driftDone tasks whose files are missing, requirements that no task covers, and code that changed after its task was closed.
The map
cairn trace,cairn hubs,cairn areasandcairn graphfor views, the report, the wiki and exports.Session capture
Prompts, files read and changed, and commands, recorded locally. On for Claude Code by default; other agents can turn it on.
cairn uiOne local page with the map, specs, timeline, memory and sessions, and the size of every context pack it served.
Install it once. Every commit and session after that adds a stone.
Setup is idempotent and asks no questions. cairn uninstall removes what it added.
- 1
Run
cairnIt adds the spec workflow, wires every agent it detects to the Cairn MCP server, installs git hooks and runs the first sync, then starts the local page.
- 2
Agents ask first
Before an edit, the agent calls
cairn_context,cairn_impactorcairn_whyover MCP instead of re-reading the tree. - 3
It compounds
Git hooks re-sync in the background, so a commit never waits on Cairn. Captured sessions become observations the next session starts with.
See it before you install it.
Recorded on Cairn's own repository and its real interface: why agents start from zero, and what a session-start brief looks like. The film plays only when you press play.
Leave a marker for the next agent.
Two commands. Your next session starts with what the last ones learned.
$ uv tool install --python 3.12 cairn-brain