Time budget: 30 minutes
Success criterion: You’ve written a CLAUDE.md for a real project, primed Claude with it, and confirmed Claude now handles a specific question correctly that it would have gotten wrong without the file.
tsd-exercise-01 from Chapter 01, or any real repo you own)CLAUDE.md using the template/prep in a fresh Claude sessionBest choice: tsd-exercise-01 from Chapter 01. It already has a CLAUDE.md from the starter — you’re going to replace or extend it.
Alternative: any real project you own where you’d like Claude’s help.
cd ~/repos/tsd-exercise-01 # or your chosen project
cp ~/repos/AI_Workflow/01-bootstrap-a-repo/templates/CLAUDE.md.template ./CLAUDE.md
If the project already has a CLAUDE.md, back it up first:
cp CLAUDE.md CLAUDE.md.bak
cp ~/repos/AI_Workflow/01-bootstrap-a-repo/templates/CLAUDE.md.template ./CLAUDE.md
Open CLAUDE.md in your editor. Replace every `` with a real value for your project:
docker-compose.ymlRead writing-claude-md.md while you work — use the three examples as reference.
Keep it under 200 lines for this exercise. Don’t try to write a perfect masterpiece. A 100-line starter that covers the eight sections is plenty.
Look at your CLAUDE.md. Pick one specific rule that would NOT be obvious from reading the code alone. Examples:
docker compose exec”test() not it() for test cases”lodash, use the native equivalent”.env, committed files use ${VAR:-placeholder}”Write down the rule. You’re about to test it.
Open a fresh terminal. Navigate to the project. Launch Claude:
cd ~/repos/tsd-exercise-01
claude
Do NOT run /prep. Instead, ask a question where the obvious answer would violate your rule. Examples matching the rules above:
zod package”formatDate function”UserCard component”DATABASE_URL in the Docker Compose file”Observe Claude’s response. It will probably try to do the obvious thing — which violates your rule. Don’t approve any edits. Say “stop” or press Esc.
Exit Claude: /exit.
Relaunch Claude:
claude
This time, run /prep first:
/prep
Expected output:
Read project context. Ready.
Now ask the exact same question from step 5. Observe the difference.
Claude should now:
If Claude still violates the rule, your CLAUDE.md wasn’t explicit enough. Go back to step 3 and sharpen the rule. Repeat.
/commit
Land your new CLAUDE.md.
Check each box:
CLAUDE.md exists and is 50-250 lines/prep and observed Claude violating a rule/prep and observed Claude following the ruleCLAUDE.md is committedIf any box is unchecked, the exercise isn’t done. The point of this exercise is the contrast between the two sessions — feeling the difference between Claude without context and Claude with context is the point, not the words on the page.
| Problem | Fix |
|---|---|
Claude follows the rule even without /prep |
Your rule is too obvious. Pick a rule that requires project-specific knowledge (e.g., “use pnpm not npm”, “our linter forbids default exports”) |
Claude still violates the rule with /prep |
Your rule isn’t specific enough. Add the exact command or exact pattern. “Don’t use npm” is weak; “Use docker compose exec scripthammer pnpm for all package operations” is strong |
/prep outputs a summary instead of “Ready.” |
You’re using a wrong prep.md. Re-copy from 03-slash-commands/starter-kit/.claude/commands/prep.md |
| You ran out of time | Pick a shorter test rule. You don’t need to write a perfect CLAUDE.md in 30 min — just prove the pattern works |
CLAUDE.md is the difference between Claude guessing and Claude knowingpnpm install on the host, only docker compose exec scripthammer pnpm install” is/prep is the switch that turns context on