Skip to content

v0.2.3 — Fix crash on incomplete stats-cache.json

Choose a tag to compare

@Arindam200 Arindam200 released this 03 Apr 10:32
· 67 commits to main since this release

Bug Fixes

Root cause

Some users' ~/.claude/stats-cache.json files are missing modelUsage, dailyActivity, or hourCounts fields — common on fresh Claude Code installs, Windows machines, or when the cache hasn't fully populated yet. This caused the API routes to crash mid-execution, surfacing as:

Cannot read properties of undefined (reading 'totalInputTokens')

Fixes

  • /api/stats — guard stats.modelUsage ?? {} and stats.dailyActivity ?? []
  • /api/costs — guard stats.modelUsage ?? {}
  • /api/activity — guard stats.dailyActivity ?? [] and stats.hourCounts ?? {}
  • overview-client — added !data.computed check before destructuring so the loading skeleton shows instead of crashing if the API response is incomplete