Winnow
A Claude Code hook that filters large tool results before they enter the agent's context.
A Claude Code hook that filters large tool results before they enter the agent's context.
For a large tool result, winnow reconstructs the current task from the session's latest user request and assistant intent, then sends that task, the tool name and input, and result blocks as state. Jev answers Noul questions about whether each block is needed and whether the output contains an error. Code keeps confident-yes and uncertain blocks, and hides only confident-no blocks when no error is detected; the hidden text is cached for recall and replaced by a stub with a summary or digest. A separate prompt hook uses Noul judgments to rank relevant memory files for injection.
Would the assistant have to look at this result block to accomplish the task correctly?
Current task, tool name and input, and numbered blocks from a large tool result.
For eligible large Read, Bash, or Grep results, extract text and split it into blocks.
Recover the latest user request and assistant intent; send them with the tool input and judged blocks.
Ask whether each block is needed and whether the output contains an error.
Keep missing or uncertain probabilities and all blocks when an error is detected; prune only below the drop threshold.
Cache full text, summarize or digest hidden groups, and return rewritten output containing recall keys.
The task state is reconstructed because the hook does not receive it directly, then used for per-block judgments with explicit uncertainty and error safeguards. Hidden text remains locally recoverable, so context reduction does not discard the source material.