feat(usage): active working-time tracking and stats#16
Closed
writingdeveloper wants to merge 1 commit into
Closed
Conversation
Surface the "time spent" that Claude shows per terminal (⏱️), aggregated across sessions. Active time = sum of consecutive message-timestamp gaps within a 5-minute idle cap, so overnight/away stretches are excluded (meaningful working time, not the full first→last span). - usage.ts: ACTIVE_GAP_CAP_MS, activeMsFromTimestamps(), formatDuration() - usageScan.ts: collect per-session timestamps, aggregate active ms per project and globally, honoring the date-range filter - types.ts: UsageReport.activeMs + ProjectUsage.activeMs - usageView.ts: "Active time" summary stat + sortable "Time" column - locales: usage.active_time / usage.col_time (ko/en/ja/zh) - tests: gap-capping, sorting, formatting, scanner aggregation Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Owner
Author
|
Landed on main via local squash-merge (05b300e) to keep authorship on the noreply identity. Releasing as v1.0.3. |
writingdeveloper
added a commit
that referenced
this pull request
Jun 10, 2026
Surface the per-terminal "time spent" (⏱️) aggregated across sessions. Active time = sum of consecutive message-timestamp gaps within a 5-minute idle cap, so overnight/away stretches are excluded (real working time, not the full first→last span the terminal shows). - usage.ts: ACTIVE_GAP_CAP_MS, activeMsFromTimestamps(), formatDuration() - usageScan.ts: per-session timestamps -> active ms per project + global, honoring the date-range filter - types.ts: UsageReport.activeMs + ProjectUsage.activeMs - usageView.ts: "Active time" summary stat + sortable "Time" column - locales: usage.active_time / usage.col_time (ko/en/ja/zh) - tests: gap-capping, sorting, formatting, scanner aggregation Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds the per-session "time spent" that Claude Code shows in each terminal (⏱️) to DevDeck, aggregated across sessions in the Usage view.
"Active time" = sum of consecutive message-timestamp gaps within a 5-minute idle cap. Overnight / stepped-away stretches are excluded, so the number reflects real working time rather than the full first→last span the terminal shows (e.g. one session: 168h span → ~14h active).
Changes
shared/usage.ts:ACTIVE_GAP_CAP_MS,activeMsFromTimestamps(),formatDuration()main/usageScan.ts: collect per-session timestamps, aggregate active ms per project + globally, honoring the date-range filtershared/types.ts:UsageReport.activeMs+ProjectUsage.activeMsrenderer/usageView.ts: "Active time" summary stat + sortable "Time" columnusage.active_time/usage.col_time(ko/en/ja/zh)Test
vitest run→ 145 passed (was 137; +8)tsc --noEmitclean,npm run buildclean🤖 Generated with Claude Code