Dashcam
Core Concepts

Window Management

Track and manage 5-hour subscription windows automatically.

Window Management

Claude Code's Max subscription grants a 5-hour usage window. When that window expires, you wait for a cooldown before the next one begins. If you are running agents overnight — or stacking back-to-back sessions throughout the day — tracking these windows manually is tedious and error-prone. You either burn time checking usage dashboards, or your agent gets cut off mid-task because you lost track.

Dashcam tracks subscription windows automatically. A color-coded countdown timer lives in the status bar, warning notifications fire at configurable thresholds, and an optional graceful stop prevents your agent from being killed mid-thought at the 5-hour mark.

What Is a Window?

A window is a single 5-hour Claude Code subscription usage period. Dashcam detects the start of a window from the first SessionStart hook it receives after a cooldown (or after initial startup). From that moment, a countdown timer begins.

Within a single window, you might have multiple sessions — you could start and stop Claude Code several times, or run parallel agents via Claude Squad. Dashcam groups all of these sessions under one window.

Window: 5 hours
├── Session 1: 0:00 – 1:30  (auth refactor)
├── Session 2: 1:45 – 3:20  (test suite)
└── Session 3: 3:25 – 4:55  (deployment config)

The State Machine

Every window progresses through a deterministic set of states:

IDLE ──SessionStart──▶ ACTIVE ──4h mark──▶ WARNING ──4h55m──▶ WINDING_DOWN ──5h──▶ COOLDOWN ──timer──▶ IDLE
StateDescriptionStatus Bar Color
IDLENo active window. Waiting for a session to start.Gray
ACTIVEWindow is running. More than 1 hour remains.Green
WARNINGLess than 1 hour remains. Notifications begin firing.Yellow / Orange
WINDING_DOWNLess than 5 minutes remain. Graceful stop may trigger.Red (pulsing)
COOLDOWNWindow expired. Waiting before next window is available.Gray (with timer)

The state machine persists to SQLite. If the daemon restarts mid-window, it resumes tracking from where it left off — no time is lost.

The Countdown Timer

The status bar displays a countdown timer that is always visible while a window is active:

┌────────────────────────────────────────────────────────────┐
│ ● Active  │  2 agents  │  89 events  │  $0.32  │  3h 12m  │
└────────────────────────────────────────────────────────────┘

The timer color shifts as time runs out:

Remaining TimeColorVisual Treatment
More than 1 hourGreenSolid, calm
30 – 60 minutesYellowSolid, attention
10 – 30 minutesOrangeSolid, urgency
Less than 10 minutesRedPulsing animation

This gradient from green to red is designed to be visible in peripheral vision. You should never be surprised by a window expiring.

Warning Notifications

At configurable time thresholds, Dashcam fires desktop notifications (via the browser Notifications API) and renders in-dashboard alerts:

~/.dashcam/config.json
{
  "window": {
    "duration": 18000,
    "warnings": [14400, 16200, 17100],
    "windDownAt": 17700,
    "cooldownDuration": 300
  }
}

With the defaults above:

ThresholdTime RemainingNotification
14400s (4h)1 hour"1 hour remaining in this window"
16200s (4h30m)30 minutes"30 minutes remaining — consider wrapping up"
17100s (4h45m)15 minutes"15 minutes remaining — wind down soon"

You can add or remove thresholds by editing the warnings array. Times are in seconds from window start.

Graceful Stop

Graceful stop is opt-in and disabled by default. Enable it only if you want Dashcam to actively manage your agent's lifecycle.

When autoManage is set to true in your configuration, Dashcam will attempt to gracefully stop running agents at the windDownAt threshold (default: 4h55m, leaving 5 minutes of buffer).

The graceful stop sequence:

  1. Dashcam captures a work summary from the current session state
  2. A stop signal is sent to the agent
  3. The agent's context is preserved so a future session can resume where it left off
  4. The window transitions to COOLDOWN
~/.dashcam/config.json (opt-in)
{
  "window": {
    "autoManage": true,
    "autoRestartAfterCooldown": false
  }
}

If autoRestartAfterCooldown is also enabled, Dashcam will start a new session once the cooldown period expires — creating a fully autonomous loop.

Window History

The History view in the sidebar provides a calendar interface showing all recorded windows:

  • Each day displays its windows as colored blocks on a horizontal time axis
  • Click a day to expand its windows
  • Click a window to see the sessions it contains
  • Each window shows aggregate stats: total events, estimated cost, agents used, screenshots captured

This gives you a bird's-eye view of your agent usage patterns. You can see at a glance which days were heavy (multiple back-to-back windows) and which were light (a single short session).

Window data is stored in the windows table in SQLite with indexes on started_at and is_active, so calendar queries resolve in under 50ms even with months of history.

On this page