Feature request: historical cost/usage tracking across sessions

Status Open
Maintainer reply None cached
Activity 14 comments · opened Jul 16, 2026

Feature Request

Add the ability to view historical cost and token usage across sessions — not just the current session.

Problem

The /cost command only shows usage for the current session. There's no way to see weekly or monthly spending, which makes it hard to track and budget Claude Code usage over time.

Proposed Solution

Options (any or all would be valuable):

  1. /cost --week / /cost --month — aggregate cost data across sessions for the last 7 or 30 days
  2. /cost --history — show a table of per-session costs with dates
  3. Persistent local log — automatically log session cost summaries to a local file (e.g. ~/.claude/usage-history.json) so users can query or export their own data
  4. Session-end hook data — expose cost/token data as environment variables in a Stop or SessionEnd hook, so users can log it themselves

Why This Matters

  • Budget tracking for teams and individuals
  • Identifying which projects or tasks are most expensive
  • Comparing usage patterns over time
  • Required for any kind of chargeback or cost allocation

Currently the only workaround is manually noting /cost output before ending each session.

---

🤖 Generated with Claude Code

View original on GitHub ↗

This issue has 14 comments on GitHub. Read the full discussion on GitHub ↗