Cut wasted context.
Thinker helps your coding agent use fewer tokens. Find what it loads but rarely uses, review what to cut, and reuse what it learns about your code.
npx @zerotimedev/thinker
Connect your agents, see suggested savings from recent sessions, and keep coding. Installation details.
| Section | Per prompt | Needed | This week | Wasted | |
|---|---|---|---|---|---|
| Repository layout | 420 | 92% | 1.1M | 88k | |
| Running the tests | 310 | 71% | 0.78M | 0.23M | |
| Release process | 1,460 | 4% | 3.6M | 3.5M | high waste |
| Deploy to staging | 980 | 0% | 2.5M | 2.5M | high waste |
| Legacy API notes | 1,220 | 3% | 3M | 2.9M | high waste |
| Commit conventions | 240 | 58% | 0.6M | 0.25M | |
| Database migrations | 690 | 19% | 1.7M | 1.4M | medium waste |
Pick sections to shorten or remove, review the diff, then open a pull request. How to make a cut.
src/billing/invoice.py 612 lines · ~7.1k tokens, re-read by the 23 calls after it1 import decimal 2 from dataclasses import dataclass 3 from .money import Money, round_half_even … 140 def apply_refund_cap(invoice, refund): 141 cap = invoice.total * REFUND_CAP 142 if refund.amount > cap: 143 raise RefundTooLarge(refund, cap) … 612 return Invoice(lines=lines, total=total)
lines 128–181 of 612, round "refund_cap":
128 REFUND_CAP = decimal.Decimal("0.5")
…
140 def apply_refund_cap(invoice, refund):
141 cap = invoice.total * REFUND_CAP
142 if refund.amount > cap:
143 raise RefundTooLarge(refund, cap)
…
omitted 1–127: imports, Money, Invoice, InvoiceLine
omitted 182–455: build_invoice, add_line, total
omitted 456–612: to_pdf, send
read any range: Read with offset and limit
Keep the relevant lines; tell the agent how to read the rest. Available for Claude Code. Compression settings and limits.
Keep the knowledge, too. Thinker learns from your sessions and brings relevant notes into future tasks, checking them as the code changes. How the cache works.
Install and start saving
npx @zerotimedev/thinker
Requires Node 20+, git, curl, tar and a supported coding agent. The installer connects your agents and shows where their context goes. Choose the browser or terminal to review suggested cuts.
- Find Savings: review the suggested instructions, skills and tools to shorten or switch off.
- Apply your choices: preview instruction changes as a diff; in the browser, open a pull request to review and merge.
- View Report: track tokens and costs week by week as you keep working.
After that, thinker comes to you. You don't run it by hand. About once a week, once a repository has ten sessions to read, your agent opens its reply with a short message from thinker: one line per change worth making, what it would have saved and the suggested action, with a link to the page. Reply with the numbers to approve, or "all", or review them on the page first; nothing changes until you say so. Whenever you want the page itself, thinker ui opens it. Learning, re-checking notes and updates run in the background.
What installation changes
Thinker installs under ~/.thinker and connects your agents in their own settings. Its first report reads the last 30 days of sessions in your five most active repositories; generating that report needs no model call. In the browser, suggestions arrive checked for review. Nothing is cut until you apply your choices.
Each repository's cache starts empty and grows from your sessions. Notes are stored locally under .thinker/. Learning and verification use your agent's model access. See privacy and telemetry.
Use --no-ui to stay in the terminal. With --yes or no terminal, the installer prints the report.
Find Savings
Find Savings opens from the link in the weekly suggestion, or with thinker ui. See what each instruction, skill and tool costs your sessions, then choose what to cut.
Why a few thousand tokens matter
An agent's context is sent whole on every model call. The instruction file, the skill list, every MCP server's tool definitions and every tool result so far are re-read each time, and a coding session makes tens of calls. So a part's cost is its size times the calls: a 4k-token section read by 40 calls is 160k input tokens, and a 7k-token file read on the third call is paid on every call after it.
The three lower bands are the same on every call: 18k tokens here, paid twelve times. The top band is every tool result so far, paid on every call after the one that read it.
Two things follow. A token cut from the fixed part is cut from every call, so a 1,200-token section nobody acts on costs far more than its size suggests. And a tool result is cheap once and expensive as it stays: compressing it saves on every call that follows, not only the one that read it.
What it shows
Input tokens over time, as stacked columns by day or week, total or per session, split into the parts the agent reads on every model call. The page sorts by the cost a session: tokens times model calls.
The sum is what every model call re-reads, times the calls. Here two MCP servers and three sections of AGENTS.md were cut in week 41.
| Part | What it is | Read from |
|---|---|---|
| Instruction files | AGENTS.md, or CLAUDE.md where there is no AGENTS.md, section by section | Claude Code, Codex, Cursor and Gemini CLI sessions |
| Custom tools | The skills listed in every session, MCP servers and plugins, with their descriptions and tool definitions | Claude Code in full; Codex's skill catalog and MCP namespaces; Cursor's MCP servers |
| Built-in tools | The agent's own tool definitions, re-sent with every call | Claude Code |
| Tool outputs | What each tool's results added to the conversation, re-read by every call after them | Claude Code |
One part at a time, as cards. Each instruction section, skill and tool stands beside three measures:
| Measure | What it means |
|---|---|
| Cost | Per prompt: what the part adds to every prompt (one call to the model) that carries it. Needed: the share of those prompts where the agent acted on it. The window total: per prompt × every prompt that carried it. Wasted: that × the prompts that did not need it. |
| Used | A section is applied when a session touched its files, ran its command or read the code it names, read free from the transcript. Relevant and followed come from a model judging a 25% sample of sessions as they end. instructions.value.judge: false disables automatic judging. A skill is read when a session opened it, and the sampled outcome check adds whether sessions that read it kept its rules and how often one broke them without reading it. A tool is used when a session called it. |
| Wasted | What the part cost in the sessions that did not use it (an output: what its results cost after the agent last used them, an estimate from the edits and file calls that followed). High waste from 5% of what its kind costs, medium from 2%. A cut saves that at most: a session that needed the part would go without. For an output it is the size of the problem; compression cuts only what is past its cap. |
All repositories merges every repository's report: the timeline side by side, tools merged by name, averages weighted by sessions.
What you can cut
Choose a cut, review its preview, then apply it. Each action is also available from the terminal.
Compress or remove an instruction section
Pick the sections no session acts on. Compress has a model rewrite them to about a third of the length; it is told to keep every rule, command, flag, config key, default and path, and to drop history, measurements, rationale and repetition. Remove drops the section; a heading with subsections keeps its heading line.
- How
- Apply starts the change in the background and the page says so once: a model compresses the sections, and the change becomes one commit on a branch of its own, built from the default branch and pushed to the origin, with a pull request opened through
gh; nothing in your working tree changes, and you read the diff in the pull request. Recent activity (the tab at the right) follows it: Compressing… while it runs, PR pending until it is merged, Merged (while your checkout has not pulled the merge, the section is not offered on Find Savings and Recent activity says which branch to pull), Rejected if it is closed without merging (the sections are suggested again), Failed with the reason and a Retry; the badge on the tab counts what still needs you. Without a GitHub origin orgh, the text is written toAGENTS.md(orCLAUDE.md) in your working tree instead, uncommitted, for you to review withgit diff. - Undo
- Close an unmerged pull request from Recent activity or GitHub. Revert a merged change through git; restore an uncommitted edit from the working tree.
- Agents
- Every agent that reads the file.
Switch skills, MCP servers, plugins and built-in tools off
A skill's description, an MCP server's tool definitions and a plugin's are loaded into every session whether or not anything uses them. Switch off takes one out of the next session's context for this repository. A skill switched off still runs when you type /name. Claude Code's own tool definitions go the same way, from the Built-in tools table (their rows in bold), after a confirmation that names the tools, where the switch is written and how they come back; the file, shell and search tools are never offered.
- How
- The setting in the agent's own files that hides the source, written for this repository alone. Claude Code:
skillOverrides(user-invocable-only),enabledPlugins,disabledMcpjsonServersand, for a built-in tool,permissions.denyin.claude/settings.local.json; ordisabledMcpServersin this repository's entry of~/.claude.json, what/mcp disablewrites. Codex:enabled = falsein the checkout's.codex/config.toml, a skill by its path in~/.codex/config.toml. Cursor: the server's entry in~/.cursor/mcp.json, for every repository. Every file is backed up first under~/.thinker/state/harness-backups/. - Undo
- Turn back on: each file is put back as it was.
- Agents
- Claude Code and Codex; Cursor for MCP servers.
Compress tool outputs
A tool result stays in the conversation, so every model call after it reads it again: a whole-file read is paid for twenty times over. Compression keeps what the agent was looking for and names what it left out, so the agent can ask for any range.
- How
- Claude Code's tool hook may replace a result before the model reads it; nothing thinker serves ever leaves the context again, so this is the one place tokens are taken out instead of added. Three shapes are trimmed. A whole-file read becomes the lines around the session's recent search patterns and the request's identifiers, every omitted range named with the definitions it holds and a last line saying how to read it. A test run becomes its counts and each distinct failure once, the full log kept under
.thinker/state/tests/. A large search becomes its hits grouped per file. Any other output past the cap is cut to it: 40 lines each side of a hit, about 3k tokens of plain output. A file under 120 lines, one with no hit, or one where the kept lines reach 60% of it passes whole. - Measure
- After you change compression, the tool is measured from that setting onward. Its previous measurement stays as a muted row for comparison, below current rows.
- Undo
- No compression on the page. It is a setting in
.thinker/config.json; nothing already in a conversation changes. - Agents
- Claude Code only.
Correctness and undo
Every cut removes something the agent might have read. What keeps that from costing you a task:
- Nothing is cut by itself. The report measures. Each cut is your choice, shown first as a diff, a setting or a sample result, and each has an undo path.
- Use is measured before you cut. A section applied in 90% of sessions wastes a tenth of its cost at most, and is flagged only when that tenth is still a large share of the file. Start with high waste: large, and used in almost no session. The saving shown is the most a cut can save; a session that needed the part goes without it.
- Compression keeps the rules. The model that shortens a section is told to keep every instruction, command, flag, default and path and to drop history, numbers and rationale, and you read the diff in the pull request before merging it. Remove is yours to judge; in doubt, compress.
- A trimmed result says what it left out. A compressed file read names each omitted range and how to read it back, so the cost of a wrong guess is a second read, not a missed fact. A file the trim would not shorten passes whole, and full test logs stay on disk.
- You can undo a cut. Close an unmerged instruction PR or revert a merged change; use Turn back on for anything switched off, No compression for compression; Revert under Recent activity covers both. The FAQ lists what each cut writes.
What the numbers are. Tokens are counted from the transcripts at about four characters a token, times the model calls the transcript records. A tool output's cost is its tokens times the calls left after it; a compaction, which drops old results, is not seen, so that part is an upper estimate. The waste flags are measurements of use, not a promise: whether the agent then misses a cut section is what followed and missed are there to show, on your own sessions. No benchmark is claimed for the cuts; the benchmarks are about the cache.
Supported agents
Thinker works inside the tools you already use. Four agents are wired once per machine in their own settings; four more get an extension or hook file in the checkout.
| Agent | Notes for the request | Notes on edited files | MCP tools | Wiring |
|---|---|---|---|---|
| Claude Code, and the Claude desktop app's Code tab | Added to each prompt | Yes | Yes | Machine-wide |
| Codex CLI and the Codex desktop app | Added to each prompt | Yes | Yes | Machine-wide |
| Gemini CLI | Added to each prompt | Yes | Yes | Machine-wide |
| Cursor | Through prompt hooks and the first tool result | Yes | Yes | Machine-wide, plus a rule in the checkout |
| Pi | Extension | Yes | CLI guidance | The checkout |
| Windsurf Cascade | A rule asks the agent to orient | Agent-directed | CLI guidance | The checkout |
| GitHub Copilot CLI | With the first tool result | Yes | Manual | The checkout |
| OpenCode | Plugin | Yes | Yes | The checkout |
The installer wires the agents it finds; its --clients option (all or a comma-separated list) picks them by hand. Restart a running agent after the install.
Where each agent is wired
- Claude Code: hooks in
~/.claude/settings.json, the MCP server in~/.claude.json.UserPromptSubmitadds the notes to the prompt,PostToolUsebrings the notes on a file being edited,StopandSessionEnddistill the session once in the background. - Codex CLI: hooks in
~/.codex/hooks.json, the MCP server in~/.codex/config.toml, where the project and the hooks are also marked trusted so Codex asks nothing before running them. The desktop app reads the same file. - Gemini CLI: prompt-time context, edit notes and the MCP server in
~/.gemini/settings.json. Gemini Code Assist's agent mode reads the same configuration. - Cursor: hooks in
~/.cursor/hooks.json, the MCP server in~/.cursor/mcp.json(approved by setup), and an always-applied rule in the checkout. Cursor's prompt hook cannot add context, so the notes are computed at prompt time and handed over with the first tool result. - Pi, Windsurf Cascade, Copilot CLI, OpenCode: nothing machine-wide. The installer, given
--clients pi,windsurf,copilot,opencode, writes an extension, a hook file or a rule. Restart the host agent afterwards.
What a note is
A note answers a recurring question about the repository, not "what this file does". It is 3 to 12 lines with file:Symbol pointers into the code, and it comes in four kinds:
| Kind | What it answers |
|---|---|
rule | What a change must respect: an invariant, a convention, a trap, a fix not to undo and why. |
map | Where a recurring concern is handled, how control or data flows across files, the shape of a module area |
howto | How to build, test, run or lint, with the non-obvious flags |
behavior | A rule a design document checked into the repository states, or one a person wrote down |
Each note stores its title, the questions it answers, its body, the files and symbols it rests on with their content hashes, its source (a session, a pull request, a person), its confidence and its status. A note's pointers are its dependencies: a note about AuthManager.verifyToken hashes that definition alone, so it does not go stale because another method in the same file changed.
Keeping it current
A cache that drifts from the code is worse than none. Thinker keeps itself correct in three ways, all in the background, under a daily token cap (maintain.dailyTokens in the configuration):
It learns from every session
- Each session is distilled once, when it ends, through the agent's own login: up to three new notes, and a verdict on every note it was served.
confirmed(the agent acted on it) raises confidence;contradicted(the trace shows a claim was wrong) corrects the body and keeps the history;unusedlets it decay. Near-duplicates are merged. A quiet session with nothing to learn from is skipped. - Newly merged pull requests are mined as they land, fixes first, when
maintain.prsis on in the configuration (off by default: the cache grows from the sessions). - People add notes too: telling your agent to remember something makes it a note when the session is distilled.
It knows when a note is stale
- Every serving re-hashes the dependencies of every note against your working tree, uncommitted edits included. A note whose code changed is marked stale and names exactly what changed.
- A stale note is never served by the hooks. It is held back, re-verified in the background, and served again once it is fresh.
- Verification sends the note, the diff of its changed dependencies and their current text to a small model, which answers
still_valid,update(body rewritten, history kept) orinvalid(retired). - The block is found by a tree-sitter parser for Python, JavaScript, TypeScript, Go and Rust, which comes with the install. Other languages, and code the parser cannot read, use a regex heuristic.
It maintains itself
Maintenance runs from the prompt hooks and after every commit or merge, and spends little by default: one verification batch every three days, of the stale notes served in the last three days (at most 50), retrieval phrasings for new notes, and the removal of notes nobody was served in 14 days (a committed note is archived instead). Mining pull requests, reading design documents and carding skill files in the background are off unless the repository's maintain configuration turns each on. What a run did is shown once at the end of the next turn.
.thinker/local/, which git ignores.
Skills
A skill is a file (SKILL.md) an agent pulls into its context by name: how to deploy, how to run the tests here, how to add a webhook. Its instructions rest on code that moves, so a skill decays the way a note does. Thinker treats the skill files checked into a repository as cached knowledge; it never edits one.
- Each skill gets a card. A skill file under
.claude/skills,.agents/skills,.codex/skills,.cursor/skills,.github/skillsorskills/gets a note of kindskill: what it is for, when to invoke it, what it prescribes, with pointers at the code it talks about. Maintenance cards new and changed files wheremaintain.skillsis on. A served card tells the agent to invoke the skill for the full instructions. - A card is served like any note. The hooks rank it with the rest, so a request the skill is about brings the card with its pointer to the file; nothing has to be asked for.
- Each card is audited against the code. When code a skill talks about changes, the audit reads the file against the current code and asks one question: does the code contradict something the skill states? A skill the code contradicts is out of date: its issues are recorded, it is not served, and no further model call is spent on it until the file changes.
- Sessions grade them. A session that invoked a skill is read for whether the skill held; a contradiction the session found takes the skill out the same way. Among skills that do the same thing, the one the sessions confirm is the one served (
skills.preferin the config pins one).
In a session
Nothing changes in how you work. The hooks put the right note in front of the agent at the right moment, and the agent starts at the code it needs instead of searching for it.
- Each request gets the note that fits it, with
file:Symbolpointers into the code and a[6 call sites in 3 files]tag on each symbol it names. A local ranking model reads the request with the best lexical candidates and serves up to two notes, only those it scores relevant; when it is missing, notes are ranked by words alone. A note is served once per session, never while stale, and not at all for a one-word turn of conversation. When nothing fits, nothing is served. - Each file the agent edits brings the rules resting on it, so a trap on that code is in front of the agent as it changes it.
- At the end of each turn one line says what was served:
🧠 thinker: 2 notes this turn (pointing at 2 files, ~7k tokens of code). It does not say "saved": whether the agent acted on a note is known only once the session is assessed.
Measured on real tasks with and without thinker, every model tested used 18% fewer input tokens per task and finished 10% sooner. .
The MCP server
The notes reach the agent through the hooks alone. The MCP server offers the agent no tools (since 2026-10-22; the orient, lookup, remember and feedback tools are gone): it carries thinker's own questions and, in a desktop app, its learning queue.
Usage and the holdout
The cache gives the agent the context that fits its task, so it does not have to build up its own picture of the codebase from file reads and searches.
Fewer searches mean fewer turns and tool calls, so the same model finishes the same task sooner.
Knowledge-cache benchmarks: one run per arm, different task sets per model. These results do not measure the Find Savings cuts. or read the method and limitations.
View Report on the local page shows how the cache has been used, for one repository or every repository on the machine: notes served and how, what the sessions did with them, what learning and maintenance cost in tokens, and an estimate of the reads avoided. Where the context itself goes is the Find Savings view.
One number in it is measured rather than estimated. The hooks serve nothing in 15% of prompts, chosen by a hash of the session id and the turn's number, and what every turn cost is recorded from the session's transcript. The holdout comparison compares the prompts that got notes with the ones that had notes withheld, as cost per prompt overall and per model, once twenty prompts stand on each side. This is what the notes do for your own work, on your own repository, by your own agent. holdout in the config changes the share or turns it off.
The local page
The weekly suggestion in your session links to it, and thinker ui opens it from any directory. It is the one place to see and change what thinker does:
| View | What it does |
|---|---|
| Find Savings | See context cost and use over 7 or 30 days, for one repository or all. Apply cuts, and follow them under Recent activity, whose badge counts what still needs you. |
| View Report | Track the average tokens a prompt (one call to the model) or its list-price cost over six weeks, by context part, model and token type. Review your changes and the cache's savings below. |
| Recent activity | Every change you made, newest first, with what came of it: Retry a failed one, Close PR on a pending one, Revert any of them. |
The page listens on 127.0.0.1 with a token for that run and stops after half an hour unused. Reports refresh in the background.
Configuration
Everything in .thinker/config.json is optional.
| Key | Effect |
|---|---|
learn | {"sessions": false} stops distilling sessions; pull requests and re-verification go on |
maintain | enabled, dailyTokens (10,000,000 with a Haiku-class distillation model, 1,000,000 otherwise), verifyEveryDays (3), verifyPerRun (50), verifyServedDays (3), deleteUnusedDays (14), phrasePerRun (8); off by default: prs (with prsPerRun, 3), docs (with docsPerRun, 3), skills, dedupe |
instructions | {"value": {"judge": true, "share": 0.25}} has a model judge a sample of sessions as they end, for the Context page's relevant and followed |
diet | Tool output compression, written from Find Savings: {"tools": {"Read": "moderate", "Bash": "moderate"}} |
harness | enabled (switching skills and tools off writes the agent's settings; the page turns it on when you switch one off), builtinTools (offer Claude Code's built-in tools too) |
archive | kinds and unservedDays (30), or false |
holdout | The share of sessions served nothing (0.15; 0 or false: none) |
ce | The local ranker the hooks choose notes with: floor (0), maxNotes (2), or false to rank by words alone |
snippets, notice | false: no code behind the pointers; no end-of-turn line |
distillModel, verifyModel | The model for each kind of call |
telemetry | false: no metrics sent |
In the environment, THINKER_NO_LEARN=1 turns learning and maintenance off, THINKER_HOOKS=off silences the hooks, THINKER_MCP=off makes the MCP server offer no tools, and THINKER_LLM picks the agent that answers model calls (claude, codex, cursor, gemini, anthropic with ANTHROPIC_API_KEY, or openai: any OpenAI-compatible endpoint named by THINKER_LLM_BASE_URL, with the token in the variable THINKER_LLM_API_KEY_ENV names and the model in THINKER_LLM_MODEL).
Privacy and telemetry
Thinker sends pseudonymous hourly effectiveness metrics (cache hit rate, note count, estimated token savings, and the totals of the holdout comparison: prompt counts and summed tool calls and tokens of prompts with and without notes) to monitor cache quality. They also carry counts for the context proxy (requests through it, tokens the API cleared, errors, and the model ids it saw) and for the choices you make on Find Savings (how many changes were suggested, applied, dismissed or reverted, by kind of part, and the tokens a prompt each measured before and after). These telemetry reports contain no code, note bodies, prompt text, file paths or repository URLs. The only part names in them are your agent's own built-in tools and common shell commands (Grep, Bash:git): never a section title, instruction file, skill name or MCP server name. Note ranking runs on your machine. Learning and verification use your configured model provider. The telemetry opt-out below does not disable those model calls.
# Opt out in your shell environment:
export THINKER_TELEMETRY=off
# Or in .thinker/config.json:
{ "telemetry": false }
Frequently asked questions
Where is my data stored? Does anything leave my machine?
The cache lives in the repository it describes, and it stays on your machine. Notes are under .thinker/local/, which git ignores; there is no team sharing or sync. Notes that an older version committed under .thinker/notes/ are still read. .thinker/config.json holds the configuration. Per machine, ~/.thinker/ holds the installed app, the usage log every serving is recorded in, and the ranking model. The Context report is read from the transcripts your agents already write; nothing is copied out of them.
Network activity includes:
- Model calls go to the provider you already use for your agent. Learning and verification run through your agent's own login (
claude,codex,gemini,cursor, or an Anthropic API key), or, in a desktop app (Claude Desktop, the Codex app, Cursor), through the app's own session. A session is distilled from a condensed transcript; verification sends a note with the diff of the code it rests on. Thinker runs no model and stores nothing of its own in the cloud. - Telemetry is counts only. An hourly report carries numbers: notes served, verdicts, token totals, the sums of the holdout comparison, what went through the context proxy, and what you compressed or switched off and what it measured as saved, with an install id and a hashed device id. It contains no code, note bodies, prompt text, file paths or repository URLs, and names nothing of yours: a skill, an MCP server or an instruction section is counted by its kind, while your agent's own built-in tools are named.
THINKER_TELEMETRY=offor{ "telemetry": false }in the config stops it; see Privacy and telemetry. - The ranking model is downloaded once at install (about 23 MB) and runs on your machine. Ranking never calls a service.
The local page of thinker ui listens on 127.0.0.1 only.
A repository with sensitive content can be turned off with thinker disable inside it. Thinker then does nothing there, in any clone or worktree: the hooks and the MCP server serve nothing, no session is distilled, and nothing is written into it. thinker enable turns it back on.
Where do the context savings come from? Why does a short section matter?
Every model call sends the whole context again: the instruction file, the catalog of skills and tools, and every tool result so far. A session of 40 calls reads a 3k-token section 40 times, 120k input tokens, and a file read on the fifth call is paid on the 35 calls after it. That is why the fixed part of the context is most of what a session spends, and why cutting a few thousand tokens from it is worth more than the number suggests: the cut applies to every call.
Thinker works on that in four places, each measured on your own sessions on the Find Savings view:
- Instruction sections no session acts on: compressed to a third or removed, as a pull request you review.
- Skills, MCP servers, plugins and built-in tools sessions never call: switched off for the repository in the agent's own settings.
- Tool outputs: a whole-file read, a test log or a big search trimmed to what the agent was looking for before the model reads it, so every later call reads less too.
- The cache: a note that points at the right definition replaces the searches and whole-file reads the agent would have made to find it.
The saving shown for a cut is its tokens times the calls of the sessions that would have read it, from the transcripts. The cache's effect is measured separately, by the holdout.
Will my agent miss something I cut?
It can, which is why nothing is cut without you. The page is built so that you see the risk before taking it:
- Use is measured first. A section is applied when a session touched its files, ran its command or read the code it names; a judge can add relevant and followed. Only a part used in under half the sessions is flagged, and high waste means large and used in almost none. Start there.
- Compress keeps the rules. The model is told to keep every instruction, command, flag, default and path and to drop history, numbers and rationale, and you read the diff in the pull request before merging it. If a section holds rules the agent must follow, compress it rather than remove it.
- A switched-off skill still runs when you type
/name; only its listing leaves the context. An MCP server or plugin is off for new sessions in this repository, not removed. - Afterwards, followed and missed on the cards show whether sessions kept a rule they no longer read. Each cut has an undo path (below).
No benchmark is claimed for the cuts yet: the savings are tokens the sessions would not have read, measured on your sessions, and the followed and missed counts are the check on correctness.
Can compressing tool outputs break what the agent does?
Compression changes what the model reads of a result, not what the tool did. The file is unchanged, the test ran, the search ran. What is replaced, and what is kept:
- Only three shapes are trimmed, in Claude Code, for the tools you choose: a whole-file read, a test run and a large search. Everything else passes untouched, and so does a file under 120 lines, a file with nothing to centre on, or one where the kept lines would reach 60% of it.
- The omitted parts are named. A trimmed file read says which line ranges were left out, which definitions they hold, and how to read any of them back. If the agent needs an omitted range it reads it; the cost of a wrong guess is one more read, not a missed fact.
- Nothing is lost. A summarized test run keeps its full log under
.thinker/state/tests/and says where. A grouped search keeps every file that matched. - It is a setting, per tool, off by default. No compression on the page turns it off for the next tool call; a conversation already running is not rewritten.
What to watch: if the agent reads trimmed files back whole, the saving shrinks. The Tool outputs cards show the cost per tool after the change, on your sessions.
What does a cut change on my machine, and how do I undo it?
| Cut | What is written | Undo |
|---|---|---|
| Compress or remove a section | A branch thinker/context-… pushed to the origin and a pull request against the default branch; the working tree is untouched. Without GitHub or gh: the new text of AGENTS.md (or CLAUDE.md) in your working tree, uncommitted. The preview is kept under .thinker/state/ | Close the unmerged PR, revert a merged change, or restore the uncommitted file |
| Switch a skill, plugin, MCP server or built-in tool off | One key in the agent's own settings for this repository: .claude/settings.local.json or this repository's entry in ~/.claude.json; the checkout's .codex/config.toml or, for a Codex skill, ~/.codex/config.toml; ~/.cursor/mcp.json. Each file is backed up first under ~/.thinker/state/harness-backups/ | Turn back on |
| Compress tool outputs | diet.tools in .thinker/config.json, a level per tool | No compression |
Viewing the report changes no instructions or agent settings. Opening an instruction pull request commits and pushes only the change you reviewed.
How does the cache work? What does it do to make my agents faster?
A note is a short rule, map or how-to about one part of the code, with file:Symbol pointers and a hash of the code it rests on. The cache is a set of such notes, and the work is in putting the right one in front of the agent without being asked:
- On each request a hook picks the lexical candidates, then a local ranking model reads the request against them and serves up to two notes, only those it scores relevant. The agent starts at the code instead of searching for it.
- On each file edit the rules resting on that file are served, so a trap on that code is in view while it is changed.
- Never stale. Every serving re-hashes the dependencies of every note against your working tree. A note whose code changed is held back, re-verified with the next batch (every three days), and served again once it is fresh.
- Once per session. A note is served once, not for one-word turns, and not at all when nothing fits.
The cache keeps itself: each session is distilled once when it ends, and a maintenance batch every few days re-verifies the stale notes sessions were served and drops the ones nobody was served in two weeks. See Keeping it current.
Where do the notes come from? Can I build the cache up front?
From your own sessions, and from nothing else. When a session ends, a model reads a condensed transcript of it (what was asked, read, run and changed) and saves what the session worked out that the next one would otherwise work out again, usually nothing or one note. The same call grades the notes the session was served: confirmed, contradicted (the note is corrected) or unused. A quiet session, with nothing served, no edit, no failure and little exploring, is skipped.
- There is no build step. The installer connects your agents and nothing else; every git repository starts with an empty cache, and the hooks serve from it once it holds a few notes.
- The spend is bounded. One model call per session, through your agent's login, and learning and maintenance together stop at a daily token cap (
maintain.dailyTokensin.thinker/config.json). - You can add your own. Telling your agent to remember something makes it a note when the session is distilled.
- You can stop it.
{ "learn": { "sessions": false } }in the config stops learning from sessions in a repository;THINKER_NO_LEARN=1stops all learning.
How can I tell if Thinker is helping my agents?
- At the end of each turn one line says what was served and the code it pointed at. It does not say "saved": whether the agent acted on a note is known only once the session is assessed.
- The Find Savings view, and the weekly suggestion drawn from it, show where your agents' context goes: what each instruction section, skill and tool costs a session and how often sessions acted on it, so what you cut is measured on your own sessions.
- The cache summary under View Report shows notes served, what the sessions did with them (confirmed, contradicted, unused), what learning and maintenance cost in tokens, and an estimate of the reads avoided.
- The holdout is measured, not estimated. 15% of prompts are served nothing, chosen by a hash of the session and the turn, and what every turn cost is read from the session's transcript. Once twenty prompts stand on each side, the holdout comparison compares the cost per prompt: tool calls and tokens with notes against without, on your repository, by your agent.
A note served is not a note used. Read the confirmed and unused counts rather than the hit rate; a cache that serves often and is rarely acted on is costing tokens, and maintenance archives such notes over time.