AI Engineering

Stop Burning Tokens in Claude Code: Measure, Cut, and Keep What Matters

Every Claude Code request ships 25,000+ tokens before your prompt reaches the model. A proxy reveals exactly what is being sent — and permissions.deny cuts it to 8,000 tokens without losing any capability.

Stop Burning Tokens in Claude Code: Measure, Cut, and Keep What Matters

Every time Claude Code sends a request to the Anthropic API, you have no idea what is inside it. Not the size. Not which tools are being shipped. Not how many tokens are consumed before your actual prompt even starts. You are guessing — and the guess is almost always wrong.

The default setup ships somewhere between 25,000 and 108,000 tokens on every request, depending on how many MCP servers you have connected. Most of it is tool schemas — sent in full, on every single call, whether the current task needs them or not.

This article walks through how to measure exactly what is being sent, and how to cut it — without breaking your workflow or permanently disabling anything.

The Problem: No Visibility

Claude Code is a client. The Anthropic API is the upstream. Between the two, there is a gap — and by default, you have zero visibility into what crosses it.

You type a prompt. Something gets sent. You get an answer back. But what traveled in that request? You do not know. There is no native dashboard, no token counter, no way to inspect the payload without adding something to the middle of that connection.

No idea what's being sent in here — and that's the problem.

Until you measure it, you cannot optimize it. And because these costs compound across an entire session — every LLM call in the loop, every tool use, every follow-up — the invisible overhead adds up fast.

The Fix: Put a Proxy in the Middle

The solution is an LLM observability proxy — a lightweight interceptor that sits between Claude Code and the Anthropic API.

CLIENT
Claude Code
your terminal session
→
THE ADDITION
LLM Proxy
reads everything · changes nothing
→
UPSTREAM
Anthropic API
unchanged · unaware

response passed back unchanged ↩

The proxy forwards every request to the API exactly as-is. The response comes back exactly as-is. The upstream API is completely unaware. But now every request is recorded — and you can finally see what is inside it.

What You Find

Four things appear on every request that most people have never seen:

  • System context — The prompt and project context shipped ahead of your actual question. Your CLAUDE.md files, memory files, injected instructions — all of it, prepended before your words reach the model.
  • Tool definitions — Every built-in tool's full schema, re-sent on every turn, used or not. Read, Edit, Write, Glob, Grep, Bash, Artifact, ReportFindings, NotebookEdit, CronCreate, and more. Each one is fully described, typed, and documented inside the request.
  • MCP tools — Every connected server's tool schemas, whether this task needs them or not. If you have Semrush, Higgsfield, Stripe, and a Files server connected, all of their schemas travel along on every single request — including requests that have nothing to do with any of them.
  • Real token counts — Input, output, and cache reads, measured per request. Not estimated. Not projected. The actual number.

The number you see when all four MCP servers are connected is around 108,000 tokens per request. Most of it is schemas for tools the current task will never call.

How to Cut It

The mechanism is permissions.deny in your Claude Code settings.json. Any tool on the deny list is removed entirely from the system prompt — its schema does not travel. The tool is not deleted. It is not gone permanently. It can be removed from the deny list the moment you need it again.

Measure first, then switch off what this task doesn't need — and switch it back on when it does.

Keep — Normal Coding Session

These tools are used in almost every coding task. Keep them enabled:

Tool What it does
Read Reads a file's contents
Edit Makes a targeted change to a file
Write Creates or overwrites a file
Glob Finds files by pattern
Grep Searches file contents
Bash Runs shell commands
PowerShell Runs shell commands on Windows

Keep — Depending on How You Work

Keep these if your workflow uses them regularly. Disable if it does not:

Tool What it does
WebSearch Searches the web
WebFetch Reads a URL's content
Agent Spins up a subagent for a task
Skill Runs a packaged workflow
AskUserQuestion Asks you a multiple-choice question

Disable — Not Used in Standard Sessions

These tools carry schemas but are rarely or never needed for typical coding work. Every one removed drops its full schema from the system prompt on every request:

Tool What it does
✕Artifact Publishes a shareable page
✕ReportFindings Reports code-review findings
✕NotebookEdit Edits a Jupyter notebook cell
✕CronCreate Schedules a cron task
✕ScheduleWakeup Schedules the next loop wake-up
✕DesignSync Design-tool bridge
✕RemoteTrigger Fires a remote-triggered run
✕Monitor Waits on a condition, then resumes
✕SendMessage Messages another agent session
✕PushNotification Sends a push notification
✕EnterWorktree Switches into a git worktree
✕ExitWorktree Leaves a git worktree
✕ListAgents Lists other reachable agents
✕CronDelete Deletes a cron task
✕CronList Lists scheduled cron tasks
✕EnterPlanMode Switches into plan mode
✕ExitPlanMode Exits plan mode

Add the deny list to your settings.json:

{
  "permissions": {
    "deny": [
      "Artifact", "ReportFindings", "NotebookEdit",
      "CronCreate", "CronDelete", "CronList",
      "ScheduleWakeup", "DesignSync", "RemoteTrigger",
      "Monitor", "SendMessage", "PushNotification",
      "EnterWorktree", "ExitWorktree", "ListAgents",
      "EnterPlanMode", "ExitPlanMode"
    ]
  }
}
Tools you don't use can be disabled — every one removed drops its full schema from the system prompt.

The Result: 25K Down to 8K

After applying the deny list, here is what the built-in tool section of the request looks like before and after:

Before default setup · all tools enabled
≈ 25,000
After permissions.deny applied
≈ 8,000
−17,000 tokens saved, on every single request

That is 8,000 tokens — 32% of what was being sent before — and the workflow is identical. The same tasks complete. The same files get read and edited. Nothing broke.

Add MCP servers to the equation and the gap is even wider. With Semrush, Higgsfield, Stripe, and a Files server all connected, the total per-request cost reaches around 108,000 tokens. Disconnecting the servers not needed for the current task collapses that back to the 8,000 baseline.

In a session of 50 requests at 25,000 tokens each, that is 850,000 tokens saved just from tool schemas. Before the first token of useful output.

Fewer tools competing for the model's attention — point the proxy at your own setup, and see what's left to cut.

Key Takeaway

The workflow is three steps:

  1. Put the proxy in place. Route Claude Code through an LLM observability proxy to intercept every request to the Anthropic API.
  2. Measure what is being sent. Look at the system context, tool definitions, MCP schemas, and real token counts on a normal request.
  3. Disable what this task does not need. Add unused tools to permissions.deny. Switch them back when the task changes.

You are not removing capability. You are removing schema definitions from requests where those capabilities are never going to be called. The tools remain installed. They re-enable in seconds.

This applies to every developer running Claude Code — not just high-volume teams, not just production pipelines. On your own machine, on your own sessions, starting today.

Resources