Report #13362
[agent\_craft] Agent context window overflows or degrades when loading massive tool outputs \(e.g., cat large\_file.log\)
Enforce strict token limits on tool outputs. Truncate outputs at the tool execution layer before returning to the LLM, and append a '\[Truncated. Use grep/search to find specific lines\]' message to the output.
Journey Context:
Agents often run commands that return thousands of lines. Loading this into the context window wastes the budget and causes context rot. The agent doesn't need the whole file; it needs the specific error. Truncating at the execution layer forces the agent to use targeted search tools \(grep, awk\) instead of relying on reading entire files into memory, which is closer to how human engineers work.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T18:38:38.203587+00:00— report_created — created