3/5
Fair
Solid delegation up front, but the context ran hot through a long red/green test loop at the end.
Steps
10
each model reply or tool round
Duration
1h 10m
wall-clock span of the session
Peak context
214k
fullest the conversation got
Spent above 200k
$0.41
1 calls · 1 resets — what /compact would cut
cost ≈ context size × steps

Every time the model does something, like writing a reply or running a tool, it first re-reads the whole conversation up to that point. So the cost of a session depends less on what you asked and more on how much had already piled up by the time you asked it. A quick question late in a long chat can cost more than a big task right at the start. Each section below answers one question about this session, and the note under each heading tells you how to read it.

Spending less next time

An assessment of this session: where the money went and what to do differently. Read the cards as leads to check, not as final verdicts. The cost of a session is driven mostly by one thing, the size of the context multiplied by the number of steps, because everything left in the conversation is re-read on every later step. That makes keeping the context small, with /compact or a fresh session, almost always the biggest lever. When a card blames a more visible detail, such as a short "do it" prompt or one expensive skill, it is often pointing at where the spend happened rather than the underlying cause: that same prompt would have cost about the same in any large context, because what you paid for was re-reading the window it ran in, not the words you typed. So treat each card as a place to look, confirm it against the tables above, and act on the structural lever (a smaller context) before the cosmetic one (longer prompts).

Prompt cache expired mid-session
WhatThe session was idle long enough that the prompt cache expired and had to be re-written once, costing about $1.70 extra.
WhyThe cache lets every step re-read the conversation cheaply. After an idle gap (~1h on a Claude subscription, ~5min on API keys) it expires, and the next step pays to re-cache the whole window.
How to fix/compact or /clear at a natural break before stepping away, or split a very long session into shorter ones.
Offloaded the exploration to subagents
WhatTwo subagents ($0.22 + $0.19) mapped every caller of the old token helper and drafted the migration in an isolated worktree, so the bulky search output never piled up in the main window.
WhySubagent context is thrown away when they return — only their conclusions came back, so the main session stayed lean while the heavy reading happened elsewhere.
Keep it upKeep dispatching exploration and codebase-mapping to subagents; it's the single biggest reason the first half of this session was cheap.
The test loop re-read a 214k context every step
WhatThe final 'fix the failing test' turn climbed to 214k tokens of context and cost $0.93 — over a quarter of the session — across a red/green loop where each npm test run's full output stayed in the window.
WhyEvery step re-reads the entire conversation (the cache-read line, $1.43 of the $3.18 total). Once the window is that large, each additional test run is billed against all 214k tokens, not just the new output.
How to fixWhen a test loop drags on past a few iterations, run /compact to drop the stale earlier output, or ask a subagent to run the failing test and report only pass/fail plus the relevant error — don't keep full test logs in the main window.
Reasoning concentrated on one step
WhatThinking was 58k tokens / $0.62 of output, and step 11 alone burned 9.8k of it right after a test run.
WhyBig context plus an ambiguous failure makes the model reason longer before acting; that thinking is billed at the output rate and most of it (49k) is interleaved, so it never even shows up in the transcript.
How to fixGive the model a sharper target before a heavy step — paste the exact failing assertion and file rather than 'fix the failing test' — so it spends fewer tokens re-deriving what's wrong.

Context window over time

One bar per step, left to right in time order. The full height of a bar is how big the conversation was at that moment, in tokens (roughly, pieces of words). Because every step re-reads everything before it, taller bars cost more. Each bar has two parts: a solid re-read base — context already cached, read back cheaply, colored green / amber / red by size — and a hatched written cap on top: new material cached that step. Normally the cap is thin. When it suddenly fills the whole bar, the prompt cache expired (after a long idle gap) and that step had to re-write the entire window from scratch — marked with a ↻ below. That is not the conversation shrinking; the height stays the same, it just turns all-written. A dashed red line is the real thing: a /compact or clear where the total actually dropped. The axis underneath shows minutes from the start, so you can see where the long gaps were. Hover any bar for its split, cost, and the message it was working on.

100k200kRefactor the auth module to use the new token service and add testsstep 1 · 35k context (25k re-read + 10k written) · $0.12 · +0m — ran Read ×2 · Grep; new in context: session startup (system prompt + tool defs) (~5k) · Read token-service.js · Read session.js · Grep: verifyTokenstep 2 · 46k context (42k re-read + 4k written) · $0.10 · +2m — ran Edit · Bash; new in context: the model's previous reply (~3k) · Bash: npm test -- auth.spec.tsstep 3 · 64k context (61k re-read + 3k written) · $0.11 · +4mBase directory for this skill: /home/u/.claude/skills/test-driven-development # Test Driven Development ...step 4 · 84k context (78k re-read + 6k written) · $0.18 · +6mstep 5 · 99k context (96k re-read + 3k written) · $0.20 · +8m<task-notification> subagent resultsstep 6 · 137k context (132k re-read + 5k written) · $0.24 · +10m↻cache rebuilt: 1h35m idle gap expired the prompt cache, so this step re-wrote the whole 159k window (cost +$1.70). Cache holds ~1h on a subscription, ~5min on API keys.step 7 · 159k context (9k re-read + 150k written) · $1.82 · +1h45mfix the failing integration teststep 8 · 191k context (188k re-read + 3k written) · $0.34 · +1h47mstep 9 · 216k context (214k re-read + 2k written) · $0.41 · +1h49mcontext dropped 216k → 101k — a /compact or context clearstep 10 · 101k context (96k re-read + 5k written) · $0.18 · +1h51m+0m+4m+10m+1h47m+1h51m
re-read, under 100k (comfortable) re-read, 100k to 200k (getting heavy) re-read, above 200k (time to clear) written this step (new cache) where your message landed ↻cache expired & re-written (a long idle gap) conversation actually cleared (/compact or clear: the total dropped)
hover a bar to inspect a step
⚠ Session ran long enough to rebuild the prompt cache once

The prompt cache holds the conversation so each step re-reads it cheaply. It expires after an idle gap — about 1 hour on a Claude subscription (5 minutes on API-key usage). When that happens the next step has to re-write the whole window from scratch, which cost roughly $1.70 here and bought nothing new. Those are the ↻ marks on the chart. To avoid it: /compact or /clear at a natural break before stepping away, or split a very long session into shorter ones.

The same growth, grouped by message: who added what

The chart above uses many bars for a single message. This one is simpler: each message you sent gets one block. Read it left to right as the conversation filling up. The grey block at the start is the fixed setup that is always there before you type anything (the system instructions, the list of available tools, and the project background). Each colored block after it is one of your messages, and its width is how much that message added to the conversation: everything it read, ran, or wrote that every later step then had to re-read. Wide blocks are the messages that made the session expensive. A black dashed line is a /compact or context clear wiping it back down. Hover over a block to see the message, how far it pushed the conversation (from one size to the next), and what that turn cost.

session start — system prompt, tool definitions, project context · 35kRefactor the auth module to use the new token service and add tests — grew context 25k → 78k (+53k) · 3 steps · $0.33Base directory for this skill: /home/u/.claude/skills/test-driven-development # Test Driven Development ... — grew context 78k → 132k (+54k) · 2 steps · $0.38<task-notification> subagent results — grew context 132k → 188k (+56k) · 2 steps · $2.060+198k total context added
fixed setup your message a skill running managing helpers session start
hover a block to see what that turn added

Where it went

Your total cost, split into the four things you actually pay for. cache read is the model re-reading the conversation at every step. This is usually the biggest slice, and the main reason long sessions get expensive. output is everything the model wrote back, including the private thinking you never see. cache write is the cost of saving new material once, so that later steps can re-read it more cheaply. input is brand-new text that has not been saved yet, and it is usually tiny.

componentcostshare
cache read$1.43
output$0.90
cache write$0.80
input$0.05

What filled the context

What took up room in the conversation. carried cost is the repeat charge for keeping it around: once a file or a command's output lands in the conversation, the model re-reads it at every later step until the session ends or the conversation is cleared. A big row here is a good thing to hand off to a helper (a subagent) next time — the helper reads it in its own separate conversation and sends back only a short summary, so the bulky original never weighs down your main chat.

By tool — where it came from

toolresultsest tokenscarried costshare
unexplained1118k$0.00
Read652k$0.78
Bash526k$0.34
Grep418k$0.21

Item by item — the exact file, command, or message

A ×3 after a tool name means the same thing landed three times; a file read three times costs its full size three times over, plus the repeat charge for keeping each copy around. The assistant-* rows are the model's own words: its visible replies (assistant-text), its private thinking (assistant-thinking), and the text it typed into its tools (assistant-tool-calls). When those rows are near the top, the cost came mostly from how much the model itself wrote, not from what it read.

est tokenssharecarried costtooltarget (file · command · prompt)
118k
$0.00unexplained(peak context not attributed to any row — token-estimate error, tool-result wrappers, injected reminders)
31k
$0.46Read ×3The new token-service module the refactor targets — re-read on every step because the implementation kept referring back to its full surface area.
22k
$0.29Bash ×4The auth test-suite run, repeated through the red/green loop — each full run's output stayed in context and was re-read by later steps.
19k
$0.24Read ×2The old in-process token helper being removed; kept in context while the agent confirmed each caller was migrated.
14k
$0.17Grep ×4The call-site search for the old helper — four passes as the agent widened the pattern to catch every usage.

estTokens ≈ chars/4 — estimates, not billed figures.

Top turns

Your messages, ranked by how much the work each one set off ended up costing. peak ctx is how full the conversation was while that work was running. The same task costs several times more when the conversation is already large than when it is small, which is why a short message late in a session can cost more than a big one asked at the start.

costkindskillpeak ctxwhat
$0.93user214kPointed the agent at the one red integration test after the refactor and told it to make it pass without touching the new token service.
$0.54subagent-orchestration158k↩ subagent results
$0.38skilltest-driven-development96kRan the test-driven-development skill: wrote the failing token-service tests first, then implemented against them.
$0.33user61kKicked off the work: replace the old in-process token helper with the new token service across the auth module, with test coverage.

Reasoning: what it cost

Before most replies and tool actions, the model thinks privately. That thinking is charged at the output rate, the most expensive rate, but the text is never saved anywhere, so no tool can show it to you. The interleaved figure is exactly that hidden thinking. The table shows which of your messages set off the most reasoning. A lot of steps under one message usually means a debugging loop: every test run or error that comes back sets off another round of thinking. The fix is fewer, bigger steps, for example running several commands at once or handing a repetitive retry loop to a helper. It is not about making the model "think less".

58k tokens $0.62 billed at the output rate — 49k interleaved (billed, never saved to the transcript) + 9k saved as thinking blocks · 8/10 steps thought · avg 7k/step · peak 10k at step 11 → Edit, Bash

tokenssharestepsprompt that drove the reasoning
24k
4Pointed the agent at the one red integration test after the refactor and told it to make it pass without touching the new token service.
19k
3Ran the test-driven-development skill: wrote the failing token-service tests first, then implemented against them.
15k
1Kicked off the work: replace the old in-process token helper with the new token service across the auth module, with test coverage.

Biggest reasoning bursts

The individual steps where the model thought the hardest. trigger is what had just landed in the conversation, the tool result or message it was reacting to. next action is what it decided to do next. A big burst right before an important action, like making a large edit, is just the model taking time to plan, which is normal. But repeated bursts after the same command usually mean the model kept working out the same answer over and over, a sign that loop would have been better handed to a helper.

tokenssteptrigger (what landed in context right before)next action
10k11Bash: npm test -- authEdit, Bash
7k9Read: /repo/src/auth/token-service.tsEdit
6k5user-prompt: wrote the failing tests firstWrite

By skill

What each skill you used cost, counting only the steps the skill's own instructions set in motion. A skill that shapes the whole session (like a workflow or a review skill) really costs more than this number shows. Its instructions also stay in the conversation, listed as a user-prompt row in the table above, adding to the cost of every later step.

skilldispatchesstepscost
test-driven-development15$0.58

By model

A single session can use more than one model, for example a cheaper one for quick steps. These costs are worked out from the raw token counts and the public price per token, so they may not exactly match the figure the app shows you.

modelcost
claude-opus-4-8$3.18

Subagents

Smaller side jobs the session handed off to helpers. Each helper works in its own short, separate conversation and sends back only a summary, so they usually cost just a few cents. If this list is short but the main session was expensive, the way to save money is to hand off more of the exploring to helpers, not to cut back on the ones you already have. Steps is how many model turns a helper took — a rough measure of how much work it did.

taskstepscost
Explore the auth module and map every caller of the old token helper7$0.22
Draft the migration to the new token service in an isolated worktree5$0.19