Skip to content

Add Claude local usage heatmap - #147

Merged
badcuban merged 3 commits into
mainfrom
agent/claude-local-usage-heatmap
Aug 12, 2026
Merged

Add Claude local usage heatmap#147
badcuban merged 3 commits into
mainfrom
agent/claude-local-usage-heatmap

Conversation

@badcuban

Copy link
Copy Markdown
Collaborator

Summary

  • Import Claude Code daily token activity from the paired machine's local stats cache and JSONL transcripts.
  • Retain and merge a rolling 366-day provider history, including calendar-based retention for Codex.
  • Add account/local coverage metadata to the provider usage contract.
  • Render Claude's per-machine Daily, Weekly, and Cumulative heatmap in the provider Usage tab, with a link to the all-machines Usage page.
  • Improve the dark-mode hover state for the all-machines link.

Why

Claude's OAuth usage response exposes current subscription windows but not historical daily token totals. As a result, the Claude provider card could show rate limits but could not offer the token activity view available for Codex. The provider now derives that view from Claude Code's local history while keeping the aggregate Usage page as the cross-machine source.

The existing Codex normalization also limited history to the last 30 active buckets, which made sparse activity disappear as new days arrived. Retention is now based on a 366-day calendar window.

Impact

Users can inspect Claude activity for the paired machine directly under Settings → Providers → Claude → Usage. The existing Usage page remains the place to inspect activity across every connected machine.

Validation

  • vp fmt
  • vp lint
  • vp run typecheck
  • vp run '@threadlines/server#test' ProviderRegistry — 77 passed
  • vp run '@threadlines/web#test' providerUsage — 26 passed
  • vp run '@threadlines/contracts#test' server — 7 passed
  • vp run '@threadlines/web#test:browser' SettingsPanels — 38 passed
  • vp run '@threadlines/web#test:browser' — 403 passed
  • Verified the local Claude aggregate against all 143 readable transcript files on the development machine.

@vercel

vercel Bot commented Aug 12, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
threadlines Skipped Skipped Aug 12, 2026 5:29am

Request Review

@github-actions github-actions Bot added size:XL vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. labels Aug 12, 2026
@badcuban
badcuban marked this pull request as ready for review August 12, 2026 05:43
@badcuban
badcuban merged commit af5040c into main Aug 12, 2026
20 checks passed
@badcuban
badcuban deleted the agent/claude-local-usage-heatmap branch August 12, 2026 05:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XL vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant