Jul 13, 2026 · 6 min · Engineering

Why Claude Code Sends 33k Tokens Before Your Prompt (And What to Do)

Why Claude Code Sends 33k Tokens Before Your Prompt (And What to Do)

You open a fresh Claude Code session, type a two-word question, and your first API call already reports 33,000 input tokens. You haven’t pasted a file. You haven’t shared a stack trace. You said “hi.” Where did all that come from?

This isn’t a bug, and it isn’t billing weirdness. It’s the fixed cost of standing up an agent that can actually do things in your repo. Let’s break down exactly where those tokens go, compare against leaner tools, and — more usefully — look at the levers you actually control.

Understanding Claude Code token usage overhead

Every agentic coding tool front-loads context before it ever sees your prompt. The model needs to know who it is, what tools it can call, and what environment it’s operating in. Claude Code sits at the heavier end of this spectrum. A cold start commonly lands around 33k tokens of preamble; a minimal alternative like OpenCode reports something closer to 7k.

That gap is real, but it’s not a quality ranking. It’s a design choice. The 33k buys richer built-in tooling and more reliable agentic behavior; the 7k buys a smaller footprint and cheaper cold starts. Neither is “correct” — they’re different points on a capability-versus-cost curve.

Here’s the rough breakdown of where Claude Code’s startup budget goes. Exact numbers shift between versions, so treat these as proportions, not fixed constants:

ComponentApprox. tokensWhat it is
System prompt~3k–5kAgent identity, behavior rules, formatting policy
Tool definitions~15k–20kJSON schemas for every enabled tool + MCP servers
Environment context~2k–4kWorking dir, git status, OS, directory listing
CLAUDE.md / project memory0–10k+Your project instructions (fully under your control)

The single largest bucket is almost always tool definitions. This surprises people who expect the system prompt to dominate.

Why tool schemas are so heavy

Each tool the model can call ships as a structured schema — name, description, and a full JSON Schema for its parameters. A single well-documented tool can run 500–1,500 tokens once you count nested parameter descriptions and enums. Claude Code enables a broad default set (file read/write, edit, bash, glob, grep, web fetch, task/agent spawning, todo tracking, and more), and every one of them is present on every request.

A trimmed-down schema for one tool looks roughly like this:

{
  "name": "edit_file",
  "description": "Make a targeted edit to an existing file. Use this instead of rewriting the whole file when possible...",
  "input_schema": {
    "type": "object",
    "properties": {
      "path": { "type": "string", "description": "Absolute path to the file" },
      "old_string": { "type": "string", "description": "Exact text to replace, including surrounding context for uniqueness" },
      "new_string": { "type": "string", "description": "Replacement text" }
    },
    "required": ["path", "old_string", "new_string"]
  }
}

Multiply that by a dozen-plus tools, then add every tool exposed by any MCP server you’ve connected, and the schema payload balloons fast. A common gotcha: someone installs three MCP servers “to try them out,” each exposing 8–15 tools, and their baseline jumps by 10k tokens they never think about again.

The environment context you didn’t ask for

When Claude Code boots inside a repo, it injects situational awareness so the agent doesn’t have to burn a turn asking basic questions. In practice this includes things like:

Working directory: /home/ryan/projects/api-gateway
Platform: linux
Git branch: feature/rate-limiting
Git status: 4 modified, 1 untracked
Recent commits: ...

This is genuinely useful — it’s why the agent already knows you’re on a feature branch — but it’s tokens all the same, and in a large monorepo the directory snapshot can be non-trivial.

What the overhead actually buys you

Before you optimize this away, be honest about the trade-off. That 33k is why Claude Code can, on its very first response, edit the right file with the right surrounding context, run your tests, spawn a subagent for a parallel task, and respect your project conventions — all without a round of clarifying questions. A 7k-token agent often has to earn that context through extra turns, which means more requests, more latency, and sometimes more total tokens across a full session.

So the comparison isn’t “33k wasteful vs 7k efficient.” It’s:

For a five-message debugging session, the fixed overhead amortizes well. For a fire-and-forget one-liner, it feels wasteful. Both reactions are correct in context.

The levers you actually control

You can’t rewrite Claude Code’s core tool set, but three knobs meaningfully move your baseline.

1. Trim CLAUDE.md ruthlessly

CLAUDE.md is injected in full on every request. It’s the one part of the preamble that’s 100% yours, and it’s where I see the most waste — 4k-token files full of aspirational style guides the model already follows by default.

Keep it tight and load-bearing. Prefer:

# Project: api-gateway

- Package manager: pnpm (never npm)
- Tests: `pnpm test` — must pass before any commit
- Do NOT edit files in /generated
- API errors use the AppError class in src/errors.ts

Delete anything the model would do anyway (“write clean code,” “add comments”). A good rule of thumb: if removing a line wouldn’t change the agent’s behavior, it’s costing you tokens for nothing. For deep context, put it in a referenced file the agent reads on demand rather than pasting it into memory.

2. Disable unused MCP servers and tools

This is the highest-leverage move for most people. Audit what’s actually connected:

claude mcp list

If you see servers you added months ago and never use, remove them:

claude mcp remove some-unused-server

You can also scope which tools are permitted, keeping schemas out of context. In your project or user settings:

{
  "permissions": {
    "allow": ["Read", "Edit", "Bash", "Grep", "Glob"],
    "deny": ["WebFetch"]
  }
}

Every tool you keep off the table is a schema you’re not paying to send on every turn. In practice, disabling one chatty MCP server has saved me more tokens than any prompt tweak.

3. Lean hard on prompt caching

This is the big one, and it changes the entire calculation. The system prompt, tool definitions, and stable project context are the same on every request within a session — which makes them ideal for prompt caching. Cached input tokens are dramatically cheaper than fresh ones, so that 33k preamble mostly stops mattering after the first call.

Claude Code uses caching automatically, but you can help it by keeping the stable part of your context actually stable:

The practical upshot: optimize your first request’s token count for cost, but optimize your session for cache hits. A stable 33k prefix that caches cleanly is often cheaper over a real work session than a 7k prefix that never caches because it’s rebuilt each turn.

If you’re running high-volume agentic workloads and watching the per-token math closely, this is also where cheaper API access — the kind AI Prime Tech offers for Claude models — compounds nicely with good caching hygiene.

Practical takeaways

RW
Ryan Walsh · Developer Tools & Claude Code

Ryan lives in the terminal with Claude Code and follows the Anthropic developer ecosystem closely — MCP servers, subagents, hooks, skills, and the coding-agent workflows developers actually ship with.

Get cheaper Claude API access

One API key for Claude Opus 4.8, Sonnet 4.6, Haiku 4.5, Fable 5, plus GPT & Gemini — up to 80% off official pricing, pay-as-you-go.

Get Your API Key →
AI Prime Tech is an independent third-party API gateway. Claude™ and Anthropic® are trademarks of Anthropic, PBC. No affiliation or endorsement is implied.