github Arindam200/cc-lens v0.4.0
v0.4.0: Team Mode, Savings Insights, Wrapped, and Tasks

3 days ago

Highlights

v0.4.0 is the biggest release yet: 83 files changed and nearly 8,000 lines added since v0.3.3. The headline features are a zero-infrastructure team mode, a savings insights engine with budgets, a Wrapped share card, and a major performance overhaul of the API layer.

๐Ÿ‘ฅ Team mode, zero infrastructure

cc-lens can now aggregate usage across a whole team without a server or database. Each member exports a redacted snapshot (.cclens-team.json) that strips prompts, full filesystem paths, and timing series by default, and drops it into a shared folder (CC_LENS_TEAM_DIR, default ~/.cc-lens/team). The new /team dashboard shows per-member cost, tokens, and cache hit rate, cost over time stacked by member, and Claude Code version skew across the team.

Prefer pushing over shared folders? Run any cc-lens instance as a hub and have members run cc-lens push --to <hub-url>. The hub validates and re-redacts every payload server side, so crafted payloads cannot smuggle extra fields into the team store, and it fails closed: a bearer token (CC_LENS_TEAM_TOKEN) is required unless you explicitly opt into tokenless local mode.

Team mode also ships governance views:

  • Per-member adoption of plan mode, agents, skills, MCP, and web tools, as a share of each member's sessions with cost per session
  • Idle badges for members inactive 14+ days
  • A team-wide MCP server inventory: which servers are in use, call volume, and which members use them

See docs/TEAM.md for setup, including a cron-friendly push example.

๐Ÿ’ก Savings insights, budgets, and spend alerts

The new /insights page analyzes your usage and estimates where money is being left on the table: low cache hit rates, premium models on light sessions, compaction thrash, and subscription plan fit, each with a conservative monthly dollar estimate. You can set a monthly budget and get a pacing projection for the current month. Spend spikes (3x the trailing 7-day median) surface on /insights and as a quiet banner on /costs.

๐ŸŽ Wrapped

/wrapped renders a yearly share card: sessions, tokens, API value, streak, top project, top tool, top model, and busiest hour, downloadable as a crisp 2x PNG. Built from aggregates only, so nothing sensitive ends up in the image.

โœ… Tasks page

Recent Claude Code versions replaced TodoWrite with TaskCreate/TaskUpdate, which persist tasks as one JSON file each under ~/.claude/tasks/<session-id>/. The new /tasks page surfaces them: per-session task lists with status icons, completion progress, project attribution, and a link straight into the session replay. Thanks to @dstorozhuk for the original reader in #23.

๐Ÿ“จ Terminal digest

cc-lens digest [--days n] [--team] [--dry-run] prints a formatted usage summary in the terminal: spend, top projects or members, cache hit rate, potential savings, budget pace, and spike alerts. /api/digest serves the same summary for local or team scope.

โšก Major API performance overhaul

At scale (3,000+ session files), every API request used to reparse the entire ~/.claude/projects/ tree. Parsed JSONL is now cached by file mtime, sessions are streamed line by line instead of buffered whole, and enrichment fields are extracted in a single pass. On a 3,585-file dataset, /api/sessions drops from about 2 minutes to a few seconds cold and under 100ms warm, with /api/costs seeing similar gains.

๐Ÿ’ฐ Pricing accuracy

  • Sessions are now priced by their actual per-model usage instead of assuming a single default model, so mixed-model sessions and the costs, projects, and insights views all agree
  • Added pricing for Fable 5 and Opus 4.8, plus full Opus 4.7 support across charts and labels
  • Fixed prefix matching so date-suffixed legacy model ids resolve to the correct legacy rates
  • Cache-creation tokens are now counted in Wrapped totals

๐Ÿ–ฅ Dashboard improvements

  • Live sessions panel on the overview: running Claude Code sessions with status dots and auto-refresh
  • AI-generated session titles shown in session lists and the replay view
  • Sessions sort and filter by last activity instead of start time, so active work resurfaces
  • Project trend analysis on the projects page
  • Custom date ranges are now inclusive of the end date
  • First-load errors show on the overview instead of an endless skeleton

๐Ÿ”’ Security hardening

  • Team push endpoint requires a token unless tokenless mode is explicitly enabled
  • Exported timestamps are coarsened to the hour to reduce fingerprinting
  • GitHub Actions pinned to commit SHAs with persisted credentials disabled
  • Config writes are atomic and budget values are validated
  • Server filesystem paths are kept out of API responses

๐Ÿงช Tests and CI

First real test suite: vitest covering pricing, formatters, session parsing, redaction, team aggregation, and push auth, running in CI on a Node 20/22 matrix. Engines bumped to Node >= 20. Also new: LICENSE, contributor guide, and privacy docs.

๐Ÿ› Fixes

  • Eliminated the dark-mode flash on page load
  • Worked around the Turbopack HMR ChunkLoadError in dev
  • Stale project path cache entries are now evicted instead of returned forever
  • Session metadata fields are preserved correctly when merging JSONL and meta sources
  • Export and budget-save failures are surfaced instead of failing silently

Full diff: v0.3.3...v0.4.0

Don't miss a new cc-lens release

NewReleases is sending notifications on new releases.