From cairn
Use when the user wants the agent to keep picking up tasks autonomously and repeat the round cycle until a stop criterion is met — "keep going while I sleep", "run autonomously until you hit a blocker or clear P1", "loop through the punch list". Runs one round, schedules the next wakeup, repeats. Enforces commit checkpoints (3-commit soft pause, 5-commit hard stop) so silent prolific output doesn't erode trust. For exactly one cycle, use cairn-autonomous-round instead.
How this skill is triggered — by the user, by Claude, or both
Slash command
/cairn:autonomous-loopThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Repeat the autonomous cycle until a stop criterion is met. After
Repeat the autonomous cycle until a stop criterion is met. After each cycle, schedule the next wakeup; at checkpoints, pause and wait for user approval before continuing.
For exactly one cycle, see the sibling
cairn-autonomous-round.
cairn-autonomous-round.Substance in
<project>/docs/workflow/autonomous-protocol.md.
This skill is the loop-specialisation of that protocol.
One cycle of the loop:
Check for user input. If new message, abandon; address the message.
First cycle only: calibrate autonomy level (menu; L2 default). Cache the choice for the session; subsequent cycles reuse it.
Verify prerequisites.
Pick one bounded task (use autonomous-planner sub-agent
if available).
Announce the pick in the session journal with autonomy level.
Implement. Log design calls as taken.
Gate (via review-phase skill if available).
Commit locally.
Check commit-count checkpoints:
Check stop criteria:
If any stop criterion applies: write the final handoff, stop.
Otherwise: schedule the next wakeup. Cadence: 20-60 min default; shorter if watching a specific condition (build ETA, scheduled task firing).
## Checkpoint — <timestamp> — 3 commits this session
**Shipped so far:**
- `<sha>` — <subject>
- `<sha>` — <subject>
- `<sha>` — <subject>
**Autonomy level:** LN (cached from first cycle).
**Pausing because:** 3-commit soft checkpoint. Not scheduling
the next wakeup; waiting for your approval to continue.
**Next candidates if you want to continue:** <tasks the
planner recommends for the next round>.
**For your review:** <numbered yes/no questions>.
Next time the user says "continue" or "keep going," the loop resumes from the next cycle; the 3-commit counter resets only if the user explicitly says "reset" or starts a new day.
Same shape as the round skill's handoff, with:
**Shipped this loop:** listing every SHA from the session.**Stopped because:** naming the specific criterion (5-commit
hard stop, blocker, empty pool, user message, gate failure).**Total autonomous cycles this session:** <count>.Via your CLI's wakeup mechanism. In Claude Code:
ScheduleWakeup({
delaySeconds: 2700, # 45 min is a sane default
prompt: "<<autonomous-loop-dynamic>>",
reason: "Next loop cycle — <what you're continuing>"
})
In other CLIs: use whatever scheduling exists. If none is available, the loop degrades to a single round per invocation and the user re-invokes it manually.
autonomous-planner sub-agent: the main agent picks
the task directly, following the autonomy-level rules.review-phase skill: the main agent runs the project's
gates manually (tests, lint, format). Quality + security are
still mandatory — if no security tool is available, the main
agent does a manual diff review against OWASP Top 10,
secret handling, authz/authn boundaries, and input validation
at system edges.Guides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.
npx claudepluginhub foobarto/cairn --plugin cairn