Skip to content

feat: per-task cost & token dashboard #46

Description

@kovtcharov

Summary

`backend/src/usage-reporter.ts` already has scaffolding for token reporting, but it's gated behind the `USAGE_DASHBOARD_URL` env var and only forwards to a remote endpoint — there's no in-app dashboard. Build a local per-task and per-workspace cost view so users can see what each task is burning in real time.

Scope

Backend

  • Capture token usage from:
    • Claude Code CLI subprocesses — parse usage from their stream-json output (`conversation-parser.ts` is the natural seam)
    • Direct Anthropic SDK calls in `supervisor-chat.ts`, `voice-supervisor.ts`, `llm-service.ts`
  • Persist per-task aggregates (input/output/cache-read/cache-write tokens, dollars-spent estimate by model)
  • Optional: emit OpenTelemetry GenAI semantic conventions for export to Langfuse / LangSmith / Braintrust

Frontend

  • Per-task: small badge in the task header showing tokens + estimated $
  • Per-workspace: aggregate panel
  • Settings: optional budget cap per workspace with soft warning + hard stop

Why

  • Today users have no visibility into what tasks cost
  • Pairs with the prompt-caching issue — you need the dashboard to see if caching is actually working
  • Natural extension point for an OTel exporter once OpenTelemetry GenAI conventions stabilize

Out of scope

  • Per-user/multi-tenant budgets (single-user assumed)
  • Historical cost trends / charting (start with current-state numbers)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions