# Claude Code cost: what it costs and how to use fewer tokens

Claude Code is paid either through a Claude plan (Pro, Max, Team or Enterprise), where use counts against the plan's limits, or per token with an API key. Anthropic puts the average at about $13 per developer per active working day on enterprise accounts. Every message re-sends the whole conversation, so the biggest savings come from /clear between tasks, choosing the right model and keeping CLAUDE.md short.

- Page: https://tecyfy.com/coding-agents/claude-code/costs
- Guide: Claude Code (https://tecyfy.com/coding-agents/claude-code), from Anthropic's documentation (https://code.claude.com/docs/en/overview)

Claude Code is paid for in one of 2 ways. On a **Claude plan** (Pro, Max, Team or Enterprise), it is included and your use counts against the plan's limits, which reset over time. With an **API key**, from the Claude Console or a cloud provider, you pay for every token at the model's price.

How much that comes to varies widely with the model, the size of your code and how you work. Across enterprise deployments, Anthropic reports an average of about $13 per developer per active day, or $150 to $250 a month, with 90% of users under $30 per active day. For what each model costs per token, see [the price list](/prices), and to estimate a run, the [agent cost calculator](/prices/agent-cost).

## Check what you are using

```text
/usage
```

On a plan, `/usage` shows how much of your limits you have used, and a breakdown of what used it: skills, subagents, plugins and each MCP server. It also flags habits, such as long context or cache misses, that account for 10% or more of recent use.

With an API key, its **Session** block shows the tokens and an estimated cost for this session, split by model, and a line on how much of the input came from the prompt cache.

## Why a long session costs more and more

The model remembers nothing between messages. Each time you send one, Claude Code sends the whole conversation again: the system prompt, your [CLAUDE.md](/coding-agents/claude-code/project-instructions), every earlier message, every file Claude read and every command's output. When Claude uses tools, each round of results is another request carrying all of that.

So a short question asked 3 hours into a session is not a short request. It carries everything before it. That is the most important thing to know about the cost of Claude Code.

## The prompt cache, and what breaks it

The prompt cache softens this. When a request starts the same way as one sent recently, the repeated part is read from the cache at a much lower price, and only the new part is processed in full. Claude Code orders each request so the parts that rarely change come first: the system prompt and tools, then your project context, then the conversation.

The match must be exact, so these make the next message re-read the whole conversation at the full price:

- Switching model, since each model has its own cache
- Changing the effort level, on most models
- Turning fast mode on or off
- Connecting or removing an MCP server, or turning a plugin on or off
- Compacting the conversation, which itself reads everything it summarises
- A long break: the cache lasts an hour on a plan and 5 minutes by default with an API key

Choose the model and effort at the start of a task, and make these changes between tasks rather than in the middle of one.

## Habits that cut use the most

**Clear between tasks.** `/clear` starts a fresh conversation. An unrelated earlier task is dead weight on every later message. Use `/rename` first if you may want it back with `/resume`. [Sessions](/coding-agents/claude-code/sessions) has more.

**Match the model to the job.** Sonnet handles most coding and costs less than Opus; Haiku is cheaper still for simple jobs. Keep Opus for hard design and debugging. [Models and effort](/coding-agents/claude-code/models) covers how to switch.

**Lower the effort for easy work.** Thinking is billed as output tokens. For a rename or a quick question, `/effort low` costs less.

**Be specific.** "Improve this codebase" sends Claude reading broadly. "Add input checks to the login function in auth.ts" lets it go straight there. For a large change, plan first in plan mode (Shift+Tab), so a wrong direction is caught before code is written, and press Esc as soon as Claude heads the wrong way.

**Keep CLAUDE.md short.** It is sent with every message. Move procedures, such as how to release or review, into [skills](/coding-agents/claude-code/skills), which load only when used.

**Send noisy work to a subagent.** Running a test suite or reading logs in a [subagent](/coding-agents/claude-code/subagents) keeps the output in its own context; only a summary comes back. Its requests still count, so give it a cheaper model.

**Shrink what tools return.** A [hook](/coding-agents/claude-code/hooks) can cut a test run down to its failures before Claude sees it, and a command-line tool such as `gh` adds nothing to context until it is used, unlike an MCP server's list of tools. Turn off servers you are not using in `/mcp`, and check `/context` to see what is taking space.

**Tell compaction what to keep.** `/compact keep the failing test names and the files changed` gives a shorter, more useful summary than letting it guess.

## Small background costs

Claude Code makes a few requests of its own, such as summarising past conversations for `/resume`. Anthropic puts these at typically under $0.04 a session.

## For teams

On Team and Enterprise plans, each member's use draws on their seat's allowance, and admins can turn on usage credits with spend limits per organization, group or person. API organizations set spend limits on the Claude Code workspace in the Claude Console, and teams on Amazon Bedrock, Google Cloud or Microsoft Foundry use their cloud's own budgets. Every setup can export use and cost per person with OpenTelemetry.

## Questions

### How much does Claude Code cost?

On a Claude plan, Claude Code is included and counts against the plan's usage limits. With an API key you pay per token. Across enterprise deployments Anthropic reports an average of about $13 per developer per active day and $150 to $250 a month, with 90% of users under $30 per active day; your own figure depends on the model, the size of the code and how you work.

### How do I see how much I have used in Claude Code?

Run /usage. On a plan it shows how much of your limits you have used and what used it, such as skills, subagents or MCP servers. With an API key its Session block shows the tokens and an estimated cost for the session, by model.

### Why does Claude Code use more as the session goes on?

Every message sends the whole conversation so far, including every file read and command output. A one-line question late in a long session carries all of that with it. Use /clear when you switch to unrelated work.

### What is the cheapest way to use Claude Code?

Start a fresh conversation for each task, use Sonnet for everyday work and Haiku for simple jobs, lower the effort level for easy tasks, ask specific questions, keep CLAUDE.md short and move procedures into skills, and give noisy jobs such as test runs to a subagent.

### Does switching model in Claude Code cost more?

Once, yes. Each model has its own prompt cache, so the first message after a switch reads the whole conversation again at the full price. Choose the model at the start of a task rather than switching back and forth.

## Sources

- [Manage costs effectively](https://code.claude.com/docs/en/costs)
- [How Claude Code uses prompt caching](https://code.claude.com/docs/en/prompt-caching)
