Skip to content
Arara Code

Guides and comparisons

Debugging code with AI: how to find bugs faster

To debug with AI, give the agent a minimal reproduction, the full error message and the expected behavior, and ask for hypotheses that can be tested one by one. The agent speeds up the search, but the cause is only confirmed when a test or a log proves it.

Arara Code

Published by the Arara Code project based on the official documentation cited.

Start with the reproduction and the right context

Debugging is the process of finding and fixing the cause of a defect. The agent works best with the steps that reproduce the error, the dependency versions and the full stack trace, without cuts.

State the expected and the actual result. "It does not work" forces the model to guess; "returns 500 when submitting the form with an empty field" points to validation.

Wikipedia: Debugging

Ask for hypotheses, not immediate fixes

Ask for two or three hypotheses ordered by likelihood, each with a way to verify it: a log, a breakpoint or a failing test. This avoids fixes that only hide the symptom.

Rubber duck debugging, explaining the problem out loud, works with the agent too, because writing out the reasoning exposes wrong assumptions.

Wikipedia: Rubber duck debugging

Isolate the commit with git bisect

git bisect uses binary search on the history to find the commit that introduced a bug. With N commits between a good and a bad version, about log2(N) tests are enough.

The agent can write the test script that returns success or failure and run git bisect run, making the search automatic. Review the script before running it.

Git: git bisect documentation

Debugging with agents in Arara Code

In Arara Code, the agent reads the integrated terminal, runs the failing test and proposes the fix as a diff. You approve each command and check the change.

After fixing, ask for a regression test that fails before the fix and passes after it. The test documents the bug and keeps it from coming back.

Arara Code repository on GitHub

Sources and further reading

Read as Markdown

Keep exploring

Make room for your next idea.

Get to know Arara Code in your own project. Start with the installer and review the changes your assistant makes.