How do I find the most expensive sessions in Claude Code?
Rius shows what each Claude Code session cost, so you can find the most expensive ones in the trace list, on the Users page, or by asking Claude through the Rius MCP server. The Rius plugin turns each session into one trace with the cost of every model call on it. Open a costly session to see which model call or subagent drove the spend.
How it works
The plugin records one Claude Code session as one trace, with the same session id throughout. A resumed session continues the same trace. Each trace holds these spans:
- The session at the root.
- Each turn, meaning one prompt and everything it caused.
- Each model call, with the model, input and output tokens, cache reads and writes, and cost.
- Each tool call, with errors marked on the span.
- Each subagent, nested under the call that started it, with its own model calls, tokens and cost.
Cost is what makes sessions findable. Rius computes it from the model and token counts as a list-price estimate in US dollars. You never send it. Subagents have their own spans, which matters because in long sessions they can account for more than half of all tokens.
A folder enabled with /rius:enable-here sends structure only, and that already includes models, tokens and cost. You do not need to send prompts to rank sessions by spend. Your sign-in email goes on every span as user.id, and the Sent by column names the owner of the key that sent the trace.
Rius prices tokens at API rates. On a Claude Pro or Max subscription, the cost measures your usage and is not what you pay.
Set it up
-
Install the plugin and sign in with
/rius:login. The full walkthrough is in the Claude Code plugin guide.claude plugin marketplace add glassflow/rius-coding-agents && claude plugin install rius@rius-coding-agents -
In each repo you want to watch, run
/rius:enable-here, then/rius:status. The first line should readRius tracing: on. Start Claude Code from inside that repo, because a session started from a parent folder can stop being traced partway through. -
Work as usual, then open the Traces page in the console. Each session is one row, with its cost, token total, error count and latency, and it appears while it is still running. Set the time range (7d is the default, with 15m, 1h, 1d, 30d and custom also available). The strip above the list sums cost and tokens for the traces that match your filters.
-
Narrow the list. Click a cell in Sent by to show one developer’s sessions, or use Add filter to build a filter on any attribute your traces carry. Save a search you repeat with Saved.
-
Open the costliest session. The waterfall shows every turn, model call, tool call and subagent in order, with tokens and cost on each model call. The Map tab has a cost lens that shows where the money went at a glance. A tall bar in the context growth strip points to a prompt that kept growing.
-
To rank individual model calls, open the Spans tab, set All kinds to LLM, and click the Cost header to sort. The Session link in a trace header opens Spans filtered to that session.
-
To rank people, open the Users page and sort by Cost. Open a developer to see their recent and failed sessions. For team rollout, see Track Claude Code usage and cost across a team.
-
To ask in plain language, run
/mcp, pickrius, and sign in once. Then ask “Which of my Claude Code sessions in the last 24 hours cost the most, and what did the tokens go on?”
The Exploring traces page covers filters, saved searches and the span views in full.
What you get
- A trace list with one row per Claude Code session and its cost, tokens and latency, filterable by time range, sender and any attribute.
- A session view that takes you from “this session cost a lot” to the model call, tool call or subagent behind it.
- A spans view sorted by cost, so the most expensive single model calls come first.
- A per-developer ranking on the Users page, under the email each developer signed in with.
- Answers in the terminal through the Rius MCP server, without opening the console.
Two timing details matter. The trace list shows a session while it runs, but the Users and Agents figures count a session only after it has ended. A session that never ends cleanly, because Claude Code crashed or was killed, is never counted on those pages. Sessions sent with a key you stored yourself carry no user.id and land in the anonymous row on Users. Sessions from plugin versions before 0.6.2 land there too.
When something else fits
If you also trace other coding agents, start from Coding agents. Cursor sessions (beta) carry no token counts or cost, so they cannot be ranked by spend. If you need the cost of your own application’s model calls rather than Claude Code sessions, the SDK guides cover that.