Builds on all of the above. This is the most expensive step to keep running. Many teams should stop at step 7.
Read time2 min
SectionClaude Code Setup Playbook
01 — 8 · task files
What to do
Why: for large changes, a task file records the plan and the proof. A Stop hook can then refuse to let the agent say "done" until the proof is there.
Do this:
Define a task template with fixed sections: Objective, Scope, Plan, Validation, Result.
Keep session task files out of git (.claude/tasks/ in .gitignore). If you need a durable backlog, give it a separate folder that is committed.
Decide what counts as evidence for "done": passing tests, a type check, a screenshot.
Write a Stop hook that checks the task file for that evidence.
02 — 8 · task files
Example
Example. The template:
markdown
# Task: <name>
## Objective
<one sentence>
## Scope
In: <files or areas>
Out: <what you won't touch>
## Plan
1. ...
## Validation
- [ ] `npm run typecheck` passes
- [ ] `npm test -- <file>` passes
- [ ] Manual check: <what you looked at>
## Result
<what changed, what you saw>
And a Stop hook that blocks while the Validation section still has unchecked boxes:
js
const fs = require("fs");
const file = process.env.TASK_FILE; // set by your workflow or a UserPromptSubmit hook
if (file && fs.existsSync(file)) {
const unchecked = fs.readFileSync(file, "utf8").match(/- \[ \]/g);
if (unchecked) {
console.error(`Task has ${unchecked.length} unchecked validation item(s).`);
process.exit(2); // blocks stopping; agent keeps working
}
}
03 — 8 · task files
Check it works
Check: start a task, leave one box unchecked and tell Claude to finish. It should be sent back to the work. Check the box and it should be allowed to stop.
Watch out:
A gate that works in one tool and not another gives false confidence. Say which tools enforce it.
Don't build a custom command language, a multi-agent manager or worktree automation until the single-agent flow is stable.
A task file is a checkpoint, not product truth. Keep real requirements in your product docs and update those first.