# AI use cases for Winnow (GhalebDweikat/winnow)

Repo: [GhalebDweikat/winnow](https://github.com/GhalebDweikat/winnow) | Use cases: 4 | Page: https://dedupedai.com/use-cases/ghalebdweikat-winnow/

winnow is a Python sidecar and Claude Code plugin that judges large Read, Bash, and Grep results and hides blocks it is confident are not needed, replacing them with short stubs.

This file holds every use case of this repo. Each one starts with a "## " heading and ends with its URL.

- Trim large Claude Code tool results before they fill context: https://dedupedai.com/use-cases/ghalebdweikat-winnow/trim-large-claude-code-tool-results/
- Test Winnow in shadow mode before it changes results: https://dedupedai.com/use-cases/ghalebdweikat-winnow/trial-winnow-in-shadow-mode/
- Score a judge on your own Claude Code transcript history: https://dedupedai.com/use-cases/ghalebdweikat-winnow/score-a-judge-on-past-transcripts/
- Inject relevant memory notes into each Claude Code prompt: https://dedupedai.com/use-cases/ghalebdweikat-winnow/inject-relevant-notes-into-each-prompt/

## How to trim large Claude Code tool results before they fill context with Winnow

Repo: [GhalebDweikat/winnow](https://github.com/GhalebDweikat/winnow) | Difficulty: Intermediate | Time: 45 minutes | Basis: From the README

Install Winnow as a Claude Code plugin so big Read, Bash, and Grep outputs are filtered before Claude sees them.

**Who it is for:** A developer using Claude Code on a large repo whose sessions fill up with long file reads and command output.

**The problem:** Large tool results add many tokens to context, and most of the lines are not needed for the current task.

**The outcome:** Low-relevance blocks are replaced by a three-line stub with a summary and a key to restore the full text, and a [Winnow] line marks each rewrite.

### Steps

1. In ~/.claude/settings.json, add { "env": { "CLAUDE_CODE_ENABLE_FUNCTION_HOOKS": "1" } }.
2. Clone the repo with `git clone https://github.com/GhalebDweikat/winnow.git`, then run `claude plugin marketplace add ./winnow` and `claude plugin install winnow@winnow`.
3. Put TYPESAFE_API_KEY in ~/.winnow/env, or set WINNOW_JUDGE=adapter with ANTHROPIC_API_KEY to use the adapter.
4. Run `uv run --project winnow/sidecar winnow doctor` to check which keys were found and whether each backend starts.
5. Open a new Claude Code session and read a file longer than about 1,500 characters; a [Winnow] line in the result means it is working.

### Prompt to paste into your agent

```text
Using the winnow repo at <repo path>, install it as a Claude Code plugin and run `uv run --project winnow/sidecar winnow doctor`. Report which judge backend initialized. Then read <target file> in a new session and confirm a [winnow] line appears in the result if the file is longer than 1,500 characters.
```

### Caveat

Hidden blocks are judged by an early-access model or by Claude Haiku 4.5 through your Anthropic account, and Winnow changes only what Claude sees, not files on disk.

Risk, credentials: The setup stores API keys in ~/.winnow/env or in ~/.claude/settings.json, so those files must be kept private.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/ghalebdweikat-winnow/trim-large-claude-code-tool-results/

## How to test Winnow in shadow mode before it changes results with Winnow

Repo: [GhalebDweikat/winnow](https://github.com/GhalebDweikat/winnow) | Difficulty: Beginner | Time: 15 minutes | Basis: From the README

Log what Winnow would hide for a week without changing anything Claude sees.

**Who it is for:** A developer who wants evidence that the judge's decisions are right before trusting it with live context.

**The problem:** Hiding the wrong block could cost time, and it is hard to judge filter quality without seeing the decisions.

**The outcome:** A week of logged decisions and savings estimates that show whether active mode is safe to enable.

### Steps

1. Add WINNOW_MODE=shadow to ~/.winnow/env, or to the env block of ~/.claude/settings.json.
2. Work in Claude Code as normal for about a week so the hook judges real tool results.
3. Run `winnow stats` to see how many results would have been rewritten and how many characters would have been saved.
4. Run `winnow recall` with a key from ~/.winnow/decisions.jsonl to see exactly what would have been hidden.
5. If the decisions look right, change WINNOW_MODE to active.

### Prompt to paste into your agent

```text
In the winnow repo at <repo path>, set WINNOW_MODE=shadow, then run `winnow stats` after a week of Claude Code use. Report the number of results that would have been rewritten and the characters that would have been saved. Verify that the decision log in ~/.winnow/decisions.jsonl contains per-block probabilities.
```

### Caveat

Shadow mode still judges every result and sends the tool output to the judge, so data leaves your machine even though nothing is rewritten.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/ghalebdweikat-winnow/trial-winnow-in-shadow-mode/

## How to score a judge on your own Claude Code transcript history with Winnow

Repo: [GhalebDweikat/winnow](https://github.com/GhalebDweikat/winnow) | Difficulty: Advanced | Time: 1 hour | Basis: From the README

Run Winnow replay offline against saved transcripts to benchmark a judge with no API key.

**Who it is for:** A developer or researcher who wants to measure how well a judge would filter their own past tool results.

**The problem:** Generic benchmarks do not reflect your own code and tool output, and testing a judge live costs money and needs keys.

**The outcome:** A scored report of a judge run against labeled results built from existing transcripts.

### Steps

1. Confirm that Claude Code transcripts exist under ~/.claude/projects.
2. Run `uv run --project winnow/sidecar winnow replay run --judge lexical` from the clone. (inferred, check the README)
3. Use `winnow replay` subcommands such as extract, judge, score, sample, label, and agreement to inspect results.
4. Review the scored output for the judge you tested.

### Prompt to paste into your agent

```text
In the winnow repo at <repo path>, run `uv run --project winnow/sidecar winnow replay run --judge lexical` against the transcripts under ~/.claude/projects. Report the scored output and confirm that no API key was needed.
```

### Caveat

The README describes replay as offline and key-free for the lexical judge, but the README is truncated, so check the full replay options before relying on them.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/ghalebdweikat-winnow/score-a-judge-on-past-transcripts/

## How to inject relevant memory notes into each Claude Code prompt with Winnow

Repo: [GhalebDweikat/winnow](https://github.com/GhalebDweikat/winnow) | Difficulty: Intermediate | Time: 30 minutes | Basis: From the README

Point Winnow at your markdown notes so the right ones load with each prompt.

**Who it is for:** A developer who keeps project notes or design docs in markdown and wants Claude to see the relevant ones without manual Read calls.

**The problem:** Relevant notes are easy to forget, and asking Claude to read them each time costs a round of tool calls.

**The outcome:** Claude receives the most relevant note files, up to a set count and size, along with each prompt.

### Steps

1. Collect the directories of .md files you want considered, such as a notes folder.
2. Set WINNOW_CONTEXT_DIRS to those directories in ~/.winnow/env, using : on macOS and Linux or ; on Windows.
3. Optionally tune WINNOW_CONTEXT_GATE, WINNOW_CONTEXT_TOP_K, and WINNOW_CONTEXT_MAX_CHARS.
4. Open a new Claude Code session and send a prompt that relates to one of your notes.
5. Check that the matching note appears in Claude's context.

### Prompt to paste into your agent

```text
In the winnow repo at <repo path>, set WINNOW_CONTEXT_DIRS to <notes directory> and start a new Claude Code session. Send the prompt <test prompt> and confirm that the note matching it is injected. Report the files injected and the file count against WINNOW_CONTEXT_TOP_K.
```

### Caveat

The selector sends your prompt and the first 600 characters of each candidate file to the judge, so keep sensitive notes out of the configured directories.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/ghalebdweikat-winnow/inject-relevant-notes-into-each-prompt/
