Skip to content

[v1.5] Cost tracking per account/orchestrator #2

@webdevtodayjason

Description

@webdevtodayjason

Background

Power-user feedback (via Grok): no visibility into per-account / per-orchestrator cost. Users want to know what each session is costing them in the same way they can see rate-limit headroom.

Signal sources

Anthropic returns input/output token counts in response headers. Claude Code already writes per-session JSONLs at ~/.claude-<alias>/projects/<project>/<session>.jsonl containing every message with token metadata. The ~/.claude/rate-limit-events.log already captures session metadata. So the data is there — the dashboard just doesn't surface it.

Two-tier ship

Tier 1 — observation only

  • Parse session JSONLs for input/output token counts
  • Multiply by Anthropic's published per-model rates
  • Add a "Cost today" / "Cost this week" card to each account on the dashboard
  • HTTP API: GET /api/billing returns per-account / per-session breakdown
  • MCP tool: mcp__subctl__billing so agents can self-report cost

Tier 2 — subctl billing CLI

  • subctl billing — show today + this week aggregated
  • subctl billing --account <alias> — filter
  • subctl billing --session <name> — per-orchestrator
  • subctl billing --csv — exportable

Non-goals

  • Cost projection / budgeting alerts (could be v1.6)
  • OpenAI pricing for Codex (separate, Tier 1.5 once Codex provider is GA)

Verdict

Should ship in v1.5. Medium effort, high visibility. Sets up budgeting features later.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestv1.5Targeted for v1.5 milestone

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions