โ† AI Coding Agents (Claude Code & Codex) learning path
AI Coding Agents (Claude Code & Codex) ยท Module 6 of 10

Debugging with agents

Agents speed up finding and fixing bugs when you give evidence.

๐Ÿ“– Key ideas

  1. Share the error message, stack trace and steps to reproduce.
  2. Ask the agent to find the root cause before changing code.
  3. Have it write a failing test that shows the bug.
  4. Then fix the code until the test passes.
  5. Ask "why did this happen" so you learn, not just patch.
๐Ÿ’ก Real-life example: Like a doctor: describe the symptoms clearly, get a diagnosis first, then the medicine.
Stack traceList of function calls at the error
Root causeThe real reason a bug happens
ReproduceMake the bug happen on purpose
Regression testTest that stops a bug returning