Workflow Debugging

Debug an Error

Systematic error debugging workflow

debuggingerrorstroubleshooting
CLAUDE.md

When debugging an error:

  1. Read the error message and stack trace completely. Don’t skip lines.
  2. Identify the file and line where the error originates — follow the stack trace to your code, not library internals.
  3. Read the code around the error location. Understand what it’s trying to do.
  4. Check the input data at the point of failure. Add a log or debugger breakpoint to inspect actual values.
  5. Form a hypothesis about the cause. Verify it by checking the specific condition you suspect.
  6. Fix the root cause, not the symptom. If a value is null, find out why it’s null — don’t just add a null check.
  7. Write a test that reproduces the error to prevent regression.

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

get crystl