iCode Agent · Guide · Workflow

Track down a bug.

The hard part of a bug is usually not the fix — it is finding the cause. iCode Agent follows the evidence through the code and tells you what it found, rather than guessing at a patch.

The task

Describe the symptom and, if you can, how to reproduce it:

Users report that saving a duplicate name overwrites the original.
Reproduce it, find the cause, then fix it.

A reproduction is the most valuable input you can give. Without one, ask the agent to find or write one first — a bug you cannot trigger is a bug you cannot confirm you fixed.

What happens

  1. Reproduce. It runs the failing command or test and reads the actual output — a stack trace, an error, a wrong value.
  2. Follow the evidence. It traces from the symptom back toward the cause: the calling code, the data, the state. A failure is information, and it keeps pulling the thread.
  3. Name the cause. It explains what is wrong and why, with the code that shows it — not just where to patch.
  4. Fix and verify. It makes the smallest change that addresses the cause and re-runs the check that failed.

Ask before you accept the fix

A patch that makes a symptom disappear is not the same as a bug fixed. Ask for the reasoning, and for whether the cause is addressed:

Reproduce the failure in tests, explain the root cause, then fix it.
Don't change the test to make it pass — the test is correct.
Show me every place this same bug could occur.

That last line matters: a good bug hunt asks whether this is one instance of a pattern, not a one-off.

When the answer is "I can't reproduce it"

That is a useful result, not a failure. The agent will say what it tried and what it observed. From there you can narrow the environment, supply input that triggers it, or ask for instrumentation to log the state at the point where you expect the bug.