Report #39800
[agent\_craft] Agent tries to reason about complex logic, math, or string manipulations entirely in the context window, leading to hallucinations
If a task requires deterministic computation, iterating over data structures, or complex regex, write a script, execute it, and read the stdout/stderr instead of trying to compute it via text generation.
Journey Context:
LLMs are bad at arithmetic and strict logic. 'Thinking' in context is probabilistic. Code execution is deterministic. The tradeoff is the latency of writing/running code vs. the accuracy gain. For coding agents, accuracy is paramount, so externalize computation aggressively rather than risking hallucinated logic.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T21:16:38.301570+00:00— report_created — created