using-agentcairn-memory

A workflow for giving a coding agent persistent memory stored in a Markdown vault owned by the user.

In plain words
What is it for?
Recalling relevant notes before a substantial task and saving durable decisions or fixes for later sessions.
Why use it?
It helps the agent reuse decisions and facts from earlier sessions instead of re-deriving them. It also makes clear that the separate AgentCairn integration must already be installed and loaded.

Skill for Claude CodeCodex

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 skills/ccf/agentcairn/using-agentcairn-memory
Any agent
npx skills add ccf/agentcairn --skill using-agentcairn-memory
Clone the repo
git clone --depth 1 https://github.com/ccf/agentcairn

Made for: Claude Code, Codex.

Per session 46 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 507 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 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.00046 $0.00507
Opus 5 $0.00023 $0.00253
Sonnet 5 $0.00009 $0.00101
Haiku 4.5 $0.00005 $0.00051

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

Security

Grade A, and why

using-agentcairn-memory scanned grade A with 0 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 2d 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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugin/skills/using-agentcairn-memory/SKILL.md · 42 lines

What it actually says

Using agentcairn memory

You have a persistent memory backed by agentcairn (a Markdown vault the user owns). Use it.

Require the full integration

This skill assumes AgentCairn's MCP tools are already loaded. Before following the memory workflow, confirm that recall and remember are available.

If the tools are missing:

  • Do not invent tool calls or imply that this behavior skill installed the AgentCairn runtime, MCP server, plugin, or hooks.
  • Explain that the full AgentCairn integration is not loaded.
  • Invoke $agentcairn-setup if available, or direct the user to the native AgentCairn installation instructions.
  • Stop the memory workflow until installation is complete and the host has been restarted.

Recall before you work

Before designing, debugging, or re-deriving something non-trivial, search memory first:

  • Use the recall tool (hybrid search) with a focused query — "how did we fix the auth token refresh?", "what did we decide about the migration order?".
  • Expand a promising hit with build_context to read the full note.
  • Recall is cross-project: prior solutions in any repo can help. Cite notes by permalink.
  • Recall automatically prefers your current project's memories while still surfacing relevant cross-project ones (marked [from: <project>]); pass a project to target another repo, or --scope project to limit a query to just this one.

Remember durable facts

After a decision, a non-obvious fix, a gotcha, or a stated user preference, persist it with the remember tool — a short, self-contained fact. Good memories: "We rotate jwt-secret on deploy via X.", "User prefers rebase-merges.", "DuckDB TIMESTAMP stores naive-UTC — bind accordingly." Skip the trivial — the SessionEnd hook already captures the session in bulk; remember is for the high-value things worth pinning deliberately.

The vault is plain Markdown the user can read and edit; treat it as shared, durable knowledge.

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. 2d ago First seen · 42 lines · 46 tokens per session scan A 2e0daecacbd6

Subscribe to this mod's changes

using-agentcairn-memory is a skill published in the GitHub repository ccf/agentcairn (48 stars, last pushed 5d ago), licensed Apache-2.0. It adds 46 tokens to every session and 507 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

forget

Delete specific observations from agentmemory after showing them and getting explicit confirmation. Use when the user says "forget this", "delete memory", "remove that note", or wants to scrub specific data for privacy.

rohitg00/agentmemory · 43 tokens

handoff

Resume the most recent agent session for the current working directory, leading with any unanswered question. Use when the user says "where were we", "resume", "handoff", "pick up where I left off", or starts a session with no fresh context.

rohitg00/agentmemory · 55 tokens

lesson

Save a correction or hard-won rule as a confidence-weighted lesson that resurfaces before similar work. Use when the user corrects your approach, says "learn this", "always" or "never do X", or you notice yourself repeating a past mistake.

rohitg00/agentmemory · 55 tokens

memory-discipline

The session loop that makes agentmemory pay off, recall before starting work, save at decision points, learn from corrections. Use when starting a nontrivial task, after settling a decision or debugging a gotcha, or whenever deciding if something belongs in memory.

rohitg00/agentmemory · 56 tokens

remember

Save an insight, decision, or learning to agentmemory's long-term storage with searchable concept tags. Use when the user says "remember this", "save this", "note that", "don't forget", or wants to preserve knowledge for future sessions.

rohitg00/agentmemory · 52 tokens

agentmemory-hooks

The agentmemory plugin hooks that capture observations automatically across the agent session lifecycle. Use when explaining how memory gets captured without manual saves, when debugging missing observations, or when tuning what gets recorded.

rohitg00/agentmemory · 42 tokens