Claude Code Cost and How to Test If a Plugin Saves Tokens
Short answer
Claude Code comes with every paid Claude plan, from $20 a month for Pro to $200 a month for Ultra. You can also pay per token through an API account. Claude Sonnet 5.5 lists at $2 per MTok of input and $10 per MTok of output, and a MTok is a million tokens. A cost meter shows an estimate of what you spent. It cannot show what a plugin saved, because it has nothing to compare against. To find out, run the same task with and without the plugin, in fresh sessions, several times each. Then compare the difference with the run-to-run spread.

Get the free token test kit
Download the free Claude Code token test kit. It holds a spreadsheet with live formulas and a small script that adds up your test runs. No email needed.
Both apply the rules on this page. Paste in your own runs and read the result.
Worksheet
One sheet for each arm of the test, a result sheet with a plain verdict, and a sheet that checks how many chat turns a plugin needs to pay for itself.
Script
A short Python file that reads the JSON files Claude Code writes and prints the same table.
Example
The worked example from this page, with every sum written as a formula.
What Claude Code costs
There are two ways to pay. A Claude plan gives you a monthly allowance. An API account bills Claude Code by token consumption, so what you pay depends on how many tokens your work uses.
Claude Code is included in all paid plans. It shares one pool of usage with your chats. Heavy sessions can also switch to pay-as-you-go API credits through a Console account.
Plan | Price (read 24 November 2026) | Usage |
|---|---|---|
Pro | $20 a month billed monthly, or $200 up front for the year, which is $17 a month | The base allowance |
Max | $100 a month | 5x Pro usage every 5 hours and every week |
Ultra | $200 a month | 10x Pro usage every week, with no 5-hour limit for verified accounts |
Enterprise is $20 per seat per month plus usage billed at API rates, as last checked on 24 November 2026. Our guide Is Claude Code free? covers the free plan and the billing traps in detail, and Claude Pro vs Max helps you pick a tier.
Input, output and cached input have different prices. Sonnet costs less than Opus, as the table shows.
Model | Input | Output | Cache write, 5 minutes | Cache read |
|---|---|---|---|---|
Claude Sonnet 5.5 | $2 per MTok | $10 per MTok | $2.50 per MTok | $0.10 per MTok |
Claude Opus 5.5 | $4 per MTok | $20 per MTok | $5 per MTok | $0.20 per MTok |
Anthropic puts the average cost across enterprise deployments at around $13 per developer per active day. That is $150-250 per developer per month. Costs stay below $30 per active day for 90% of users. For a short session of 2 to 9 turns, OpenRouter's own measurement of real Claude Code sessions puts the median at $0.31 on Opus 5.5 and $0.16 on Sonnet 5.5. That is a third-party figure, not an Anthropic one. Max and Ultra plans also include $100 and $200 a month in API credits.
How to see what you spend
Claude Code has built-in ways to see spend. Run /usage and look under the Session heading for the token usage of your current session. Run a task with claude -p and --output-format json, and the result file includes total_cost_usd and a per-model cost breakdown. Or add the cost field to your status line, as our Claude Code statusline guide shows.
All of these are estimates. Claude Code computes the dollar figure locally from token counts at list price, unless an administrator has set contracted rates. The JSON figures are client-side estimates that can differ from your actual bill.
On Pro, Max and Ultra plans the session cost figure is not relevant for billing. Usage is included in the subscription. Subscribers see plan usage bars, activity stats and a usage breakdown in the same screen. If you pay through the API, API organizations can set workspace spend limits and view cost and usage reporting in the Console. The Console is the number to trust for an invoice.
Run /clear between unrelated tasks, because it starts a new session and resets the session total to $0.
Why a cost meter does not show savings
A meter adds up one session. It never runs the same job again without your plugin, so it has no before number. Seeing a dollar figure on the meter tells you what that session cost, not what it would have cost.
The same task can also cost different amounts on two runs. Anthropic notes that agent behavior varies between runs, and runs several trials per task for that reason.
The plan breakdown in /usage does not fix this. It attributes recent usage to skills, subagents, plugins and MCP servers as a percentage of the total. That share shows how much of your usage a plugin was involved in, not how much it saved. A "tokens saved" counter inside a plugin is a claim to test, not a measurement.
Why a rules plugin can cost more on short chats
Every session with a plugin enabled includes the names and descriptions of its skills, agents and commands in context. Those tokens count against your usage whether or not the plugin gets used. Claude Code also sends the full conversation with every request.
The cache keeps this affordable. The API matches the start of each request against content it recently processed. Claude Code appends a plugin's content after the existing conversation. The next request pays for that content and still reads everything before it from the cache. The plugin text is written to the cache once, and every later turn reads it back at the cache read price. For Sonnet 5.5 that is $0.10 per MTok, against $2 for fresh input. A 5-minute cache write costs 1.25 times the base input price.
So a rules plugin pays a one-time write and a small read on each turn. It comes out ahead only if it saves more than that. In a one-turn chat it pays the write and has almost no turns to earn it back. In a long chat the small saving on every turn adds up. That is why one plugin can lose on short chats and win on long ones.
You can see what a plugin adds before you test it. Run claude plugin details with the plugin's name in your shell, not inside a session. It shows the always-on tokens that its skills, agents and commands add to every session. Anthropic says these counts are estimates and may differ from actual usage.
Output is the expensive side. An output token costs far more than a cached input token, as the API table above shows. Thinking tokens are billed as output tokens. A plugin that trims narration can therefore save more than one that trims file reads. A plugin that shortens text but not thinking may save less than it claims. The worked example below puts numbers on all of this.
How to run a fair with-and-without test
- Start every run from the same git commit
- Use a fresh session for every run
- Run without, with, without, with
- Run your test command after each run
- Add up the cost of every run in an arm
The idea is simple. Change one thing, the plugin, and keep everything else the same.
- Pick a handful of real tasks that you can check. "Fix this failing test" is a good task because the test gives a pass or a fail. Toy prompts flatter plugins. Include a short task too, because that is where rules plugins lose.
- Freeze the starting point. Start every run from the same git commit, in a clean copy of the repository.
- Keep everything else equal. Use the same Claude Code version, the same prompt word for word, the same CLAUDE.md and the same other plugins. Use the same model and effort level too. Each model has its own cache, and each effort level usually has its own. If you switch either one, the next request has to pay full price for the whole history.
- Use a fresh session for every run. Never turn a plugin on or off in the middle of a session. Enabling or disabling a plugin can make the next request miss the cache, which adds a cost that belongs to neither arm.
- Run it from the command line and save each result. The
-pflag runs Claude Code without an interactive session, and--output-format jsonwrites the usage and cost to a file.
mkdir -p runs
# without the plugin
claude --bare -p "Fix the failing test in tests/auth.test.js" --output-format json > runs/fix-auth__without__1.json
# with the plugin
claude --bare --plugin-dir ./my-plugin -p "Fix the failing test in tests/auth.test.js" --output-format json > runs/fix-auth__with__1.jsonAdd --bare to both arms. It skips auto-discovery of your hooks, skills, custom commands, subagents, installed plugins, MCP servers, auto memory and CLAUDE.md, so both arms start equally empty. In bare mode a plugin is loaded with --plugin-dir. Bare mode uses an API key rather than your subscription login, so set ANTHROPIC_API_KEY first. There is one limit. Hooks that come from a plugin loaded by flag do not run in bare mode. If your plugin works through hooks, leave out --bare and switch the plugin on or off in its own fresh session instead.
- Alternate the arms. Run without, with, without, with, so a slow hour or a change on the API side hits both arms alike.
- Judge success with your own check. Run your test command after each run and write down pass or fail. Do not take the model's word that it worked.
- Add it up. Each result file reports
input_tokens,output_tokens,cache_creation_input_tokensandcache_read_input_tokens. Keep the four apart, because each is priced differently. Runpython sum_runs.py runsfrom the kit, or paste the four counts into the worksheet.
If you build plugins, Claude Code also has claude plugin eval. It runs each case with the plugin and again with no plugin loaded, and shows both scores. Each case runs three times by default, and its COST column is a list-price estimate. It grades behavior first, so use the steps above for dollars.
How to read the result
Use two numbers for each arm: the median cost of a run, and the spread, which is the highest run minus the lowest run. Then apply this rule. The median saving must be larger than the larger of the two spreads before you believe it. If it is smaller, the difference is inside the noise.
This is a rule of thumb, not a statistical test. The minimum number of runs per arm is our suggestion, not an Anthropic rule.
Then work out the cost per passed run. Keep every result file, failed runs included, and report failures next to the successes. Add up the cost of every run in an arm and divide by the number of runs that passed your check. A plugin that cuts the cost of a run but fails more often can cost more for each working result.
A worked example: the Tokenly plugin on paper
Everything in this section is invented to show the arithmetic. It is not a test result, and no real plugin is measured.
Part 1: does a rules plugin pay for its own text?
Say a made-up plugin called Tokenly adds 2,000 always-on tokens to every session. Say it claims to save 100 output tokens on every turn. We price it on Claude Sonnet 5.5 with the 5-minute cache write, using the list prices above.
- One-time cache write: 2,000 tokens x $2.50 / 1,000,000 = $0.0050.
- Cache read on each later turn: 2,000 x $0.10 / 1,000,000 = $0.0002.
- Saving on each turn: 100 output tokens x $10 / 1,000,000 = $0.0010.
Turns in the chat | Overhead | Saving | Net |
|---|---|---|---|
1 | $0.0050 | $0.0010 | -$0.0040 |
3 | $0.0054 | $0.0030 | -$0.0024 |
6 | $0.0060 | $0.0060 | $0.0000 |
20 | $0.0088 | $0.0200 | +$0.0112 |
The overhead for 20 turns is $0.0050 + 19 x $0.0002 = $0.0088. The break-even point is where $0.0050 + (n - 1) x $0.0002 equals n x $0.0010, which gives n = 6 turns. With a 1-hour cache write at $4 per MTok, the write costs $0.0080 and the break-even moves to 10 turns. Below that length Tokenly costs more than it saves, even if the claimed saving is real.
Part 2: five runs for each arm
Now say you ran one task five times for each arm and counted a run as passed when your test command passed.
Run | Without plugin | With plugin | Passed without | Passed with |
|---|---|---|---|---|
1 | $0.42 | $0.39 | Yes | Yes |
2 | $0.55 | $0.44 | Yes | Yes |
3 | $0.38 | $0.36 | Yes | No |
4 | $0.61 | $0.52 | Yes | Yes |
5 | $0.47 | $0.41 | Yes | Yes |
- Median without the plugin: $0.47. Median with it: $0.41. The difference is $0.06, which is about 13% of $0.47.
- Spread without: $0.61 - $0.38 = $0.23. Spread with: $0.52 - $0.36 = $0.16. The larger spread is $0.23.
- The difference of $0.06 is smaller than $0.23, so it is inside the noise. This test does not prove a saving.
- Total cost without: $2.43 over 5 passes, which is $0.486 for each passed run. Total cost with: $2.12 over 4 passes, which is $0.53 for each passed run.
In this invented case the next step is more runs or a bigger task, not a claim of savings.
Once you know what a change really saves, the other levers are open to the same test. Our guides to hooks and subagents cover two of them, and our context window guide explains what fills your context. Our best practices checklist and settings guide cover the rest.
Sources
These are the pages the prices, commands and quotes above come from, read on 24 November 2026.
- Plans & pricing, Claude by Anthropic
- Pricing, Claude Docs
- Prompt caching, Claude Docs
- Manage costs effectively, Claude Code Docs
- Run Claude Code programmatically, Claude Code Docs
- Measure plugin cost and usage, Claude Code Docs
- Test plugins with evals, Claude Code Docs
- How Claude Code uses prompt caching, Claude Code Docs
- Customize your status line, Claude Code Docs
- Demystifying evals for AI agents, Anthropic
- How Much Does Claude Code Cost? Real Costs per Session, OpenRouter (third-party measurement)
Topics
- claude code cost
- ai plugin token savings
- reduce claude code tokens
Xtrusio
AI visibility research
Xtrusio is the Perception Engine for B2B brands.
Free check
See how AI engines answer about you
Get your free AI visibility check
Keep reading
Technical SEO · 24 November 2026 · 16 min readWhat a DIY AI Visibility Audit Costs (Free Worksheet)
See what it costs to build and run your own AI visibility audit: API fees per engine, server, build hours and upkeep, plus a free worksheet.
Technical SEO · 23 November 2026 · 12 min readHow to Set Up an AI Agent Team (Free Starter Kit)
Set up an AI agent team with one coordinator and narrow specialists. See when one agent is enough, what a team costs in tokens, and get a free starter kit.
Technical SEO · 23 November 2026 · 11 min read