Skip to content

← agentcairn

Bring Claude Code’s memory to every supported agent

Claude Code’s auto-memory is useful, but it stays inside Claude Code. Agentcairn v0.25 adds a one-way bridge into the same Markdown vault used by Codex, Cursor, OpenCode, Hermes, and other supported hosts.

The bridge complements Claude’s native memory rather than replacing it: Claude keeps learning as before, while you choose when to copy that durable context into shared cross-agent recall.

Auto-memory was introduced in Claude Code 2.1.59 and must have created files for this repository before there is anything to import. See Claude Code’s auto-memory documentation to inspect or manage it with /memory.

Preview first

Run the importer from a repository where Claude Code has created auto-memory. Preview is the default and performs no writes:

uvx --from agentcairn cairn import claude-memory

Swipe to view the full command →

The report shows what would be added, updated, left unchanged, repaired, or expired. Apply that exact plan only when it looks right:

uvx --from agentcairn cairn import claude-memory --apply

Swipe to view the full command →

What crosses the bridge

  • Claude auto-memory only. MEMORY.md and its topic Markdown files are eligible.
  • Instructions stay out. CLAUDE.md, CLAUDE.local.md, and .claude/rules/ are not memories and are never imported.
  • One repository at a time. The current repository is the default. Use --project ../other to target another one.
  • Explicit source when needed. Use --source <dir> for a custom or managed Claude memory directory. Ambiguous discovery fails closed instead of guessing.

Provenance and history

Imported notes record Claude Code, the project, and the source file as provenance. Recognized credentials are redacted before the plaintext Markdown is written. Model-authored context remains labeled as imported evidence rather than being mistaken for a user instruction.

Re-running the command is idempotent for unchanged files. A changed file creates a new version and supersedes the old one; a source file that disappears expires its imported note. The prior versions remain inspectable instead of being silently overwritten.

Agentcairn stores lifecycle metadata inside .agentcairn/native-memory/ in the vault. That registry also prevents an unchanged source from resurrecting a note you deliberately deleted.

Recall it elsewhere

After --apply, the importer normally reconciles the DuckDB cache so supported hosts connected to that vault can recall the new Markdown. If embedding or reconciliation fails, the CLI warns instead of hiding the problem: the Markdown remains durable, and the next successful reconcile makes it available for indexed recall. Codex can then recall a decision Claude learned; Cursor can search it; Obsidian can show you the underlying note and provenance.

Everything stays local with the default FastEmbed configuration. If you opt into a cloud embedder, redacted note chunks and recall queries are sent to that provider. If you enable the Anthropic durability judge for ingest or sweep, candidate redacted session text is sent for judgment.

See supported agents · Inspect memory in Obsidian · How cross-agent memory works

FAQ

Does agentcairn change Claude Code's memory files?

No. The importer is a one-way, read-only bridge. It reads Claude Code's auto-memory and writes versioned notes into your agentcairn vault; it never writes back to Claude's files.

Does it import CLAUDE.md or project rules?

No. It imports MEMORY.md and topic Markdown files from Claude Code's auto-memory directory. CLAUDE.md, CLAUDE.local.md, and .claude/rules are instructions, so they are deliberately excluded.

What happens when Claude Code updates or removes a memory?

A changed source creates a new imported version and marks the previous one superseded. A missing source expires the imported version. Prior history stays inspectable in the Markdown vault.

Can I preview the import without changing anything?

Yes. Preview is the default. The command scans only the current repository and reports additions, updates, unchanged files, expirations, and redactions. Nothing is written until you add --apply.

Is imported memory encrypted?

No. The vault is readable plaintext Markdown by design. Agentcairn redacts recognized credential patterns before automated writes, but unknown patterns and manual edits remain your responsibility.

Get started

Preview this repository's Claude Code auto-memory without a prior persistent install:

uvx --from agentcairn cairn import claude-memory

Swipe to view the full command →

GitHub · Full quickstart