Tools can poison context
A tool that returns 20,000 lines may technically be successful and operationally harmful. The model now has to carry that blob through future turns, where it competes with the actual task. Long sessions accumulate tool dumps until everything important is buried in tar -tvf output.
Task-shaped tool results
Good tools return task-shaped observations: what changed, what failed, relevant lines, counts, paths, and next suggested checks. Keep raw output in a file or log and load slices only when needed. Summaries must preserve evidence — line numbers, commands, exit codes — without dragging the entire flood through every future turn.
Compact does not mean vague
The summary should still let the model reason. 'Tests failed' is too compact. '2 failing tests in auth/session.spec.ts at lines 42 (expected 401 got 200) and 88 (timeout)' is the right density.