10 ORCHESTRATION

Long Run

Orchestrates executions spanning multiple days. Disk checkpoints ensure survival through crashes.

01 ▸ Workflow Position

Milestone Planning │ ▼ ┌─────────────────────────────┐ │ Long Run (ACTIVE) │ │ Per-Milestone Execution │ └──────────────┬──────────────┘ │ ▼ Review Work

02 ▸ When to use?

Immediately after Milestone Planning is complete, or when large-scale refactoring/feature development spanning multiple days is required.
Key Triggers
  • "long run"
  • "execute milestones"
  • Input: Locked Milestone DAG

03 ▸ How it works?

Core Principle: Every milestone undergoes an independent plan→run→review cycle. A failed milestone blocks all subsequent ones.
Execution Steps
  1. Sequential Milestone Execution: Perform planning, execution, and verification for each milestone and save checkpoints.
  2. Retry Escalation: Attempt up to 3 retries in the order: Re-run → Re-plan → Stop (Persistent Counter).
  3. Parallel Milestones (worktree): Milestones without dependencies are executed simultaneously in separate git worktrees.
  4. Cross-Milestone Integration Check: Detect interference between milestones after each completion.
  5. Final E2E Gate: Perform final verification after completion and clean up code with Simplify.

04 ▸ Durable Design

FeatureDescription
Disk CheckpointRecord all status in state.md — Crash survival
Recovery ProtocolResume from the last checkpoint in interrupted sessions
Rate limitAlign with Claude Code's built-in retries
Context WindowAutomatic compression and state separation for long-term conversations

05 ▸ Hard Gates

Mandatory Rules
  • A failed milestone must immediately block the execution of subsequent milestones.
  • Retry counters must be persistent, maintained even if the session is interrupted.
  • Pre-verify that there are no file conflicts between each worktree during parallel execution.
  • All state changes must be immediately reflected in state.md on disk.

06 ▸ Related Skills

Milestone Planning → Review Work → ← Back to Home