cairn: Skill for Claude Code

.claude/skills/cairn-loop-recovery/SKILL.md

cairn-loop-recovery is a skill for Claude Code from cairn-framework/cairn. It costs 71 tokens per session (1,480 once invoked), scanned A, original, Apache-2.0.

A recovery procedure for a Cairn development loop, where a loop is a repeated workflow that can leave branches or pull requests unfinished after an interruption. It handles surviving branches, open pull requests, interrupted cleanup, and recovery notes.

In plain words
What is it for?
Use it during Cairn loop recovery to classify and handle dirty branches, unfinished pull requests, cleanup leftovers, or orphaned loop branches.
Why use it?
It helps resume or safely stop work when the loop’s repository state is unclear or incomplete.

Skill 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/skills/cairn-loop-recovery/SKILL.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-loop-recovery

README.md
[![agentmods](https://agentmods.dev/badge/skills/cairn-framework/cairn/cairn-loop-recovery.svg)](https://agentmods.dev/skills/cairn-framework/cairn/cairn-loop-recovery)
Your own site
<a href="https://agentmods.dev/skills/cairn-framework/cairn/cairn-loop-recovery"><img src="https://agentmods.dev/badge/skills/cairn-framework/cairn/cairn-loop-recovery.svg" alt="Measured on agentmods" height="20"></a>
Per session 71 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,480 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00071 $0.01480
Opus 5 $0.00036 $0.00740
Sonnet 5 $0.00014 $0.00296
Haiku 4.5 $0.00007 $0.00148

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

Security

Grade A, and why

cairn-loop-recovery 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 8d 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/skills/cairn-loop-recovery/SKILL.md · 117 lines

How it starts

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

cairn-loop-recovery

Recover loop state for the preflight verdict loop mode's table selected. Loop mode owns the verdict table (state classification and the fail-closed backstops); this skill owns the procedure each recovery row expands into. Run the section matching the verdict and return the token it declares.

Exit tokens

This skill declares the mid-iteration tokens loop mode routes on. Return exactly one, as the final line, then let loop mode's flow continue:

  • RECOVERED - the state was recovered; continue the iteration at the phase the calling verdict names (Verify for in-place recovery, Scope for an adopted branch, or continue preflight after cleanup/quarantine-park).
  • LOOP HALTED - the state is unclassifiable or unrecoverable by this skill (intent unclear, conflicting evidence, a violation the maintainer must judge). Touch nothing; report; halt.

Paths that finish the iteration (open-PR recovery after merge, quarantine via a recover-todo) hand off to cairn-loop-landing; that skill emits the terminal token (ITERATION COMPLETE or LOOP HALTED). This skill does not re-emit a terminal token after a successful hand-off.

1. Dirty tree on a loop/* branch whose slug maps to a known unit

Finishing that unit IS this iteration. Recover in place:

  1. Read the full diff against the unit's intent (the todo body or finding code): git diff, git log origin/main..HEAD, and the unit's artefacts.
  2. Decide coherence: complete the unfinished work, or trim incomplete work back to a single coherent landed unit. Prefer trimming over expanding when the diff has sprawled beyond one reviewable PR.
  3. Return RECOVERED. Loop mode continues at Verify, then Land via cairn-loop-landing. Do not invoke landing from this skill.

Invariant (a fail-closed backstop, owned by loop mode): no checkout of any kind until the tree is clean. If intent is unclear, do not guess; emit LOOP HALTED.

2. Clean tree, exactly one open loop/* PR

Read the full file on GitHub · 117 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. 8d ago First seen · 117 lines · 71 tokens per session scan A 9ae94ff37925

Subscribe to this mod's changes

cairn-loop-recovery is a skill published in the GitHub repository cairn-framework/cairn (41 stars, last pushed yesterday), licensed Apache-2.0. It adds 71 tokens to every session and 1,480 once invoked, about $0.0004 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

prowler-commit

Creates professional git commits following conventional-commits format. Trigger: When creating commits, after completing code changes, when user asks to commit.

prowler-cloud/prowler · 33 tokens

gh-auth-isolation

Safely manage multiple GitHub identities (EMU + personal) in agent workflows.

github/gh-aw · 20 tokens

comet-github

A routing guide for Comet-related GitHub work. It directs requests about pull requests, issues, CI failures, ideas, and fixes to the appropriate review or implementation process.

rpamis/comet · 72 tokens

github-skill

Work with GitHub via the gh CLI — clone repositories, create/list/merge pull requests, create/list issues, and run any other gh command (API calls, workflow runs, releases, repo administration). List operations return parsed JSON.

zeenie-ai/OpenCompany · 51 tokens

re0-merge

Review and land an external contribution the way this suite does: gate it against the thesis, land it with the author's credit intact, complete a new skill rather than merging it raw, then approve, credit, and explain before closing. Use when reviewing a pull request, as any collaborator or maintainer, not only the…

LilMGenius/paperthin · 70 tokens

codex-autoresearch

Run autonomous, measurable experiments in a Git repository: change one hypothesis, verify a numeric metric, keep improvements, and revert failures. Use when the user wants Codex to keep iterating toward a numeric target in the foreground or as a detached background run. Do not use for ordinary one-shot coding…

leo-lilinxiao/codex-autoresearch · 80 tokens