Report #9188
[agent\_craft] Agent context window fills up with verbose tool outputs like directory listings or full git logs
Enforce strict truncation and filtering on tool outputs before they are appended to the context. Use structured tools \(e.g., ripgrep, git diff --stat\) instead of raw broad commands \(ls -R, cat\), and programmatically truncate outputs exceeding a token threshold before injection.
Journey Context:
Agents often run shell commands that return thousands of lines. Dumping this raw output into the context window wastes tokens and dilutes the signal, leading to context rot and increased latency/cost. Developers often rely on the LLM to parse the noise, but it is far more efficient to let the deterministic shell environment filter first, only injecting the distilled results into the LLM context.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T07:36:50.720281+00:00— report_created — created