Workflow Debugging

Debug a Failing Test

Workflow for diagnosing why a test is failing

debuggingtestingtroubleshooting
CLAUDE.md

When debugging a failing test:

  1. Read the test failure output: expected vs actual values, error messages, stack traces.
  2. Run the test in isolation to confirm it fails independently (not due to test order).
  3. Read the test code to understand what it expects.
  4. Read the implementation code the test exercises.
  5. If the test expectation is correct and the code is wrong, fix the code.
  6. If the code is correct and the test is outdated, update the test.
  7. If the failure is intermittent, investigate flakiness: timing issues, shared state, external dependencies.

Copy this workflow into your CLAUDE.md or agent config file so your agent follows this process automatically.

get crystl