Skip to content

heatmap joins the family - #91

Merged
hamzafer merged 4 commits into
mainfrom
heatmap
Oct 15, 2026
Merged

hamzafer merged 4 commits into
mainfrom
heatmap

Conversation

@hamzafer

Copy link
Copy Markdown
Owner

What changed

A new mod, heatmap: /heatmap opens a GitHub-style grid of your Claude Code time, one square per day, in Claude orange.

heatmap

  • Cell: active minutes per local day (pauses over 5 minutes add nothing, a pause over midnight is split)
  • Under the grid: current and best streak, active hours and sessions, peak weekday and hour, top 3 projects
  • Keys: p switches between all projects and this repo, arrows move a day cursor (after a click, as in snake), q closes
  • Own ledger: backfills from the session logs once, then keeps one line per day per project in ~/.claude/heatmap/days.jsonl, so the grid outlives the 30-day log cleanup. Older days are never rewritten
  • Toast when a streak reaches 7, 30 or 100 days
  • Reads logs with grep (logs can pass the 4 MiB read limit). A full backfill of 1.4 GB of logs takes about a second

Spec: docs/superpowers/specs/2026-10-15-heatmap-design.md. Screenshot from sample data with generic project names.

Checklist

  • claude plugin validate mods/heatmap passes
  • claude plugin test mods/heatmap passes (23 tests)
  • Changed a mod: version bumped in its plugin.json and in .claude-plugin/marketplace.json
  • New mod: entry in .claude-plugin/marketplace.json
  • New mod: README table row and docs/mods.md notes
  • Site page, index row, JSON-LD and sitemap entry

🤖 Generated with Claude Code

A new mod: /heatmap opens a GitHub-style grid of active minutes in
Claude orange, with the streak, peak day and hour, and top projects.
It keeps its own daily ledger, so the grid outlives the 30-day log
cleanup. Docs, site page and screenshot from sample data.
Refresh from the ledger's last day, so days a crashed session never
saved are filled in. Count a resumed session's copied messages once.
An empty ledger backfills again, a failed refresh says why, a cut grep
read is logged, and the cursor stays on its day across a resize.
@hamzafer

Copy link
Copy Markdown
Owner Author

Review outcomes

Codex (gpt-5.6-luna, one pass): no actionable issues.

Sonnet review, fixed in 286c85a:

# Finding Outcome
1 Days lost when session.end never runs Fixed: refresh from the ledger's last day (yesterday at the latest), reading logs touched since
2 Resumed sessions double-count Confirmed on real logs (~8% of message times appear in two logs). Fixed: each message time counts once per project. Parallel sessions still both count, now documented
3 Empty ledger skips backfill; failed refresh loads forever Fixed: an empty ledger backfills, and the pane shows the error
4 Silent grep truncation Fixed: logged
5 DST edge on the 48h window Fixed by 1 (the window is gone)
6 Milestone toast can come a session late Kept: the spec toasts at session start. Late, never wrong
7 Cursor moves to another day on resize Fixed: the cursor is anchored to a date
nits -- before paths, cwd grep timeout Fixed. Long hashed project folders: left as is (rare)

New tests cover 1, 2 and 3 (26 tests in all). A Sonnet agent is verifying the fixes.

A refresh replaces an old row only with a fresh one for the same day and project. The earliest message is found with a loop, and a tie goes to the shorter log, the original a resume copied from.
@hamzafer

Copy link
Copy Markdown
Owner Author

Fix check (Sonnet): 3, 5, 6 and 7 verified. Three follow-ups it found are fixed in bea1a7d: a refresh no longer drops an old row whose logs are gone (a fresh row only replaces the same day and project), the earliest message is found with a loop instead of Math.min(...times) (argument limit on long logs), and a tie goes to the shorter log (the original a resume copied from). isStdoutTruncated is in the engine's process.run result type. 27 tests pass.

@hamzafer
hamzafer marked this pull request as ready for review October 14, 2026 22:50
@hamzafer
hamzafer merged commit a18e333 into main Oct 15, 2026
1 check passed
@hamzafer
hamzafer deleted the heatmap branch October 15, 2026 05:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant