cairn-direction
Force cairn-direction tightening on the supplied prompt. Escape hatch when auto-invocation misses.
Resume an active Cairn task after `/clear`. Reads the task journal + spec and primes context cold.
> /plugin marketplace add isaacriehm/cairn > /plugin install cairn@isaacriehm-cairn
How it fires
How this command gets triggered: by you, by Claude, or both.
/cairn-resumeContext preview
What this command does when you run it.
Resume an active Cairn task after `/clear`. Reads the task journal + spec and primes context cold.
description: Resume an active Cairn task after `/clear`. Reads the task journal + spec and primes context cold. argument-hint: <task_id>
You are resuming a Cairn task in a fresh-context session. The operator just `/clear`ed 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).
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)
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.
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 suppliedThe 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)
}If `cairn_resume` returns `TASK_NOT_FOUND`, surface the error to the operator and ask whether they want to start a fresh task instead.
If `scope === "done"`, the task graduated between the Stop-hook resume prompt and this `/cairn:cairn-resume` invocation (auto-graduator race). There is nothing in flight to resume. Render a "task already shipped" frame instead of the in-flight resume context, then **stop** — do not run Step 3, Step 4, or read `spec.tightened.md`. Format-locked:
**`<task_id>` already shipped — <title>** Completed at `<completed_at>`. Final journal entry: > <last entry summary> The task is in `.cairn/tasks/done/<task_id>/`. Nothing left to resume. What's next?
End the turn after the frame; the operator decides the next ask.
Emit a tight resume block that re-primes context. Format-locked:
**Resuming `<task_id>` — <title>** **Goal.** <goal> **What's been done so far** (last <count> of <total_entries> entries): - <entry 1 summary> - <entry 2 summary> - … **Next step.** <next_step or "No next-step recorded; review the spec to decide."> **Constraints in scope.** <decisions count> DECs, <invariants count> §INVs. Continuing now.
After the block, **immediately read the spec** at `.cairn/tasks/active/<task_id>/spec.tightened.md` so the rest of the session has the full constraint set in working memory.
Read every path in `cairn_resume.files_touched` (most-recent first, cap at 8) **in parallel** so the per-session Read tracker has them cached. Without this step, the first `Edit` after `/clear` will trip `File has not been read yet` for every file the prior session edited, forcing a wall of recovery Reads (bug-mine report #10).
Skip the pre-Read only when the file no longer exists (e.g. the prior session deleted it before `/clear`). Best-effort — silent failures are fine; the goal is to prime the cache, not to validate state.
Call `cairn_decision_get` and `cairn_invariant_get` in parallel for every id in `in_scope_decisions` / `in_scope_invariants`. This primes the session with the constraint bodies — a fresh session has no prior reads to draw on.
After loading, summarize the constraints in one short paragraph under the resume block (≤2 sentences per constraint), then proceed with the task's next step.
mutation second.
already exists; we are resuming, not starting.
contract; do not re-tighten.
point. If the operator's prompt overrides it (rare during a pure resume), prefer the operator.
Persistent ground truth for AI coding agents. First-class support for Claude Code, Cursor, and Codex. Stop agents from drifting.
Repo: isaacriehm/cairn
Force cairn-direction tightening on the supplied prompt. Escape hatch when auto-invocation misses.
Adopt this project with Cairn — runs the one-time init pipeline inline.
Wire the Cairn `⬡` statusline badge into user-level Claude Code settings. One-time per machine.