From orc
Persist and resume orc:orchestrate state to disk. ONLY invoke when: (1) the user explicitly says /orc:handoff, "checkpoint orchestration", "hand off", "resume orchestration", or "save orc state"; (2) CC displays an actual system usage-limit warning (not your guess that one is coming); (3) orc:orchestrate auto-calls checkpoint after a wave completes; (4) a fresh session needs to resume a prior orchestration via `resume`. Do NOT invoke because a session feels long, context feels large, or you think limits might be near. "Session is long" is never a trigger. Part of the orc system: orc:orchestrate, orc:backlog, orc:autoresearch, orc:status, orc:recap, orc:scope, orc:handoff.
npx claudepluginhub athan-dial/skills --plugin orcThis skill uses the workspace's default tool permissions.
Do NOT run this skill unless one of these is true:
Guides Next.js Cache Components and Partial Prerendering (PPR) with cacheComponents enabled. Implements 'use cache', cacheLife(), cacheTag(), revalidateTag(), static/dynamic optimization, and cache debugging.
Guides building MCP servers enabling LLMs to interact with external services via tools. Covers best practices, TypeScript/Node (MCP SDK), Python (FastMCP).
Generates original PNG/PDF visual art via design philosophy manifestos for posters, graphics, and static designs on user request.
Do NOT run this skill unless one of these is true:
/orchestrate is auto-checkpointing after a completed waveIf none apply, exit this skill immediately. "The session is long" or "context might be getting large" are NOT triggers. Trust the system to signal real limits.
Solves: when CC runs the /orchestrate orchestrator and hits a 5h usage limit mid-run, the in-flight task table, wave state, and dispatched job IDs are stranded inside CC's conversation. Workers (Codex/Cursor daemons) keep running on disk, but no agent can pick up the orchestrator role without losing them.
This skill writes orchestrator state to disk after every wave so any agent (CC, Cursor, Codex via codex-rescue) can re-attach.
| Mode | When | Who calls it |
|---|---|---|
checkpoint | After every wave completes, or on demand | /orchestrate (auto) or user |
prepare-handoff [cursor|codex] | When usage limit is imminent | User (or CC reactively) |
resume | Fresh session picking up an orchestration | Receiving agent (CC/Cursor/Codex) |
Repo-local: <repo-root>/.orc/ — gitignored, follows the work, no global discovery step needed. Files:
state.json — structured task table, wave history, in-flight jobs, routing context pathsHANDOFF.md — human-readable narrative with paste-ready resume prompts for Cursor/Codextasks.json — last TaskList snapshot (orchestrator pipes this in before checkpoint)Add .orc/ to .gitignore on first checkpoint if missing.
checkpointInvocation (from /orchestrate or user):
bash ~/.claude/skills/orchestrate-handoff/scripts/checkpoint.sh
The script reads from environment variables. The orchestrator MUST export these before calling:
| Env var | Contents |
|---|---|
ORCH_PLAN_REF | Path to plan file, or freeform:<short hash> if no file |
ORCH_WAVE | Current wave number (integer) |
ORCH_WAVE_STATUS | dispatched / polling / complete |
ORCH_INFLIGHT_JOBS | Newline-separated agent:job_id:label triples (poll-wave.sh format). Empty if no jobs in flight. |
ORCH_ROUTING_FILES | Newline-separated .mex/context/*.md paths loaded in Phase 0 |
ORCH_NEXT_ACTION | One-line description of next step |
ORCH_NOTES | Optional: open decisions, blockers, recent reroutes |
For task table: orchestrator can optionally write .orc/tasks.json (e.g., echoing TaskList output as JSON) before invoking the script. If absent, checkpoint still runs but state.json's task table will be empty.
What the script does:
.orc/ if missing, adds entry to repo .gitignorestate.json from env vars + tasks.json (if present) + ISO timestampHANDOFF.md with current state and paste-ready Cursor/Codex resume promptsHANDOFF.mdThe script is idempotent and overwrites previous checkpoints (not append-only — the latest state is always authoritative).
Where /orchestrate calls this: at the end of Phase 2's per-wave loop, after the review step but before dispatching the next wave.
prepare-handoffWhen usage limit is imminent, run:
bash ~/.claude/skills/orchestrate-handoff/scripts/prepare-handoff.sh cursor
# or
bash ~/.claude/skills/orchestrate-handoff/scripts/prepare-handoff.sh codex
Both targets read the existing state.json and HANDOFF.md (call checkpoint.sh first to refresh them).
Cursor target: prints a complete prompt to paste into Cursor agent mode. The prompt:
.orc/HANDOFF.md and .orc/state.jsonresume.shCodex target: prints a codex-rescue agent prompt. Codex-rescue already knows the runtime — the prompt just declares "this is a resume, not a fresh start; load .orc/HANDOFF.md first."
resumeReceiving agent invokes:
bash ~/.claude/skills/orchestrate-handoff/scripts/resume.sh
The script:
state.json — fails clearly if missingpoll-wave.sh with the saved ORCH_INFLIGHT_JOBS triples (only if non-empty)ORCH_NEXT_ACTION so the agent knows what to do nextAfter this, the receiving agent has full state and can continue /orchestrate's Phase 2 loop, calling checkpoint.sh again after the next wave.
/orchestrateTwo minimal edits to ~/.claude/skills/orchestrate/SKILL.md:
ORCH_ROUTING_FILES.checkpoint.sh.These edits are non-breaking — checkpoint.sh exits cleanly if env vars are partial.
ORCH_NOTES and ORCH_NEXT_ACTION.Keeps state.json small (~5–20KB).
| Symptom | Cause | Fix |
|---|---|---|
resume shows job as "unknown" | Job ID expired (codex 24h retention, cursor pid died) | Treat as failed; re-dispatch task |
state.json missing | Checkpoint never ran | Reconstruct manually from plan file + git log |
| Routing files moved | Repo restructured between checkpoint and resume | Re-run Phase 0 of /orchestrate |