Cairn Working beta Open source · Apache-2.0

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
No API key No Docker, no database server Runs on your machine
Five layers

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.

  1. What is the code?Map
  2. What did we intend?Specs
  3. What happened to it?Timeline
  4. What did we learn?Memory
  5. 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 impact

    Dependents, 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 why

    Rationale comments, the commits behind the lines, the requirement and task that produced the code, and recorded decisions.

  • cairn drift

    Done 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 areas and cairn graph for 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 ui

    One 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. 1

    Run cairn

    It 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. 2

    Agents ask first

    Before an edit, the agent calls cairn_context, cairn_impact or cairn_why over MCP instead of re-reading the tree.

  3. 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.

One minute, narrated and captioned

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.

More films and a live demo at cairn.spreix.com

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