โ AI Coding Agents (Claude Code & Codex) learning pathAI 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
- Share the error message, stack trace and steps to reproduce.
- Ask the agent to find the root cause before changing code.
- Have it write a failing test that shows the bug.
- Then fix the code until the test passes.
- 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