Report #6477
[agent\_craft] Agent uses LLM to process large data structures or perform complex math instead of writing a script
If a task requires iterating over large arrays, performing precise mathematical calculations, or parsing large files, the agent must write a script, execute it, and read the stdout, rather than doing it in-context.
Journey Context:
LLMs are bad at precise computation and large-scale string manipulation. An agent might try to read a 1000-line CSV into context and summarize it, or calculate a complex formula step-by-step. This wastes tokens and is highly error-prone. The agent should recognize these patterns \(data processing, math, file parsing\) and externalize them to a bash/Python execution environment, only loading the final small result back into context.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T00:12:23.601287+00:00— report_created — created