github Arindam200/cc-lens v0.2.3
v0.2.3 — Fix crash on incomplete stats-cache.json

latest releases: v0.4.0, v0.3.3, v0.2.8...
2 months ago

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

Don't miss a new cc-lens release

NewReleases is sending notifications on new releases.