Skip to content

[Phase 5.2] Cost analytics: per-task and per-agent breakdowns + task board cost badge #558

@frankbria

Description

@frankbria

Goal

Extend the Costs page with detailed breakdowns, and add a cost badge to task board cards.

Background

Follows the summary page (#557). Users need to know which tasks are expensive and which agents drive cost.

Scope

Costs page additions (within /costs):

  • Top 10 most expensive tasks table: task title, agent type, input tokens, output tokens, cost — link to task detail
  • Cost by agent type breakdown: bar or pie chart comparing Claude Code vs Codex vs OpenCode vs ReAct
  • Input vs output token split per period (stacked bar or summary row)
  • Backend: GET /api/v2/costs/tasks?days=30 and GET /api/v2/costs/by-agent?days=30

Task board (/tasks):

  • Add a small cost badge to each task card (e.g., $0.12) if cost data exists for that task
  • Tooltip on hover showing token breakdown
  • Zero cost or no data = badge hidden (not shown as $0.00)

Acceptance criteria

  • Top-10 table renders with correct data
  • Agent breakdown chart renders
  • Task cards show cost badge where data exists
  • npm test and npm run build pass

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestphase-5Phase 5: Advanced Features & Polish

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions