Report #8875
[agent\_craft] Tool outputs like reading large files or directory listings consume the entire context window, leaving no room for reasoning
Enforce strict truncation limits on tool outputs before injecting them into the context. Use commands that limit output natively \(e.g., head -n 50, wc -l\). If output exceeds the limit, truncate and append a marker like \[... truncated ... use grep or read specific lines to see more\].
Journey Context:
Agents often run cat on large files or return massive JSON payloads from APIs, instantly hitting token limits. Naively letting the LLM see everything seems helpful but actually degrades performance and increases cost and latency. By forcing the agent to use targeted retrieval \(grep, specific line reads\) after an initial bounded scan, you maintain a high-signal, low-noise context window.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T06:43:14.671774+00:00— report_created — created