The Loop & Goal Playbook for Claude Code — Make "Done" a Check That Exits 0

Everyone's posting about "the loop method" for AI coding agents. Almost none of them ship the one thing that makes a loop trustworthy: a stop condition a machine can check. Claude Code has a real /goal command — it keeps working across turns until a small evaluator model judges your condition met. That's useful. But per Anthropic's own docs, that evaluator "does not call tools" — it reads the conversation, it never actually runs your tests. So a convincing-looking transcript can satisfy it even when nothing really passed. This playbook makes "done" deterministic: a check that exits 0, enforced by a real Claude Code Stop hook. Same loop; the stop condition goes from a read of the transcript to an actual run. WHAT YOU GET • The interactive Playbook (one HTML file — search, filter by stage, copy any command; works offline) • The copy-paste goal + loop prompt (and an ultra-short version) • A drop-in Claude Code skill (loop-goal) that runs the explore → define-done → loop → verify → review flow • verify-gate.py — a real Stop hook that BLOCKS a fake "done" until your checks actually pass • dod-verify — a tiny runner that executes your goal's own checks and writes the evidence the hook reads • Templates for the Definition-of-Done file and a standalone check.sh • VERIFY-LOG.txt — the exact commands + output proving the hook and runner work (rerun them yourself) NEW IN v1.1 (July 2026 — free update) • Goal budgets: /goal has no built-in turn or token cap — the playbook shows where the cap goes (inside the condition) and how to watch spend • Print-the-proof: the /goal evaluator only believes what's in the conversation — both prompts now force printed verification output every turn • The unattended stack: auto mode + /goal, /usage, and worktree isolation • /goal operating facts: status, clear, resume behavior, headless runs, trust prerequisites • The research finding that agent-written tests barely move outcomes — and what to point the loop at instead HOW IT WORKS You write your goal into .claude/.dod.md. dod-verify runs its checks and writes a timestamped result. The verify-gate Stop hook reads that result and refuses to let the turn end as "done" until every check passed — and a stale result from an earlier run can't sneak through. Everything runnable is stdlib Python 3. No dependencies. WHY IT'S TRUSTWORTHY Every factual claim in this product was checked against current Anthropic Claude Code docs before release, across multiple adversarial fact-audit passes (v1.0 through a 5-round audit; the v1.1 additions rechecked against live docs). The hook and runner were executed and confirmed — the receipts ship in VERIFY-LOG.txt. REQUIREMENTS (please read before buying) • Claude Code — this is a Claude Code loop/verification kit • A web browser to read the Playbook (any modern one; works offline) • Python 3 to run the skill, hook, and runner (standard library only, no installs) • The /goal, /loop, and /schedule commands are Claude Code features that change between versions — confirm against /help in your version This is a method + working tooling, not a service that changes your setup for you. Claude Code behavior changes as Anthropic updates the tool, so re-verify command and hook syntax against current docs before relying on a specific detail. Not affiliated with, endorsed by, or sponsored by Anthropic. Claude is a trademark of Anthropic PBC.