Skip to content

Are Claude Code /btw (aside_question) sidechain costs real or over-counted? #913

@yichao-figma

Description

@yichao-figma

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

  • /btw creates files like agent-aside_question-*.jsonl in the subagents/ directory
  • These files have "isSidechain": true in their metadata
  • They share the same sessionId and 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: true entries
  • Detect that aside_question logs 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
  • /btw is 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions