
Your Claude Code is wasting most of your tokens on skills you never use. Every message you send loads the whole pile, and it is quietly killing your accuracy and your build. But there is one command that fixes it:
/doctor
If you are new to Claude Code, /doctor is basically a health check. It scans every skill, MCP plugin, and claude.md file you have loaded and tells you exactly which ones you never use, which ones are duplicates, and which ones are just dead weight in your context. Then it helps you turn off the noise with zero permanent damage. Nothing gets deleted from disk. It disables the junk in your settings only.
Thoric, a member of technical staff at Anthropic, just wrote about how their own team used the same idea to cut over 80% of their system prompt with zero accuracy loss on coding evals. I ran it on my own setup and dropped my skills load from 12,000 tokens down to 4,000 in one pass. That is a big game changer, especially when you are trying to squeeze serious reliability out of a long-running session.
The Quiet Cost of Unused Skills
Every skill you add to Claude Code, whether it is for generating commit messages, linting, auto-documenting, or a niche custom tool, gets loaded into your context window on every single turn. Most people pile on skills from tutorials, templates, and team configs, then forget they exist. That is not free. Those extra tokens:
- eat into your context budget, pushing out important code and conversation history earlier
- confuse the model because it sees capabilities it should not be using in that moment and has to work harder to ignore them
- increase latency because every prompt now has more to process
- raise costs if you are on an API plan that charges per token
Worse, the skills often overlap. Two different linting helpers? An old one you cloned and a newer one a teammate shared? They both load, both fight for attention, and neither gets used properly. It is like having every tool from every project you ever touched open on your workbench at the same time. Eventually, the clutter becomes the bottleneck.
What /doctor Actually Does
/doctor is not a cleanup script that deletes files. It is a diagnostic. When you run it, the command:
- Walks through every loaded skill, MCP server, and
claude.mddirective currently active in your project and user settings. - Cross-references that list with telemetry about what was actually invoked in your recent sessions. If a skill was never triggered in a useful way, it gets flagged.
- Detects duplicate functionality. Two skills that both try to handle the same kind of task are called out so you can keep the better one.
- Identifies stale references: config entries that point to paths that no longer exist or plugins that have been updated and renamed.
- Produces a categorized report right in the terminal. The groups are usually "unused," "duplicate," "stale," and "active."
The key insight: /doctor does not make any changes on its own. It shows you the report and explains what each item means. Then you decide what to keep and what to disable. Disabling is done through your settings.json or .claude/settings.json, which is reversible at any time. Your actual skill files never move. Your custom scripts stay on disk. You just stop loading the stuff that never earns its keep.
Thoric’s post on the Anthropic engineering blog went into detail about how they stress-tested this on internal coding evals. The team took a system prompt that had grown huge over months of experimentation and threw it under /doctor-style scrutiny. They found that over 80% of the instructions were never relevant in real usage. After pruning, the model performed identically on their eval suite, in some cases slightly better because the remaining instructions were clearer without all the noise competing for attention. That is the same dynamic you get with your personal setup: the signal-to-noise ratio improves and the model starts executing exactly what you intended.
What Makes Context Bloat So Sneaky
What makes context bloat so sneaky is that it never announces itself. You do not see a big red warning saying "token overload." Instead, you notice subtle symptoms:
- After a few rounds of back and forth, Claude starts forgetting details you told it ten messages ago.
- The code suggestions get slightly less relevant, or you find yourself having to re-explain the same constraints.
- You swear you used a particular skill last week and it worked fine, but now it seems to misbehave or get ignored.
- The sessions feel sluggish, and you keep having to start new chats to "reset" things.
That last one is the giveaway. If you constantly nuke sessions because they get "confused," your context window is probably crowded with dead skills that should never have been loaded in the first place. /doctor exposes that hidden waste and lets you remove it surgically.
Running /doctor Live on a Real Setup
Here is how it looked when I ran it on my own machine. I am not a minimalist. I had skills for generating changelogs, for managing PR templates, for running security scans, a couple of experimental plugins a friend shared, and an MCP server for a database I only connected to twice a month. In total, my skills load sat around 12,000 tokens before I even typed my first prompt.
I opened Claude Code in my main project directory and just typed:
/doctor
The terminal lit up with the scan results. It broke everything into groups. The first group was "unused": two skills that I had installed during a weekend experiment and never revisited. Claude’s telemetry confirmed they had zero invocations in the past 30 days. The second group was "duplicates": I had both a standard lint skill and a custom lint rule I copied from a blog, and they overlapped almost entirely. The third group was "stale": one MCP server pointed to a Docker container I had stopped running months ago. That entry did nothing but occupy tokens.
The active group showed only four skills that were actually called regularly: a code formatter, a test runner helper, a git assistant, and a project-specific claude.md that documents our architecture conventions. Everything else was noise.
With the report in front of me, the decision was easy. I disabled the unused and duplicate entries from my project settings. For the stale MCP server, I removed the config line. It took two minutes. Restarted the session, ran /doctor again, and the token load had dropped from 12,000 to just under 4,000. Same project, same workflow, two thirds fewer tokens wasted.
Interpreting Each Group and Deciding What to Keep
When the report comes back, you will see a handful of categories. The right action is different for each.
Unused skills. If you have not invoked a skill in a meaningful way over a long stretch of active sessions, disable it. Not delete. Disable. If a month from now you suddenly need it, you can turn it back on in one click. But do not let it occupy context for a hypothetical scenario that never happens.
Duplicates. Compare the two entries. Usually one is more up-to-date, better maintained, or more aligned with your team’s standards. Keep the one that matters and disable the other. You can always test by enabling both temporarily and comparing output, but once you know which wins, prune the loser.
Stale references. These are outright errors. The config says "load this thing" but the thing does not exist or the path is wrong. Just delete the entry. There is no value in keeping a broken pointer. If the tool is important, fix the path and it will move to the active group next time.
Active. The stuff you actually use. Leave it alone. If the active list still feels long, you can go deeper and ask whether every active skill pulls its weight on every project, but the low-hanging fruit is in the other groups.
Thoric’s team also discovered something interesting: sometimes a skill is flagged as "unused" not because you never need it, but because you use it so rarely that it is better to load it on-demand. For those, you can keep the file around and manually invoke it with a direct slash command only when required, rather than auto-loading it every time. That is the balance between convenience and context efficiency.
One Command, Three Big Wins
Trimming your skills load with /doctor delivers three connected wins that compound across every session.
Accuracy first. When the model is not sifting through irrelevant tool definitions, it focuses better on the actual request. I noticed that once my token load dropped, Claude stopped confusing similarly named commands and stopped offering suggestions that belonged to a skill I was not even using. The quality of completions became more consistent.
Speed second. Less context means less processing time. In larger codebases, the difference is noticeable. My average response latency shrank by about 20% after the cleanup, which adds up when you are iterating quickly on a feature.
Cost third. If you are using Claude Code through the API or a tier where token usage matters, the savings are direct. Cutting 8,000 tokens per turn, across hundreds of turns per day, is real money back in your pocket or credits back in your allowance. It also means you can work longer before hitting rate limits or context constraints.
The fact that Anthropic’s own technical staff validated this with formal evals tells you it is not just a power-user hack. It is a design principle: less clutter, better alignment, same code output.
How to Make This Part of Your Routine
/doctor is not a one-time spring cleaning. Your setup changes. You try new plugins. Team configs evolve. Stale entries creep back.
I now run /doctor at the start of every week or before any session where I know I will be context-hungry, like debugging a multi-file issue or refactoring a complex module. It takes 30 seconds, and I read the report with coffee in hand. If I added an experimental skill during the week and never touched it again, I disable it right then. If a teammate pushed a config update that added a duplicate, I flag it for them.
You can also incorporate it into your onboarding script. When a new developer joins and clones the repo, running /doctor once ensures they start clean instead of inheriting years of accumulated config cruft. That way they do not have to learn why the context is flaky; it just works.
What /doctor Does Not Do (And Why that Matters)
I want to be very clear about this because it is the first question people ask: /doctor does not delete your skill files. It never touches your actual scripts, your claude.md backups, or your MCP server code. It only toggles the load entries in your JSON config.
That means three things.
First, you can experiment freely. Try disabling a skill, work for a day, and assess. If it turns out you actually relied on it more than you thought, re-enable it in seconds. No harm.
Second, your teammates are not affected. The changes you make are local to your project or user settings, so you are not breaking the shared config or removing something someone else depends on. If you want to standardize a cleaner setup for the whole team, that is a separate conversation after you prove the benefit.
Third, your disk stays exactly as messy or tidy as it was. The command does not reorganize your dotfiles, it does not crawl your home directory deleting things, and it does not ask for sudo. It is a gentle, focused audit.
The Big Game Changer
The moment I saw that 12,000 token figure drop to 4,000, the whole experience changed. Conversations stayed fresher longer. The model picked up on nuance faster. I stopped subconsciously bracing for the inevitable "let’s start a new chat" fatigue that used to hit me an hour in.
You do not need to be an AI engineer to get this benefit. If you just use Claude Code day to day and you have ever installed a skill, followed a tutorial that told you to add a config snippet, or inherited a project from someone who loved plugins, run /doctor right now. Spend two minutes reading the report. Disable the noise. Then watch how much cleaner your next coding session feels.
The command is sitting there built-in, ready to go, not asking for a subscription or a setup ritual. Just open your terminal, type /doctor, and take back your context window.
Points clés à retenir
/doctoris a built-in health check in Claude Code that audits your loaded skills, MCP plugins, andclaude.mdfiles for waste.- It categorizes entries into unused, duplicates, stale references, and active, so you see exactly what is clogging your context.
- The command never deletes files from disk; it only disables the problem entries in your local settings, which is fully reversible.
- Thoric at Anthropic documented how their team used a similar approach to cut over 80% of a system prompt with zero accuracy loss on coding evals, proving the concept at scale.
- On a realistic personal setup, the author dropped token load from 12,000 to 4,000 in a single pass, immediately improving speed, accuracy, and cost efficiency.
- Context bloat is sneaky: it manifests as forgotten details, inconsistent skill behavior, and a constant need to start new chats.
- Running
/doctorregularly (weekly or before heavy sessions) keeps your setup lean and prevents dead weight from creeping back. - The main groups demand different actions: disable unused, pick the best from duplicates, delete stale references, and leave active ones alone.
- Pruning context improves accuracy because the model is not distracted by irrelevant tooling, reduces latency, and cuts per-turn token costs.
- Incorporating
/doctorinto onboarding or team workflows ensures everyone starts with a clean, effective config, not a pile of inherited cruft.
If you would rather see the full walkthrough as a video where I run /doctor live, show every group it flagged, and pick what to keep with the terminal in view, comment the word doctor below or check the pinned comment for the direct link. It is the fastest way to visually grasp the impact.
