cairn: Command for Claude Code

.claude/commands/cairn-loop.md

Cairn Dev Loop is a command for Claude Code from cairn-framework/cairn. It costs 32 tokens per session (560 once invoked), scanned A, original, Apache-2.0.

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

Written for Claude Code: installed under .claude/.

This is cairn-framework/cairn's own configuration. It tells Claude Code how to work on cairn itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything cairn configures →

Reuse

Borrowing it

Nothing to install: this file belongs to cairn-framework/cairn. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/cairn-framework/cairn/main/.claude/commands/cairn-loop.md
Clone the repo
git clone --depth 1 https://github.com/cairn-framework/cairn

Made for: Claude Code.

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

README.md
[![agentmods](https://agentmods.dev/badge/commands/cairn-framework/cairn/cairn-loop/github.svg)](https://agentmods.dev/commands/cairn-framework/cairn/cairn-loop)
Your own site
<a href="https://agentmods.dev/commands/cairn-framework/cairn/cairn-loop"><img src="https://agentmods.dev/badge/commands/cairn-framework/cairn/cairn-loop/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 Dev Loop

Your own site · 80×15
<a href="https://agentmods.dev/commands/cairn-framework/cairn/cairn-loop"><img src="https://agentmods.dev/badge/commands/cairn-framework/cairn/cairn-loop.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
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. 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.00032 $0.00560
Opus 5.5 $0.00013 $0.00224
Sonnet 5.5 $0.00006 $0.00112
Haiku 4.5 $0.00003 $0.00056

Measured 2mo ago against content hash 7dcd14a97d43, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 2mo 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. 2mo 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 (53 stars, last pushed yesterday), licensed Apache-2.0. It adds 32 tokens to every session and 560 once invoked, about $0.0001 per session on Opus 5.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

Cairn Dev Loop compared with commands from other repositories

Cairn Dev Loop next to 6 commands from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
Cairn Dev Loopcairn-framework/cairnCommand53yesterdayApache-2.0A32Claude Code
improveSuperClaude-Org/SuperClaude_FrameworkCommand24k1mo agoMITA15Claude Code
spec-reviewfengshao1227/ccg-workflowCommand6.0k4d agoMITA16Claude Code
impl-reviewgmickel/flow-nextCommand717yesterdayMITA23Claude Code
resolve-prgmickel/flow-nextCommand717yesterdayMITA26Claude Code
spec-completion-reviewgmickel/flow-nextCommand717yesterdayMITA13Claude Code
code-reviewhamr0/agentic-toolkitCommand236d agoApache-2.0A40Claude Code