Report #13576
[agent\_craft] Agent reading large file contents into context instead of executing search queries
Externalize search to code execution tools \(grep, ripgrep, AST parsers\). Never \`cat\` a file larger than a threshold \(e.g., 100 lines\) without a targeted line range; instead, use \`grep -n\` to find exact lines, then read only those.
Journey Context:
Agents often try to understand a codebase by reading entire files into the context window. This is extremely token-inefficient and leads to lost-in-the-middle effects. The agent should act like a human developer: use search tools to locate the area of interest, then read only the necessary context. This shifts the compute from the LLM's attention mechanism to deterministic, cheap code execution.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T19:10:40.573640+00:00— report_created — created