ai newsMi., 21. Okt.
EilmeldungAnthropic: US-Stopp für KI erst ab Milliardenrisiko oder vielen Todesopfern

What did that Claude Code session actually cost? Spend, quota and history in one place

I build ccdeck . The step-by-step version of this post is at ccdeck.dev/guides/cost-and-quota . Three questions I kept asking With several agent sessions running, I want to know where the tokens went and whether I have enough quota to finish. Those are different questions, so I keep three numbers i

dev.toMittwoch 08:24 · 21.10.3 Min. Lesezeit
Bild: dev.to

I build ccdeck. The step-by-step version of this post is at ccdeck.dev/guides/cost-and-quota.

With several agent sessions running, I want to know where the tokens went and whether I have enough quota to finish. Those are different questions, so I keep three numbers in view:

ccdeck answers all three on one page, and is careful to say which number comes from where. This post walks through them.

npx ccdeck Enter fullscreen mode Exit fullscreen mode The topbar: this month The topbar always shows this month: what you have spent since the 1st, in tokens and dollars, across every Claude Code and Codex session on the machine. For the rest, press U (or click Usage ).

Demo data. Both CLIs are watched, so both quotas are drawn.

A bar turns amber from 70% and red from 90%. The age beside a heading (such as 2m ago ) says how old the reading is, and an incident on Claude Code, the Claude API or Codex shows as a line under that quota's heading, linking to the status page.

You need a subscription for this part: Claude Code signed in with a Claude plan, or Codex signed in with codex login and a ChatGPT account. With an API key, or Bedrock or Vertex, there is no quota window — the panel says No quota to show, and your spend still shows.

If you juggle more than one Claude account, the accounts panel shows each account's 5-hour and 7-day usage side by side; the accounts guide covers it, and I wrote it up separately in a post on sharing accounts between machines.

Every session's card, its row in the session list and its detail panel show its spend, including its subagents', priced from ccdeck's own rate table.

In the Usage panel, By session lists a row per session active in the period. A session that has left the canvas shows the end of its id, like 8c3f0e17.

Two markers are worth knowing, because they are the deck refusing to guess:

Under the quotas, pick today, month or all. Month starts on the 1st, not 30 days ago; all is every transcript on disk.

These totals come from ccusage, a separate tool that reads the transcripts both CLIs leave on disk. The deck installs its own copy with npm the first time it needs one, or uses a ccusage already on your PATH. Because ccusage reads the transcripts, the totals cover every session on the machine, even ones no longer on the canvas.

Usage history (press H ) opens on 30 days, with 7, 14 and 90 a click away. Click a day's bar for its tokens and its cost by CLI and by model.

Demo data. The last bar is today, clicked.

For Claude Code, the accounts panel ( A ) has a Projects report on each account's ⋯ menu: what that account spent in each project, by day.

Demo data. The footer says the dollars have been matched to ccusage's.

Work is counted for the account that was active when each message was sent. Work no account can be tied to is listed apart as Unattributed usage and left out of the totals.

This is the most important section of the post:

npx ccdeck Enter fullscreen mode Exit fullscreen mode Run a session, then press U.

Quelle: dev.to (dev.to). Original öffnen