Code Tycoon Get Code Tycoon

Blog / Cost

ccusage vs /cost vs Code Tycoon: Tracking Claude Code Spend

Compare ccusage, Claude Code's built-in /cost (an alias of /usage) and Code Tycoon on what each measures, where the data comes from, and which fits your setup.

ccusage vs /cost vs Code Tycoon: Tracking Claude Code Spend

/cost is the built-in answer for the session in front of you, ccusage is the free command-line report across days and sessions, and Code Tycoon prices work per task and flags the habits behind the number.

Short verdict. For one session, use the built-in command. For a quick daily or monthly table in your terminal, run ccusage. If you run several sessions across projects and want to know which tasks and habits cost money, use Code Tycoon. Each section below says where the other two fit better. Facts checked 2026-11-23 on Claude Code's docs, the ccusage GitHub README and the Code Tycoon site.

Table of contents

Side by side

/cost (alias of /usage) ccusage Code Tycoon
What it is Built-in Claude Code command Open-source CLI Server and dashboard for Claude Code (and Codex)
Price Included Free, MIT license Self-hosted free (AGPL-3.0); hosted Solo $39, Team $69, Max $129 per month
Scope Current session, plus plan usage and activity stats Per day, month, session, plus 5-hour blocks Every task and session, across projects
Data source Local token counts in the running session; plan breakdown from local session history Local usage data from coding agent CLIs Code, git history and session transcripts
Install None npx ccusage@latest npx code-tycoon or hosted
Cost basis Local calculation at list price USD per day, month or session; pricing method not stated on its README Prices every task and session
Best at Checking the session you are in Quick historical totals in a terminal Per-task cost, oversized contexts, cold resumes, wasteful habits

Sources: Claude Code costs docs and commands reference for /cost; the ccusage GitHub page for ccusage; codetycoon.dev for Code Tycoon. Plan prices change; verify them on the site.

Claude Code's built-in /cost

In current Claude Code, /cost is an alias. The commands reference says: "/cost | Alias for /usage", and describes /usage as showing "session cost, plan usage limits, and activity stats." /stats is another alias that opens on the Stats tab.

What you get, per the cost docs:

  • A Session block with an estimated dollar cost, durations, code changes and a "Usage by model" breakdown with token counts per model.
  • A prompt cache line for the main conversation (Claude Code v2.1.251 or later): requests, share of input tokens from cache, misses, and whether the cache is warm. The docs say it "covers the main conversation only, not subagents."
  • On Pro, Max, Ultra, Team and Enterprise plans, a plan usage breakdown that attributes recent usage to skills, subagents, plugins and MCP servers, plus recommendations. It is "computed from local session history on this machine, so usage from other devices or claude.ai is not included." If skills rank high in that breakdown, this look at how much context installed skills take up explains where the tokens go.

Strengths: no install, always current with the Claude Code version, and the plan breakdown is something only Anthropic's own tool can show for your subscription limits. Limits to know:

  • The dollar figure is local math. The docs: "Claude Code computes the dollar figure locally from token counts at list price," and "the figure is an estimate."
  • On a subscription it is not your bill. The docs say the Session block "is intended for API users" and that for Pro, Max and Ultra subscribers "the session cost figure isn't relevant for billing purposes."
  • Totals reset when /clear starts a new session, so it is a per-session view, not a history.

Related: /insights writes an HTML report on how you work from your recent sessions on this machine. It is about friction and habits, not dollars.

If you are on the API and your whole team needs numbers, Anthropic points to other places: the Console Cost page and workspace spend limits for API orgs, the spend report in org analytics for Teams and Enterprise, and OpenTelemetry export for per-user metrics. Those cover organization reporting, which is a different job from the three tools here.

ccusage

ccusage is an open-source command-line tool. Its GitHub page describes it as: "Analyze coding (agent) CLI token usage and costs from local data." It is MIT licensed and run with npx ccusage@latest (bunx and pnpm dlx work too).

From the README, the commands are:

npx ccusage@latest daily      # by day
npx ccusage@latest monthly    # by month
npx ccusage@latest session    # by session
npx ccusage@latest blocks     # Claude Code 5-hour billing windows
npx ccusage@latest statusline # status line for hooks (Beta)

The README also lists an offline mode that uses pre-cached pricing, custom pricing overrides in a ccusage.json file, and support for custom local data directories.

Strengths: it answers "what did I use this week and this month" in one table, with no account, no server and no cost. The blocks view is aimed at the 5-hour windows that matter on subscription plans (see Claude Code usage limits explained). The statusline command can put a figure in your Claude Code status line.

How it calculates cost, per the ccusage cost modes guide (checked 2026-11-26): by default (--mode auto) it uses the cost stored in each log entry when there is one and otherwise multiplies token counts by model prices, with input, output, cache-write and cache-read tokens priced separately. --mode calculate always works from tokens, and --mode display uses only stored costs. Prices come from LiteLLM, models.dev, built-in model data and your own overrides; a model with no known price counts as zero. For grouping, the CLI options page lists --instances (group the daily report by project) and --project <name> (filter to one project). That is per project, not per task. The docs pages for Claude Code data and CLI options do not mention subagent or sidechain usage, so they do not say how it is counted. The cost figures are in USD, so the same caveat as /cost applies on a flat plan: it shows the value of usage, not your invoice.

Search results for "ccusage alternative" also list forks and similar CLIs. Some are unmaintained or third-party; vet any package before you run it against your transcripts.

Code Tycoon

From the Code Tycoon homepage and README, checked 2026-11-23:

  • It reads your code, git history and session transcripts and draws 13 views, including a "working with Claude" view that covers cost habits, a task log and a daily digest.
  • It prices every task and session, flags oversized contexts and cold resumes, and ranks wasteful habits in dollars.
  • It alerts when a session's cache expired, when two sessions edit the same file, and when a session needs an answer.
  • Its task manager runs a pasted list of tasks and writes a report for every finished task, which is what makes per-task pricing possible.
  • Self-hosted is free and open source under AGPL-3.0 (npx code-tycoon); hosted plans are Solo $39, Team $69 and Max $129 per month. Each hosted plan is a dedicated server (Solo 4 vCPU and 8 GB RAM, Team 8 vCPU and 16 GB, Max 16 vCPU and 32 GB, per the pricing section checked 2026-11-26); model usage still runs on your own Claude or ChatGPT plan or API key.
  • Models: Claude Code with Opus, Sonnet or Haiku, and Codex with OpenAI's models.

Where it fits: you run several sessions across projects, you hand tasks off, and "what did this task cost" matters more than "what did this day cost". Where it does not: you work in one session at your desk and just want a total. ccusage or /usage is lighter and does that job. Code Tycoon also depends on transcripts being on the machine it reads, so usage from a device it does not see is not in its picture.

For a sense of what habit-level findings look like, see What Claude Code really costs per month, built from our own transcripts, and Prompt caching in Claude Code on why cold resumes cost money. Both use the kind of aggregate numbers a tracker should give you.

Why the numbers disagree with your bill

All three tools compute a cost from token counts and list prices. Four things stop that from matching what you pay:

  1. Flat plans. On Pro or Max you pay a monthly fee. A list-price figure shows what the usage would cost on the API.
  2. Contracted rates. If your organization has negotiated prices, the figures in /usage do not match the bill unless an admin sets the modelPricing managed setting; the docs say it "changes what Claude Code reports, not what Anthropic charges."
  3. Pricing rules. Cache reads, cache writes and, for Haiku 5.5, prompt length each change the rate; see Anthropic's pricing page. A tool that gets one of them wrong drifts.
  4. Coverage. Usage on another machine, in claude.ai or by subagents may or may not be in a tool's view. /usage says its plan breakdown excludes other devices.

When two tools show different totals for the same week, check these four before you decide which is wrong.

What none of them tell you for free

Even with a good tracker, three questions need judgment:

  • Which model did the work? In one team's transcripts (792 sessions, 54,344 requests, about 7.5 weeks, list-price equivalent), Opus 5.5 accounted for $5,952 of $5,998, Sonnet 5.5 for $44 and Haiku 5.5 for $0.38. A per-model breakdown makes that obvious in a minute; without one, nobody noticed. See Opus vs Sonnet in Claude Code and Sonnet vs Haiku for subagents.
  • What is the context doing? In the same data, 45.5% of requests carried more than 200,000 tokens and made up 63.8% of the cost. A daily total will not show that; a context-size breakdown will.
  • What does the cost buy? Dollars per day are not dollars per finished task. Per-task pricing needs a record of what a task was, which is why Code Tycoon pairs its pricing with a task manager and a report for every finished task. Caveat: that dataset is one team over a short period, not a benchmark.

Pick /cost if, ccusage if, Code Tycoon if

Pick /cost (/usage) if:

  • You want the current session's estimate and cache status with nothing to install.
  • You are on a subscription and want Anthropic's own breakdown against your plan limits.

Pick ccusage if:

  • You want daily, monthly and 5-hour-block totals in the terminal, free.
  • You like open-source tools you can read and run offline.
  • You are one developer in a few sessions, not managing tasks across projects.

Pick Code Tycoon if:

  • You run several sessions, often unattended, and want cost per task and per session.
  • You want oversized contexts, cold resumes and wasteful habits ranked in dollars.
  • You want the same setup running on a server you reach from a phone. See How to run Claude Code on a dedicated server and the /#cloud section.

Use more than one. They overlap but do not conflict. Many people will sensibly keep /usage for the live session and ccusage for the weekly table, and add a per-task tool only when the habits question comes up.

A 15-minute weekly cost check

Whichever tool you pick, the numbers only help if someone looks at them on a schedule. A short weekly routine covers most of what matters.

  1. Total for the week. Read the weekly or daily table from ccusage, or the plan view in /usage. Write the number down next to last week's. The trend is more useful than the absolute figure, because the absolute figure is a list-price estimate anyway.
  2. The top three days. Open the most expensive days and ask what ran on them. A large refactor explains a spike. A day with no shipped work and a high total usually points to a session that was resumed after a long break, or one that ran with a very large context.
  3. Model mix. Check how much of the spend went to each model. If one model carries almost everything, that is worth a deliberate decision rather than a default.
  4. Context size. Look for sessions that kept going long after the work changed topic. Starting a fresh session for a new task is the cheapest fix there is.
  5. One change. Pick a single habit to change for the next week, and check next week whether the total moved.

This works with free tools alone. A per-task view saves the step of matching days to work by hand.

The bottom line

/cost and /usage answer "what is this session costing right now". ccusage answers "what did this week cost" for free in the terminal. A per-task tool answers "what did each piece of work cost, and which habits drive it". Start with the free two, and add the third when you run several sessions at once and the weekly total stops explaining itself.

Frequently asked questions

Is /cost still a Claude Code command?

Yes, as an alias. Claude Code's commands reference lists /cost as an alias for /usage, which shows session cost, plan usage limits and activity stats. /stats is a second alias.

Does /cost show my real bill on Pro or Max?

No. Claude Code's cost docs say the Session block is intended for API users, and for Pro, Max and Ultra subscribers the session cost figure "isn't relevant for billing purposes". It is a list-price estimate computed locally.

Is ccusage free?

Yes. Its GitHub page lists an MIT license and you run it with npx ccusage@latest.

What does ccusage report?

Per its README, costs in USD by day, month and session, plus Claude Code 5-hour billing windows and a status line command. It reads local usage data from coding agent CLIs. Its docs say it uses the cost stored in the logs when present and otherwise prices tokens from LiteLLM and other price lists, and it can group or filter by project. The docs do not say how subagent usage is counted.

How is Code Tycoon different from ccusage?

ccusage is a free command-line report of usage. Code Tycoon reads transcripts, code and git history, prices each task and session, flags oversized contexts and cold resumes, and ranks wasteful habits in dollars. It also runs your Claude Code setup on a server. If you only need a total, ccusage is simpler.

Can I track a whole team's Claude Code spend with these?

Not what they are built for. Anthropic's cost docs point teams to the Console Cost page and workspace spend limits for API organizations, the org analytics spend report for Teams and Enterprise, and OpenTelemetry for per-user metrics.

Why do ccusage and /usage show different totals?

Possible reasons: different coverage (other devices, subagents), different time windows and different pricing rules. Check those three first.

Related articles

If per-task cost is the missing piece, self-host Code Tycoon for free with npx code-tycoon, or see the hosted plans.


About this research

Anton Goldshtein is a two-time founder who previously bootstrapped a company to $100M in revenue. His team runs its own products on Code Tycoon every day.

Facts about /cost and /usage come from Claude Code's documentation, facts about ccusage from its GitHub README, and facts about Code Tycoon from its live site, all checked 2026-11-23. The model and context figures come from one team's Claude Code transcripts (792 sessions, 54,344 requests, 2026-10-02 to 2026-11-23), reduced to aggregates and priced at list rates.

Content reviewed and updated: 2026-11-26


Keep reading