agentcairn CLAUDE.md

Project instructions for agentcairn, a local-first system that stores agent memories in an Obsidian Markdown vault and builds a searchable DuckDB index from them. It also documents its command-line tool, read-only MCP server, plugins, and release process.

In plain words
What is it for?
Use it when changing agentcairn, its memory capture and search flow, its CLI or MCP server, its plugins, configuration, documentation, or release process.
Why use it?
It gives coding agents the project’s established decisions and constraints so they can work consistently without rediscovering the system’s design.

Instructions file

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/ccf/agentcairn/claude-md
Clone the repo
git clone --depth 1 https://github.com/ccf/agentcairn
Per session 1,890 This file is loaded in full into every session.
When invoked 1,890 The same file — it is already loaded in full.
Security scan C 2 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.01890 $0.01890
Opus 5 $0.00945 $0.00945
Sonnet 5 $0.00378 $0.00378
Haiku 4.5 $0.00189 $0.00189

Measured 3d ago against content hash c6e8755edeee, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade C, and why

agentcairn CLAUDE.md scanned grade C with 2 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

**Plugins:** agentcairn ships a **Claude Code plugin**, a **Codex plugin**, and an **Antigravity plugin** — all three reuse the same `using-agentcairn-memory` skill and bundled MCP server. The Codex plugin is discoverabl

Unrestricted tool accessmediumExcessive agency

A wildcard tool grant or "run any command" leaves no least-privilege boundary at all.

- Run any command: `uv run <cmd>` (e.g. `uv run pytest`, `uv run cairn --help`)
CLAUDE.md · 58 lines

How it starts

The opening of the file, as written. The whole thing — 58 lines — stays where its author put it; the contents beside it link to each section on GitHub.

agentcairn — project guide for Claude Code

What this is: a local-first agent-memory system. An Obsidian Markdown vault is the source of truth; a rebuildable embedded DuckDB index provides hybrid retrieval. Daemonless: a cairn CLI + an on-demand READ_ONLY MCP server. Capture is via out-of-band transcript ingestion + an agent remember tool — not live hooks.

Status (2026-06-13): Shipped and on PyPI — current 0.10.1. The full loop is implemented (cairn.vault/index/embed/search/ingest/mcp + CLI + Claude Code plugin). Specs live in docs/specs/ (the original is 2026-06-08-agentcairn-design.md; later ones cover the config file, the Layer-B LLM judge, antecedent resolution, and memory consolidation). Releases follow the cut-a-release ritual (CHANGELOG → tag → Trusted-Publishing → GitHub Release).

Plugins: agentcairn ships a Claude Code plugin, a Codex plugin, and an Antigravity plugin — all three reuse the same using-agentcairn-memory skill and bundled MCP server. The Codex plugin is discoverable via the Codex plugin marketplace; the Antigravity plugin installs from a local directory (agy plugin install takes a dir or a registered marketplace, not a git repo — so cairn install antigravity --source <plugin dir>). cairn install routes by host kind: for plugin hosts (claude-code, codex, antigravity) it installs the plugin by shelling to the host's own CLI; for MCP hosts (cursor, claude-desktop, vscode, gemini) it writes the MCP server config. The Antigravity plugin bundles the MCP server + skill; cairn install antigravity (via agy plugin install) also migrates away any stale mcpServers.agentcairn entry from ~/.gemini/config/mcp_config.json. Gemini, Cursor, and the other MCP hosts do not have plugins. Cursor is the exception among MCP hosts: it has no plugin system, but cairn install cursor ALSO installs the using-agentcairn-memory skill (alongside writing ~/.cursor/mcp.json) via Cursor's Host.skill_dir (~/.cursor/skills), writing ~/.cursor/skills/using-agentcairn-memory/SKILL.md — so any future host exposing a skill_dir can ship the memory skill the same way without being a plugin host.

Capture pipeline (ingest): transcripts from Claude Code, Codex, Antigravity CLI (~/.gemini/antigravity-cli/brain/<uuid>/.system_generated/logs/transcript.jsonl), and Cursor (<CursorUser>/globalStorage/state.vscdb, SQLite cursorDiskKV) are ingested automatically (auto-detected via a HarnessAdapter seam; cairn sweep picks up whichever harnesses are present). Gemini CLI transcript ingestion is not supported (Google is sunsetting Gemini CLI in favour of Antigravity CLI). Then: redact → structural candidate selection (authored user turns only) → judge (embedding/LLM tier; durability + optional distillation) → gate → distill → consolidate (semantic dedup + supersession, LLM-tier, fail-safe) → write. Redaction-before-write is mandatory; the judged cache is version-stamped (_JUDGE_CACHE_VERSION).

Read the full file on GitHub · 58 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 58 lines · 1,890 tokens per session scan C c6e8755edeee

Subscribe to this mod's changes

agentcairn CLAUDE.md is an instructions file published in the GitHub repository ccf/agentcairn (48 stars, last pushed 6d ago), licensed Apache-2.0. It adds 1,890 tokens to every session, about $0.0095 per session on Opus 5. A static security scan graded it C with 2 findings (reads agent configuration directories, unrestricted tool access). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.