Claude Code Was Billing Tens of Thousands of Hidden Tokens Per Turn
Matt Pocock's method: run /context, rank tool payloads, then trim settings.json with disable flags and bare tool-name denies so unused definitions stop riding every message.
Every Claude Code message carries invisible weight: tool definitions, skill catalogs, system instructions for features you never touch. Easy to ignore. Hard to ignore once you see tens of thousands of tokens charged every turn.
TypeScript educator Matt Pocock published a practical way to measure and cut that overhead. (source)
/context shows the hidden bill
In a session, /context breaks window usage into categories:
- system prompt
- tools (usually the largest bucket)
- MCP tool definitions
- memory (
CLAUDE.mdand rules)
Unused tools still ship their full schemas every turn. /context alone does not rank individual tools by size; a small logging proxy (proxy.mjs) can surface per-tool byte ranking when you need the long tail.
Two settings.json levers remove most of it
Disable flags turn off whole feature bundles:
disableBundledSkills— drops bundled skills such as dataviz, review, initdisableWorkflows— removes the Workflow tool (often the single biggest tool)disableRemoteControl— drops remote-control tools
permissions.deny removes specific tools by bare name:
EnterPlanMode,ExitPlanModeif you do not use plan modeDesignSyncif you do not use design toolsNotebookEditif you never touch notebooksSendMessage,PushNotificationif you do not want notification toolsCronCreateif you do not schedule work
Put these in ~/.claude/settings.json (global) or .claude/settings.json (project).
One deny trap
A bare name like "NotebookEdit" strips the tool definition from the payload. A scoped rule like "Bash(rm *)" only blocks invocation and still sends the definition. If the goal is tokens, deny by name only.
Do not disable tools you actually use. Keep plan-mode tools if you live in plan mode; keep notebook tools if you edit notebooks.
Optimize the system surface before the code
Restart Claude Code, run /context again, and confirm tool count and total tokens dropped. That delta is what you save every turn.
Long sessions already squeeze the window. Clean settings.json before you micro-optimize application code. It takes about a minute.
Join the newsletter
Get insights on the latest AI.