Cairn Dev Loop

A command entry point for one iteration of Cairn development, using the Cairn development loop procedure. Cairn is a system that checks whether a repository's architecture description matches its code.

In plain words
What is it for?
Running one Cairn development cycle, loading the correct loop instructions, and handling pinned or inactive campaigns.
Why use it?
It tells the agent which procedure and files to use, checks whether the installed Cairn pack matches the active campaign, and stops when the state cannot be safely classified.

Command for Claude Code

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 commands/cairn-framework/cairn/cairn-loop
Clone the repo
git clone --depth 1 https://github.com/cairn-framework/cairn

Made for: Claude Code.

Per session 32 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 560 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.00032 $0.00560
Opus 5 $0.00016 $0.00280
Sonnet 5 $0.00006 $0.00112
Haiku 4.5 $0.00003 $0.00056

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

Security

Grade A, and why

Cairn Dev Loop 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.

.claude/commands/cairn-loop.md · 44 lines

What it actually says

This command is transport. It carries no procedure of its own.

The normative procedure for one cairn development iteration is cairn-dev loop mode, at skills/cairn-dev/references/loop-mode.md inside the installed pack root (.claude/ for the Claude adapter, .omp/ for the OMP adapter) (dec.loop-command-harness-model clause 8, relocated by dec.unified-cairn-dev-entry).

Do this:

  1. Run cairn pack campaign verify and read its message, not only its exit code.
    • HALT: the installed pack no longer matches this campaign.: the pack moved under the campaign. Touch nothing, report the output, and output LOOP HALTED as the final line. Any other failure you cannot classify is the same row.
    • No campaign is active here.: nothing is pinned, and this is not a failure even though the exit code is non-zero. Load assets from the installed pack at their ordinary paths and continue.
    • Exit 0: a campaign is pinned. It reports a pinned: directory holding immutable copies of loop mode and its whole closure. Load every asset from that directory, mirroring the pack path underneath it, and read no other copy for the rest of this session.
  2. Load loop mode: references/loop-mode.md under the pinned directory when one is active, otherwise skills/cairn-dev/references/loop-mode.md under the installed pack root. If it cannot be loaded, touch nothing, report that, and output LOOP HALTED as the final line.
  3. Bind MISSION to any text in this message beyond the command itself, and hand it to loop mode as its MISSION input.
  4. Follow loop mode verbatim, including its required asset closure and its fail-closed rows, resolving every asset through the same source as step 2.
  5. Pass its terminal token through unchanged as your final line, alone and verbatim. Append nothing after it.

Invoking this command IS the explicit selection that loop mode requires. Nothing else in this file overrides, extends, or reinterprets loop mode; where this file and loop mode appear to differ, loop mode governs and this file is wrong.

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 · 44 lines · 32 tokens per session scan A 7dcd14a97d43

Subscribe to this mod's changes

Cairn Dev Loop is a command published in the GitHub repository cairn-framework/cairn (40 stars, last pushed 3d ago), licensed Apache-2.0. It adds 32 tokens to every session and 560 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.