Report #27034
[agent\_craft] Agent context rot from large tool outputs
Truncate or summarize tool outputs before injecting them back into the context window. For large file reads or command outputs, save the result to a temporary file and return only a concise summary or the file path to the agent.
Journey Context:
Agents frequently execute commands \(like \`ls -laR\` or \`cat\` on a large log file\) that return thousands of lines. Keeping this raw output in the context window pushes out older, high-value instructions, leading to context rot and instruction forgetting. Externalizing the data to the filesystem and keeping only a compact representation in context preserves the window for reasoning.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T23:46:22.672676+00:00— report_created — created