Repository navigation
Description
Question
Claude Code's /btw feature creates aside_question sidechain log files under subagents/ that appear to re-log the entire conversation history with full usage metadata. ccusage reports these as significant costs, but I'm not sure if these represent real API calls or just duplicate log entries of the same conversation.
Has anyone else noticed this? Are the reported costs for /btw accurate, or is ccusage overcounting?
What I'm seeing
In a session with ~135k context, a single /btw question created a sidechain log with 60 "turns" and ccusage reported ~$6-7 for it — even though /btw is supposed to be a single one-shot question/answer.
In a longer session (~700k context), multiple /btw uses created sidechain logs with 1,000+ "turns" each. ccusage reported very high costs for the subagents pool, which seems disproportionate for simple side questions.
Observations
/btwcreates files likeagent-aside_question-*.jsonlin thesubagents/directory- These files have
"isSidechain": truein their metadata - They share the same
sessionIdand timestamps as the parent conversation - Every prior assistant message from the main conversation appears re-logged in these files with
cache_read_input_tokens - ccusage sums up all these entries, which may be double-counting tokens already reported in the main session
Possible issue
If these sidechain logs are just mirroring the parent conversation's history (not separate API calls), then ccusage may need to either:
- Filter out / deduplicate
isSidechain: trueentries - Detect that
aside_questionlogs share the same session and timestamps as the parent
Or if these are real separate API calls, that would be good to know too — it would mean /btw is much more expensive than expected.
Environment
- Claude Code CLI
/btwis a recently added feature
Additional evidence from statusline
Claude Code's statusline tracks session cost in real-time via cost.total_cost_usd from the API response, independent of JSONL log parsing. After a /btw call, the statusline cost increased by ~$0.08, while ccusage reported ~$10.28 for the same call. Across three /btw tests in the same session, ccusage reported $6.67, $9.66, and $10.28 (growing linearly with conversation length), while the statusline showed a consistent ~$0.08 increase each time. This confirms the overcounting — ccusage is re-summing the entire conversation history logged in each sidechain file rather than counting only the incremental API cost.
Activity
[-]Are Claude Code /btw (aside_question) sidechain costs real or double-counted?[/-][+]Are Claude Code /btw (aside_question) sidechain costs real or over-counted?[/+]Astro-Han commentedon Mar 31, 2026
Your analysis is correct. The sidechain files (agent-aside_question-*.jsonl) log the full conversation history because /btw runs in isolation and needs the entire context to answer, so each file includes cache_read_input_tokens for every prior turn. ccusage sums all of those entries, which means each /btw call effectively re-counts "total session cost so far" rather than just the incremental API cost.
cost.total_cost_usd from the statusline is ground truth: it's the incremental cost returned directly from each API response. Your $0.08 vs $10.28 numbers are consistent with that hypothesis.
The fix on ccusage's side would be deduplication: either filter isSidechain: true entries entirely, or detect that sidechain session IDs overlap with the parent and only count the delta.
docs(claude): document sidechain dedupe
fix(claude): dedupe sidechain replayed usage