Report #11330
[agent\_craft] Agent uses LLM reasoning for tasks that require precise state tracking, math, or complex logic
Offload state tracking, graph traversal, and precise calculations to a code execution environment \(e.g., Python REPL\). The LLM should write a script, execute it, and read the result, rather than trying to maintain the state in its context.
Journey Context:
LLMs are bad at mental math and maintaining complex state over many steps. If an agent needs to track a list of visited nodes or calculate offsets, doing it in the context window leads to compounding errors and hallucinations. Writing a small script externalizes the state to a deterministic machine. The context only holds the final answer, saving tokens and ensuring correctness.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T13:08:20.015156+00:00— report_created — created