cairn-resume

cairn-resume is a command for Claude Code from isaacriehm/cairn. It costs 21 tokens per session (1,394 once invoked), scanned A, original, MIT.

A resume command for Cairn tasks after the conversation context has been cleared. It reads the task journal and specification to rebuild the working context.

In plain words
What is it for?
Use it to resume a named active task, or the most recently updated active task, including relevant mission context when available.
Why use it?
It prevents work from losing its place when a task continues in a fresh session.

Command for Claude Code

Written for Claude Code: argument-hint in frontmatter.

Part of the cairn plugin — 5 skills, 4 commands, 5 agents, 5 hooks, 1 MCP server shipped together

Good fit Use it to resume a named active task, or the most recently updated active task, including relevant mission context when available.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/isaacriehm/cairn/cairn-resume
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.

Clone the repo
git clone --depth 1 https://github.com/isaacriehm/cairn

Made for: Claude Code.

Or install cairn, the plugin that ships this one along with the rest of its 5 skills, 4 commands, 5 agents, 5 hooks, 1 MCP server.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for cairn-resume

README.md
[![agentmods](https://agentmods.dev/badge/commands/isaacriehm/cairn/cairn-resume/github.svg)](https://agentmods.dev/commands/isaacriehm/cairn/cairn-resume)
Your own site
<a href="https://agentmods.dev/commands/isaacriehm/cairn/cairn-resume"><img src="https://agentmods.dev/badge/commands/isaacriehm/cairn/cairn-resume/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for cairn-resume

Your own site · 80×15
<a href="https://agentmods.dev/commands/isaacriehm/cairn/cairn-resume"><img src="https://agentmods.dev/badge/commands/isaacriehm/cairn/cairn-resume.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 21 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,394 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00021 $0.01394
Opus 5 $0.00010 $0.00697
Sonnet 5 $0.00004 $0.00279
Haiku 4.5 $0.00002 $0.00139

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

Security

Grade A, and why

cairn-resume 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 9d 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.

packages/cairn-plugin/commands/cairn-resume.md · 147 lines

How it starts

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

/cairn:cairn-resume

You are resuming a Cairn task in a fresh-context session. The operator just /cleared mid-task and pasted this command to rebuild state. The argument is the task_id (format: TSK-<slug>-<7-hex>) or omitted (defaults to the most-recently-touched active task).

Step 1 — preload tools

ToolSearch(select:mcp__plugin_cairn_cairn__cairn_resume,mcp__plugin_cairn_cairn__cairn_mission_resume,mcp__plugin_cairn_cairn__cairn_in_scope,mcp__plugin_cairn_cairn__cairn_decision_get,mcp__plugin_cairn_cairn__cairn_invariant_get)

Step 1.5 — mission frame (when an active mission exists)

Call cairn_mission_resume({}) first. If active: true, render the returned body verbatim BEFORE the task resume block — it's the mission-level context (cursor phase + exit_criteria, last 3 graduated tasks across the mission, in-flight tasks under the cursor, the spec.md slice for the current phase, next 1-2 upcoming phases). Combined with the task frame from Step 2, total prime budget is ≤2500 tokens.

If active: false, skip this step entirely — the operator is on a non-mission task and the task journal alone primes the session.

Step 2 — fetch the resume payload

Call cairn_resume. If the operator passed a task_id argument, pass it through; otherwise omit and let Cairn pick the most-recent active task:

cairn_resume({ task_id: "<task_id>" })  // or {} if no arg supplied

The tool returns:

{
  ok: true,
  task_id: "TSK-…",
  scope: "active" | "done",      // see Step 2.5
  completed_at: "<ISO-8601>" | null,
  title: "<spec H1>",
  goal: "<spec ## Goal section>",
  in_scope_decisions: ["DEC-…"],
  in_scope_invariants: ["INV-…"],
  target_path_globs: ["…"],
  recent_entries: [
    { ts, session_id, summary, next_step?, files_touched?, decisions_loaded? }
  ],
  next_step: "<last entry's next_step or null>",
  total_entries: <number>,
  files_touched: ["<repo-rel path>", …]   // deduplicated union across recent_entries (most-recent first)
}

Read the full file on GitHub · 147 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. 9d ago First seen · 147 lines · 21 tokens per session scan A 2f9e50b8233a

Subscribe to this mod's changes

cairn-resume is a command published in the GitHub repository isaacriehm/cairn (6 stars, last pushed 1mo ago), licensed MIT. It adds 21 tokens to every session and 1,394 once invoked, about $0.0001 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-31.