calculateCost clamps negative and non-finite counts to zero before it sizes
the prompt, so the tier prompt for a slice does the same; otherwise a corrupt
negative count could price the parts in a lower tier than the call.
calculateCost tiers on the larger of the cache write and its one-hour part,
so a slice priced for a call whose prompt is mostly one-hour writes has to
use the same size.
The per-class split, the hand-back, cache saving, carry and prefix estimates
and the one-tier-down reprice priced without the provider and on a slice of
the prompt, so Claude calls above the long-context threshold split into parts
that added up to a fraction of the call cost. Each slice now takes the tier
its whole call's prompt decides.
Every subagent's step list ships with the session since the agents view,
so a session with 863 helpers grew from 10.8 MiB to 42.4 MiB and the
desktop refused it. Steps now leave out default fields (isError false,
answer false, empty detail, calculated basis), the unused context delta,
and round the cached share. Past a 12 MiB budget the JSON drops whole step
lists, cheapest helper first and then prompts, with a truncatedSteps count
the Inspect, Agents and Story views show.
* feat(desktop): inspect view for a prompt with request cards and insights
An open prompt now reads as one card per model request, newest first, with
the tool calls each request asked for nested under it. Each card shows the
request number and model, tokens in, out and cached share, what the request
did (asked for tool calls or wrote the answer), its duration against the
prompt's longest step, and its output tokens and cost. Tool rows show the
command or target, duration, the context the result added, a parallel label
when one message asked for several calls, and a muted failed state. A search
field and an All / Model / Tools switch narrow the list, and any card or tool
opens the existing step detail.
Above the cards a summary line and an insights strip name the slowest and the
costliest request, the tool that added the most context, how the tool calls
ran, and failed steps when there are any. Rows that cross the existing
slow-call and carried-result thresholds lead. The two-lane waterfall is gone:
the cards carry the same timing.
The session payload gains the fields this needs, computed at serve time:
each tool step names the model step that asked for it, a parallel position
and its result size; each model step carries its cached share, the context
delta to the next request, its tool call count, its cost basis and whether
it wrote the answer.
* fix(desktop): one place for out tokens on a request card
The request card showed output tokens twice, in the meta line and as a pill. The pill is gone; the meta line keeps the count and the dollar pill stays.
* feat(desktop): agents view with each subagent's lifecycle and cost by agent
* feat(desktop): story view that tells a prompt in plain sentences
* fix(desktop): story wording and copy feedback
* feat(desktop): inspect view for a prompt with request cards and insights
An open prompt now reads as one card per model request, newest first, with
the tool calls each request asked for nested under it. Each card shows the
request number and model, tokens in, out and cached share, what the request
did (asked for tool calls or wrote the answer), its duration against the
prompt's longest step, and its output tokens and cost. Tool rows show the
command or target, duration, the context the result added, a parallel label
when one message asked for several calls, and a muted failed state. A search
field and an All / Model / Tools switch narrow the list, and any card or tool
opens the existing step detail.
Above the cards a summary line and an insights strip name the slowest and the
costliest request, the tool that added the most context, how the tool calls
ran, and failed steps when there are any. Rows that cross the existing
slow-call and carried-result thresholds lead. The two-lane waterfall is gone:
the cards carry the same timing.
The session payload gains the fields this needs, computed at serve time:
each tool step names the model step that asked for it, a parallel position
and its result size; each model step carries its cached share, the context
delta to the next request, its tool call count, its cost basis and whether
it wrote the answer.
* fix(desktop): one place for out tokens on a request card
The request card showed output tokens twice, in the meta line and as a pill. The pill is gone; the meta line keeps the count and the dollar pill stays.
* feat(desktop): agents view with each subagent's lifecycle and cost by agent
* feat(desktop): inspect view for a prompt with request cards and insights
An open prompt now reads as one card per model request, newest first, with
the tool calls each request asked for nested under it. Each card shows the
request number and model, tokens in, out and cached share, what the request
did (asked for tool calls or wrote the answer), its duration against the
prompt's longest step, and its output tokens and cost. Tool rows show the
command or target, duration, the context the result added, a parallel label
when one message asked for several calls, and a muted failed state. A search
field and an All / Model / Tools switch narrow the list, and any card or tool
opens the existing step detail.
Above the cards a summary line and an insights strip name the slowest and the
costliest request, the tool that added the most context, how the tool calls
ran, and failed steps when there are any. Rows that cross the existing
slow-call and carried-result thresholds lead. The two-lane waterfall is gone:
the cards carry the same timing.
The session payload gains the fields this needs, computed at serve time:
each tool step names the model step that asked for it, a parallel position
and its result size; each model step carries its cached share, the context
delta to the next request, its tool call count, its cost basis and whether
it wrote the answer.
* fix(desktop): one place for out tokens on a request card
The request card showed output tokens twice, in the meta line and as a pill. The pill is gone; the meta line keeps the count and the dollar pill stays.
* feat(sessions): fold subagent sessions into their parent row
The default sessions list (table, JSON, TUI, contributions, desktop) now shows
one row per parent session with its provider-recorded subagents summed in and
listed under subagents. Grouping reuses the work-unit resolver, so only rows
move; totals are unchanged. --by-work-unit keeps the flat rows.
* test: reconcile the session diagnosis with the folded sessions row
* fix(sessions): find and open a parent row by its subagents, count subagents apart from top-level rows
* feat(sessions): explain why one session cost what it did
`codeburn sessions --id <id> --why` reads one Claude Code transcript on
demand and returns where the money went: a verdict, findings ranked by
dollars, spend by prompt with helper (sub-agent) cost stacked, and every
prompt's model calls and tool steps with timing, cost parts and step detail.
Money comes from the parser's own dedupe, turn grouping and calculateCost,
so the session total matches its `sessions` row.
The desktop app opens this as a focused session view when a Claude Code
session is clicked. Transcript content is read on demand only: never cached,
never routed through serve's output memo, never synced or sent in telemetry.
* fix(sessions): audit fixes for the session cost view
Recovery after a failed step stays inside its prompt; neutral note when the
view and the row differ (forked/resumed transcripts); starting-context
estimate compares against the cached prefix; local dates with the end date
when the session spans days; idle gaps that end with a helper reporting back
say so; savings are the difference of the shown figures; singular counts;
more secret patterns (sk_live_/sk_test_, aws_secret_access_key, URL
credentials); a note when the prompt count differs from the row's turns.