Claude Code · per-request token ledger

Put your context
on a diet.

Every request ships tool definitions, a bundled-skills catalogue and feature instructions you may never use — tens of thousands of tokens per turn, billed every turn, that the model wades through before reaching your actual problem. Measure the fat. Then cut it.

system-prompt payload measured via /context
Stock config 52,300 tokens / turn
On the diet 30,900 tokens / turn
trimmed 21,400 tokens of machinery per request illustrative — your numbers come from /context
01

The whole trick, in one rule

Not every deny rule saves tokens. The difference is whether the tool's definition still ships in the payload.

bare name "deny": ["NotebookEdit"]

A bare tool name removes the tool's entire definition from every request. The schema, the description, the examples — gone from the payload.

✓ blocks the call & shrinks the tokens
scoped rule "deny": ["Skill(dataviz)"]

A scoped rule only blocks the call. The definition still rides along in the system prompt, still counted, still read — you pay for it anyway.

– blocks the call, but keeps the weight
02

Cross the fat off the receipt

Run the logging proxy and every tool prints with its byte weight, ranked. Then you deny by name — the biggest line items first.

tool definition~tokens · status
Workflow~4,200removed
bundled skills catalogue~6,800removed
Artifact~1,300removed
Cron·Create / Delete / List~1,500removed
DesignSync · RemoteTrigger~2,100removed
Read · Edit · Bash · Grepcorekept
Task · Agentcorekept
payload after the diet↓ lighter

Weights are illustrative. The proxy (proxy.mjs) writes a real ranked table to ./logs from your own sessions.

03

Six steps, measured both ways

Never cut blind. Weigh before, weigh after — the method adapted from aihero.dev, packaged as a runnable skill.

1

Weigh in

Run /context. Record the system / tools / MCP / memory split.

2

Find the fat

Run proxy.mjs to rank every tool by byte size — no guessing.

3

Drop features

One disable* flag removes a whole feature and its bundled tools.

4

Deny tools

Bare names in permissions.deny strip individual definitions.

5

Apply

apply-config.mjs merges into settings.json — backed up, idempotent.

6

Weigh out

Restart, run /context again, confirm the drop.

04

A menu, not a prescription

Keep anything you use. Two templates ship with the skill — go aggressive, or stay safe and keep plan mode and clarifying questions.

templates/settings.aggressive.jsonmax cut
{
  "permissions": { "deny": [
    "EnterPlanMode", "ExitPlanMode",
    "NotebookEdit", "AskUserQuestion",
    "DesignSync", "SendMessage",
    "RemoteTrigger", "ReportFindings",
    "ScheduleWakeup", "PushNotification",
    "CronCreate", "CronDelete", "CronList"
  ] },
  "disableBundledSkills": true,
  "disableWorkflows": true,
  "disableRemoteControl": true,
  "disableClaudeAiConnectors": true,
  "disableArtifact": true
}
templates/settings.conservative.jsonkeeps plan mode
{
  "permissions": { "deny": [
    "DesignSync", "PushNotification",
    "RemoteTrigger", "ScheduleWakeup",
    "CronCreate", "CronDelete", "CronList"
  ] },
  "disableWorkflows": true,
  "disableRemoteControl": true,
  "disableClaudeAiConnectors": true,
  "disableArtifact": true
  // plan mode + AskUserQuestion + skills stay
}
# merge into ~/.claude/settings.json — backs up first, dedupes, idempotent
$ node scripts/apply-config.mjs
$ node scripts/apply-config.mjs --project # this project only
$ node scripts/apply-config.mjs --dry-run # preview, write nothing
05

What's in the box

A self-contained skill — dependency-free Node, no API keys, no build.

SKILL.mdThe skill — method, quick start, the menu.
REFERENCE.mdFull 6-step method plus a per-tool cost/benefit table: what each deny entry actually costs you.
proxy.mjsLogging proxy that forwards to the real API untouched and prints a ranked tool-size table. Node built-ins only.
scripts/apply-config.mjsDeterministic settings merge — backup, dedupe, preserve order. Global or per-project.
templates/Aggressive (max cut) and conservative (safe) settings templates.
$ git clone https://github.com/cskwork/context-diet-skill.git
$ cp -r context-diet-skill ~/.claude/skills/context-diet
# then, in Claude Code: /context-diet