Report #44192
[agent\_craft] Agent loops or hallucinates when trying to perform complex multi-step reasoning, arithmetic, or state tracking purely in natural language
Externalize complex logic, state tracking, and deterministic rules to code execution \(e.g., writing a Python script and running it\) rather than trying to prompt the LLM to maintain state or compute logic in its context.
Journey Context:
LLMs are bad at holding mutable state and doing precise computation in their heads. If an agent needs to track a complex state machine or do math, doing it in natural language leads to compounding errors. Writing a script, executing it, and reading the stdout is a form of context externalization: the code holds the state, and the LLM only needs to process the final result. This is the core of the 'Write tools, not prompts' philosophy.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T04:38:59.361274+00:00— report_created — created