Skip to content

feat(usage): active working-time tracking and stats#16

Closed
writingdeveloper wants to merge 1 commit into
mainfrom
feat/active-time-stats
Closed

feat(usage): active working-time tracking and stats#16
writingdeveloper wants to merge 1 commit into
mainfrom
feat/active-time-stats

Conversation

@writingdeveloper

Copy link
Copy Markdown
Owner

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 filter
  • shared/types.ts: UsageReport.activeMs + ProjectUsage.activeMs
  • renderer/usageView.ts: "Active time" summary stat + sortable "Time" column
  • locales: usage.active_time / usage.col_time (ko/en/ja/zh)
  • tests: gap-capping (incl. exact-cap boundary), sort/format, scanner aggregation

Test

  • vitest run → 145 passed (was 137; +8)
  • tsc --noEmit clean, npm run build clean

🤖 Generated with Claude Code

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>
@writingdeveloper

Copy link
Copy Markdown
Owner Author

Landed on main via local squash-merge (05b300e) to keep authorship on the noreply identity. Releasing as v1.0.3.

@writingdeveloper writingdeveloper deleted the feat/active-time-stats branch June 10, 2026 20:32
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>
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