GhalebDweikat/winnow

32 stars · Last commit 2026-09-19

A calibrated context sieve for Claude Code: every tool result is judged by a System One model before it enters context.

README preview

# winnow

[![tests](https://github.com/GhalebDweikat/winnow/actions/workflows/tests.yml/badge.svg)](https://github.com/GhalebDweikat/winnow/actions/workflows/tests.yml)

A calibrated context sieve for Claude Code.

Every large `Read`, `Bash`, or `Grep` result is judged before it enters Claude's context. Blocks the judge is confident you don't need are replaced with a three-line stub: what was hidden, a one-paragraph summary from a cheap model, and a key that restores the full text on demand. Nothing is lost; it just stops costing tokens until you ask for it.

**Terms used below.** The *judge* is the model that answers one yes/no question per block ("is this block needed for the current task?") with a probability. By default that is **Jev**, TypeSafe AI's *System One* model: a model that returns calibrated probabilities for typed questions instead of generating text, so a hundred questions come back in one call in a few hundred milliseconds. Jev is in early access. The *adapter* is TypeSafe's `system-one-adapter` package, which answers the same questions by prompting Claude Haiku 4.5; it is not calibrated, but it lets the whole pipeline run today.

## What it does

```
Read big.py  ──►  Claude Code  ──►  tool.call hook  ──►  winnow
                                                             │
        split into ~25-line blocks ◄─────────────────────────┘
        one call to the judge: "is block N needed for the current task?"  ×N, in parallel
        keep confident-yes and uncertain blocks verbatim
        hide confident-no blocks:  cache full text  ─►  summarize  ─►  stub
                                                             │

View full repository on GitHub →