My Claude Code plugins loaded in every project. In most of them that cost 7.8k tokens per request.
A few days ago I wrote about measuring what my Claude Code setup costs on every request. The fix there was simple: find the plugins and skills you never use and turn them off. But that only catches things you never use.
A few days ago I wrote about measuring what my Claude Code setup costs on every request. The fix there was simple: find the plugins and skills you never use and turn them off.
But that only catches things you never use. The bigger waste in my setup turned out to be things I use all the time, just not everywhere.
The problem
Plugins, skills and MCP servers in your user settings load in every project. Every one of them adds its skill listings, tool names and hook output to every request, before you type a word.
I have a web framework plugin I use in my three web projects. It costs about 5.4k tokens per request. I also have nine other projects: a Rust CLI, a server, some scripts. That plugin loaded in all of them, on every request, and was never used there once.
Same story for a workflow plugin I only use in one project, and a few personal skills.
Measuring it per project
Claude Code writes a transcript for every session, and each one records the folder it ran in. So you can count, per project, which plugins and skills were actually used.
On my machine, over the last 30 days:
- 12 projects with sessions
- 6 plugins and skills used in only one to three of them
- ~7.8k tokens per request spent on them in every other project
My setup carries about 68k tokens per request in total, so that's roughly 11% of every request in most of my projects, for nothing.
The fix: deadweight scope
deadweight 0.5 adds a scope command. It turns each of those off in your user settings and back on in .claude/settings.local.json of the projects that used it. Claude Code reads the project's local settings over your user settings, so nothing changes where you use them.
$ deadweight scope --dry-run
Load these only in the projects that use them
off in ~/.claude/settings.json, on in each project's .claude/settings.local.json
plugin frontend-kit ~5.4k saved in 9 projects (19 of 49 sessions)
on /home/me/code/shop
on /home/me/code/landing
plugin workflow-kit ~1.2k saved in 11 projects (45 of 49 sessions)
on /home/me/code/api
Saves ~6.6k tokens per request in the projects that never use them. Undo any time with deadweight undo.
(Names changed; the numbers are the shape of my real run.)
A few things I was careful about:
-
Hooks. Some plugins run hooks on every edit or shell command. Those may matter in every project, so
scopeleaves them alone unless you pass--include-hooked. Plugins whose hooks only add context at session start are fine to scope. -
Same folder, different spellings. On Windows my transcripts recorded one project as
C:/Users/.../app,/c/Users/.../app(Git Bash) anddesktop/appvsDesktop/app. Counted naively, a plugin would get turned off in the very project that uses it. deadweight treats them as one. -
Git. A
settings.local.jsonthatscopecreates is kept out of your commits, the way Claude Code does for the ones it creates. -
Undo. Everything is backed up first.
deadweight undoputs it all back, including any project files it created.
If you start using a scoped plugin in a new project, turn it on there with claude plugin enable <name> --scope local.
Try it
cargo install deadweight
deadweight # the audit now shows what's used in only a few projects
deadweight scope # asks before changing anything
It's a single Rust binary, MIT licensed, reads only local files and makes no network requests. Binaries for macOS, Linux and Windows are on the releases page.
I'm curious what other setups look like. If you run it, I'd like to hear how much yours carries in the projects that don't need it.
Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.