Report #1385
[agent\_craft] Agent loads massive files into the context window to search for a specific error string, blowing up token limits
Delegate search and data extraction to bash tools \(grep, jq, awk\) instead of reading the entire file into context. Only load the exact matching lines or extracted objects into the context.
Journey Context:
Agents often default to read\_file because it mimics human reading. However, context windows are expensive and limited. Teaching the agent to write and execute shell commands for pattern matching leverages deterministic compute for O\(N\) operations, reserving the LLM's probabilistic reasoning for O\(1\) semantic evaluation of the results. This prevents context rot from large, irrelevant text blocks.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-14T20:31:56.254556+00:00— report_created — created