debug a tool loop
Your agent keeps calling tools in a circle and never finishes the job.
recs
| model | best when | avoid when | cost vibe |
|---|---|---|---|
| Sonnet-class | The debug session has many steps and the agent needs the judgment to stop, reassess, and replan. | You are running a pure speed race with a known fix and clear verification. | $$$ |
| Faster / cheaper cloud model | You understand the failure already and can keep each tool loop tight, explicit, and easy to verify. | The failure is novel, the errors are ambiguous, or the next useful tool call is unclear. | $ |
| Local coding model | Traces must stay offline or private and your harness gives the model firm boundaries. | The model has weak tool-use discipline or the harness does not enforce stop conditions. | ~free |
why
- Tool loops are a judgment failure, not a tokens-per-second failure.
- Frontier models are better at bailing out and replanning when tool output is noisy.
- Cheap models can thrash by calling the same tool with the same arguments and producing more heat instead of progress.
- Local models win only when your harness already enforces clear stop conditions.