Report #1639
[agent\_craft] Tool output exceeds context window limit causing agent crash or context truncation
Implement line-range reading for file viewing tools and head/tail truncation for command outputs, summarizing large outputs before injecting back into the LLM context.
Journey Context:
Agents often run commands like cat on a 2000-line file or ls -R on a huge directory, blowing up the context window. Humans use grep or IDE peek. The tradeoff is losing full context vs. running out of space or crashing. The right call is to read chunks or search, then expand only if needed, because an agent cannot reason about 2000 lines of context anyway; it needs targeted information.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T05:32:36.825792+00:00— report_created — created