context-diet
Measure the tool definitions, skill catalogue, and feature instructions included in the current Claude Code configuration, then trim unused capabilities. Payload size is not billing: report cached input, uncached input, and output separately when available, and do not infer cost savings from raw token reductions.
Method adapted from aihero.dev, "How to kill the bloat in Claude Code's system prompt." Bare-name versus scoped deny behavior is documented in the official Agent SDK permissions guide.
The idea in one line
A bare tool name in permissions.deny (e.g. "NotebookEdit") removes the tool's
definition from the payload. A scoped rule (e.g. "Skill(dataviz)") only blocks
the call but keeps the definition. To shrink tokens, deny bare names and flip disable* flags.
Measure — record the baseline first
/contextin a session prints the system / tools / MCP / memory / message token split. Write those numbers down; they are the only "before" you get. It reports one combined "tools" number, not a per-tool ranking.- For a per-tool ranking, run the logging proxy:
Each request is logged tonode proxy.mjs # repo root; :8787 → api.anthropic.com ANTHROPIC_BASE_URL=http://localhost:8787 claude # in another terminal./logs/*.mdand a ranked tool-size table prints live. If port 8787 is already taken (e.g. an existing token proxy), usePORT=9000 node proxy.mjsand pointANTHROPIC_BASE_URLat the same port.
Apply the diet
Paths below are relative to the skill directory skills/context-diet, so run there —
except --project, which writes .claude/settings.json into the current directory:
run that one from your project root and give the script's full path.
node scripts/apply-config.mjs # merge into ~/.claude/settings.json (global)
node scripts/apply-config.mjs --project # into ./.claude/settings.json (this project)
node scripts/apply-config.mjs --dry-run # preview, write nothing
Inspect the current settings and preview with --dry-run first. Choose only capabilities the user does not need and preserve unrelated configuration. The script backs up the target, appends deduplicated deny rules, and sets disable flags; use --template templates/settings.conservative.json for the smaller subset. A template is a menu, not permission to disable everything it contains.
Done when Claude Code has been restarted, /context shows the measured before/after difference, and representative retained workflows still work. A lower count alone does not prove a successful configuration change.
What the config does
permissions.deny: [bare tool names]— drops those tool definitions from every request.disableBundledSkills— drops all Anthropic-bundled skills at once. Your own~/.claude/skillsand plugin skills stay; bundled slash commands stay typable.disableWorkflows— drops the multi-agentWorkflowtool (typically the single largest line in the table).disableRemoteControl,disableClaudeAiConnectors,disableArtifact— drop those feature surfaces and their instructions.- Trim skills selectively instead of all-or-nothing:
skillOverrides→"off"or"user-invocable-only"per skill.
Menu, not prescription
Keep anything you use. Denying EnterPlanMode/ExitPlanMode removes plan mode;
AskUserQuestion removes clarifying questions; NotebookEdit breaks notebook edits;
SendMessage/ScheduleWakeup are used by multi-agent and /loop runs. Read
REFERENCE.md at the repo root before denying anything on that list — it carries the
full 6-step method and the per-item cost table.
Templates
templates/settings.aggressive.json— the full menu, biggest savings.templates/settings.conservative.json— keeps plan mode + AskUserQuestion + bundled skills.