Skip to content
Blog
Claude CodeAITutorial

Claude Code sends more than you use. Here's how to trim it

Every message you send, Claude Code also ships tool definitions, skills and instructions for features you may never touch. A few lines in settings.json clear out the extras and free up context on every turn.

Kevin Defalco5 min read

I use Claude Code every day, and until recently I’d never stopped to think about what actually gets sent when I type a message. Turns out my message is the least of it. Before it come the system instructions, the definition of every tool Claude has access to, and a catalogue of skills. All of that goes out again on every turn, even though I never touch half of those tools.

I started digging after reading an article by Matt Pocock on the subject.1 I tried his steps, checked them against the official docs (a few things have changed since), and this is where I ended up.

What does it actually cost?

Less than I expected, honestly. Claude Code uses prompt caching: since the start of each request is the same as the last one, the API doesn’t process it again, it reads it from a cache.2 Cache reads are cheap, about 10% of the normal input price on most models, and 5% on Opus 5.5 and Sonnet 5.5.3

So is it worth touching anything? I think so. All of it takes up room in the context window that could go to code. The model has to read through it before it gets to what I asked. The cache expires if I step away for a while, switch models or Claude Code updates, and then the whole thing gets paid for in full again, with a surcharge on top.2 And since I’m on a subscription, it all counts against my usage limits.

1. See how much room it takes with /context

Start by measuring. Type /context in any session and you’ll see how your context is split up: system prompt, system tools, MCP tools, memory files, messages. Each one with its token count.

Write the numbers down before you change anything so you have something to compare against later.

The downside is that every tool gets added up into a single line, so you can’t tell which one is the heaviest.

2. If you want the details, use a proxy

That’s what Pocock’s little Node proxy is for.4 It sits between Claude Code and the API, passes everything through as-is, saves each request to a Markdown file and shows you a ranking of tools by size. You start it like this:

node proxy.mjs

Then, in another terminal, open Claude Code pointed at it:

ANTHROPIC_BASE_URL=http://localhost:8787 claude

If you’re on Windows with PowerShell, it’s $env:ANTHROPIC_BASE_URL="http://localhost:8787"; claude.

A couple of things I kept in mind. First, read the code before you run it: a proxy like this sees everything you send, your token included. Luckily it’s one file with no dependencies, so it takes five minutes to go through. Second, the numbers it gives you will be higher than usual. With a custom ANTHROPIC_BASE_URL, Claude Code turns off tool search and loads every tool upfront.2 In a normal session, MCP tools wait on the sidelines and their schemas only load when they’re needed. So I used it to find out what is heavy, not to work out how much I’m spending.

3. Turn off what you don’t use

Some features come with a whole bundle of tools and instructions, and you can switch them off with a single line. All of this goes in ~/.claude/settings.json if you want it for every project, or .claude/settings.json for just one.

These are the ones I turned off:

  • disableWorkflows: removes dynamic workflows, which means the Workflow tool, /workflows, /deep-research and ultracode. You can also turn it off from /config.5
  • disableBundledSkills: removes the skills Claude Code ships with. /doctor still works.6
  • disableRemoteControl: turns off Remote Control.
  • disableClaudeAiConnectors: stops it from pulling in the connectors from my claude.ai account.
  • "enableArtifact": false: turns off the Artifact tool. The original article uses disableArtifact, but that option is now listed as deprecated.7

4. Remove tools one at a time

For individual tools there’s permissions.deny. If you put just the tool’s name, Claude Code takes it out of the context and the model simply doesn’t know it exists.8

{
  "permissions": {
    "deny": ["NotebookEdit", "CronCreate"]
  }
}

There’s a detail here that took me a moment to get. Writing "NotebookEdit" removes the tool. But if you write a more specific rule, like "Bash(rm *)", the tool stays and only those calls get blocked. To make the request smaller, it has to be the bare name.

Skills work in a similar way. disableBundledSkills turns them all off, but if you want to keep a few you can use skillOverrides and choose what Claude sees for each one:6 everything ("on"), just the name ("name-only"), nothing but you can still call it with / ("user-invocable-only"), or nothing at all ("off"). You don’t need to write it by hand: the /skills menu sets it up for you, and /skill-doctor tells you how much room each one takes and how often you use it.

5. My setup

This is what my ~/.claude/settings.json looks like now:

{
  "permissions": {
    "deny": [
      "EnterPlanMode",
      "ExitPlanMode",
      "NotebookEdit",
      "CronCreate",
      "CronDelete",
      "CronList",
      "RemoteTrigger",
      "PushNotification",
      "ScheduleWakeup"
    ]
  },
  "disableBundledSkills": true,
  "disableWorkflows": true,
  "disableRemoteControl": true,
  "disableClaudeAiConnectors": true,
  "enableArtifact": false
}

Don’t just copy it without thinking it through. I removed plan mode (EnterPlanMode and ExitPlanMode) because I don’t use it; I’d rather talk the plan through in the conversation. If it works for you, keep it. Same goes for NotebookEdit: I don’t work with notebooks, but if you use Jupyter you’ll want it.

I kept AskUserQuestion, even though Pocock removes it, because I like Claude to check with me when there’s a decision to make. And I didn’t touch the task or worktree tools, since background jobs and multi-agent runs depend on them.

One last tip: make these changes between sessions rather than in the middle of one, because adding or removing rules while you work can invalidate the cache.2

6. Measure again

Close Claude Code, open it again so it reads the new settings, and run /context one more time. The tools and the total should both be lower.

That difference is what you stop sending with every message. More room for your code, and less for the model to read before it gets to what you asked.

Sources

  1. Matt Pocock, AI Hero — How To Kill The Bloat In Claude Code’s System Prompt. ↩

  2. Claude Code docs — How Claude Code uses prompt caching. ↩ ↩2 ↩3 ↩4

  3. Claude API docs — Prompt caching. ↩

  4. Matt Pocock — proxy.mjs (GitHub Gist). ↩

  5. Claude Code docs — Dynamic workflows. ↩

  6. Claude Code docs — Skills. ↩ ↩2

  7. Claude Code docs — Settings reference. ↩

  8. Claude Code docs — Configure permissions. ↩