Element guide

Claude Code statusline with session duration

Track how long the current Claude Code session has been running, right in the terminal status bar.

Open the builder

Why a session timer?

Claude Code reports `cost.total_duration_ms` on every render — the total wall-clock time the session has been open. Surfacing that as a duration in your statusline makes deep work sessions visible without leaving the terminal.

statusline.sh exposes two formats. Pick `human` for compact output like `8m 47s` or `1h 12m`, or `hms` for a colon-padded clock like `1:12:08`. Internally both are lowered to the `duration_human` / `duration_hms` computed expressions so the bash, PowerShell, and browser backends stay byte-identical.

How it looks

The preview below pairs the model, the active directory, a small clock glyph, and the running duration in cyan. Drop in a Static prefix like `up ` for natural reading, or pair it with the Cost element to get a quick read on time-and-money spent per session.

How to add it

Drag the Session Duration element from the palette, choose `human` or `hms`, and style it. The live preview uses realistic mock durations so you can pick a format that stays compact even after several hours.

Keep exploring