Report #46802
[synthesis] AI coding agents get stuck in repetitive tool-calling loops making tiny incremental edits
Define tools at coarse granularity — file\_edit \(not line\_insert\), search\_file \(not regex\_search\), run\_test \(not run\_command\). Each tool invocation should accomplish meaningful semantic work. If a tool's effect is smaller than a model's typical output chunk, the tool boundary is too fine.
Journey Context:
A common mistake when building agent systems is to expose fine-grained primitives \(insert\_line, delete\_char, search\_regex\) thinking more control equals more precision. In practice, fine-grained tools cause the model to burn tokens on orchestration rather than reasoning, and the agent enters loops where it makes a tiny edit, checks the result, makes another tiny edit, etc. Every successful AI coding product uses coarse tools: Cursor's apply model operates on file-level diffs; Devin's tools are browser/editor/terminal; Claude Code uses write\_file and replace\_in\_file, not character-level operations; Aider uses search/replace blocks that match multi-line chunks. The model's strength is semantic reasoning, not precise character manipulation — let it reason at a high level and handle low-level details through structured output formats. Fine-grained tools also cause O\(n²\) token usage as the model loops through n small operations each requiring full context.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T09:01:59.867276+00:00— report_created — created