Profile LLM context: token breakdown, wasted-context findings and fixes for chats and agents.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
One-click editor setup isnβt available for this listing yet β we donβt have a confirmed install command, and weβd rather show nothing than point your editor at the wrong package or host. Follow the projectβs own setup instructions, linked above.
Keep every AI session's context lean, automatically, without ever making it more expensive.
Long agent sessions fill up with tool output nobody reads again: file dumps, shell logs, search results, screenshots. You pay for all of it on every request, the model gets slower, and it drifts as the window fills. context-doctor measures that, and with autopilot it removes it from every Claude Code (and GPT API) request on your machine, only at moments when doing so costs nothing extra.
context-doctor accuracy re-checks them on yours. How βBuilt and maintained by gAI Ventures.
See what it would save you first (no install, reads your local Claude Code history):
That is the author's machine. Yours is computed the same way: every recent session replayed request by request through the shipped autopilot code, against what your transcripts show you were actually billed.
Then install it, whichever way suits you:
The plugin brings the every-prompt check, the MCP tools, and /context-doctor:savings, /context-doctor:checkup and /context-doctor:autopilot. It needs no npm step: the MCP server ships as one self-contained file, so it also works on Claude Code versions that do not install plugin dependencies.
context-doctor autopilot status shows what autopilot did; context-doctor doctor checks the whole setup. Everything is reversible: context-doctor autopilot off, context-doctor uninstall, or /plugin uninstall.
Measured, not modelled: every Claude Code session on the author's machine from 18 May to 25 September 2026 (43 sessions, 130 days, mostly Opus 5 and Fable 5 with the 1M window) was replayed request by request through the shipped autopilot code, with the real timestamps, and priced the way the prompt cache bills it (cached reads 0.1x, writes 1.25x). Run it on your own history with node scripts/replay-autopilot.mjs.
| Without autopilot | With autopilot | Saved | |
|---|---|---|---|
| Input tokens sent | 41.4 billion | 37.6 billion | 3.8 billion (9.2%) |
| Input cost at API list price | $48,962 | $44,268 | $4,694 (9.8%) |
| Per 30 days | ~875 million tokens, ~$1,080 | ||
| Sessions made more expensive | 0 of 43 |
How it spreads: the median session saves 1.9%, the best 37.7%. Short sessions barely change, because they rarely pile up 20k tokens of stale tool output before they end. Long sessions are where the money is: on this machine 94% of input cost came from requests above 200k tokens, and those are the requests autopilot makes smaller. Savings scale with how long your sessions run and how much they read, so a lighter user saves proportionally less, and never pays more.
On a Claude subscription you do not pay list price; the same tokens come out of your usage limit instead. Anthropic does not publish how limits weight cached tokens, so read the dollar column as the size of the effect, not as your bill. The token column holds either way, and every request that is 9% smaller is also faster to first token and further from auto-compaction.
What is not counted here: the proxy's full optimizer for your own API apps, the hook's guidance to the model, and fixes you make from session findings. Those save more on top, but they depend on what the model or you do with the advice, so they are not in this table.
| Where you work | Automatic, every request | What you get on top |
|---|---|---|
| Claude Code (terminal, VS Code, JetBrains, desktop app's Code tab) | Autopilot clears stale tool output (cold cache only, never more expensive). Hook on every prompt warns the model with the real context size and its largest waste | Install via npm or as a plugin (/plugin marketplace add KushalP1/context-doctor). Status bar context meter, /context-doctor:savings, session, watch, report, dashboard |
| Cursor (agent) | Cursor runs Claude Code's hooks, so the same every-prompt check fires inside Cursor | MCP tools, editor status bar extension, cursor profiler. With your own OpenAI key, autopilot too via a tokened tunnel (how) |
| Codex (ChatGPT app's Codex tab, IDE extension, CLI) | Every-prompt hook with the API's own token counts | MCP tools, skill, session reads Codex rollouts. On an API key, autopilot too (OPENAI_BASE_URL) |
| Your own apps on the Anthropic or OpenAI API | Autopilot on /v1/messages, /v1/chat/completions and /v1/responses (ANTHROPIC_BASE_URL / OPENAI_BASE_URL), or the full optimizing proxy | Exact usage and cache hit rates in /stats, prompt-cache placement advice |
| Claude Desktop chat | Standing context rules in every chat; one cheap profile_context call the model makes past ~30 turns or on any cost question | One-click .mcpb install, context_checkup prompt |
| claude.ai, ChatGPT, the phone apps | Your account's standing preferences (context-doctor instructions --copy) | Profile an exported chat with analyze |
| CI | analyze --fail-over-budget fails a build whose prompts outgrow a budget | .contextdoctorrc budgets and presets |
Not claimed, because no process on your machine sends those requests: trimming inside Claude Desktop chat, claude.ai, ChatGPT, Cursor's own subscription models, or Codex signed in with ChatGPT. Those get the rules and the measurements above, not autopilot.
npx context-doctor savings replays your own recent sessions through autopilot and shows what it would have saved, against what you were actually billed. Install as a Claude Code plugin from inside Claude Code. Ready for the official MCP Registry (io.github.KushalP1/context-doctor), which every release now publishes to; any MCP client can launch it as npx -y context-doctor mcp.accuracy.proxy --token for putting the proxy on a public URL safely. 0.17 Claude Desktop: a profile_context the model can afford to call from chat, .mcpb bundle, standing preferences for web and mobile. 0.16 Codex. 0.15 Cursor.Full history with the measurements behind each change: ROADMAP.md.
No reviews yet β be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/context-doctor)<a href="https://allmcps.com/mcp/context-doctor"><img src="https://allmcps.com/api/badge/context-doctor?style=directory" alt="Context Doctor on AllMCPs" /></a>