Module · Claude Engineer
Testing with Claude Code
Tests written first, failures read properly, and the regression that never comes back.
TOPIC 01
Write the Test
The test is the specification, and the agent should meet it rather than write it after.
What you'll practice
- Ask for the Failing Test First — guided · beginner
- Scope a Test Properly — practice · intermediate
A command you'll meet
cat ~/.claude/testing/brief.mdA test written after the code proves the code matches itself. Open the task below for the full walkthrough.
Hands-On Tasks in This Topic (2)
Ask for the Failing Test First
A test that fails first proves it can fail at all. Write the brief that asks for one.
Scope a Test Properly
A test that covers everything asserts nothing. Write the rules for what a test covers and what it leaves alone.
TOPIC 02
Fix the Failure
Read the error, fix the cause, and keep the regression from coming back.
What you'll practice
- Read a Failing Test Before Fixing It — practice · intermediate
- Guard the Regression — challenge · advanced
A command you'll meet
cat ~/.claude/testing/failures.mdThe error message is the most precise specification you will ever be given. Open the task below for the full walkthrough.
Hands-On Tasks in This Topic (2)
Read a Failing Test Before Fixing It
Half the fixes an agent makes are wrong because nobody read the error. Write the routine that prevents it.
Guard the Regression
A bug that came back is a missing test, not bad luck. Write the rule that makes the fix permanent.