Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
ca88682
feat: label Extra Usage as spend on accounts without plan limits
eric-engberg Oct 5, 2026
8f68ebe
refactor: share the cache file lock
eric-engberg Oct 5, 2026
17b24a0
feat: add a daily state file for per-day usage tracking
eric-engberg Oct 5, 2026
64ab09a
feat: track each day's starting extra usage spend
eric-engberg Oct 5, 2026
5268f3e
feat: work out today's extra usage spend during the usage prefetch
eric-engberg Oct 5, 2026
b4f3351
feat: add an Extra Usage Today widget
eric-engberg Oct 5, 2026
f5b4779
fix: count a cached extra usage total for the day it was fetched
eric-engberg Oct 5, 2026
a8fbd4f
test: check fetchUsageData reports the login and fetch time
eric-engberg Oct 5, 2026
afc18f2
feat: track each session's cost and time per day
eric-engberg Oct 5, 2026
17863ac
feat: feed today's session totals and billed spend to widgets
eric-engberg Oct 5, 2026
548e3bd
feat: add a Daily Cost Rate widget
eric-engberg Oct 5, 2026
dc7f708
Merge branch 'main' into feat/extra-usage-spend-label
eric-engberg Oct 6, 2026
4d77fc0
test: cover the Spend label with an edited label
eric-engberg Oct 6, 2026
2558331
Merge branch 'feat/extra-usage-spend-label' into feat/extra-usage-today
eric-engberg Oct 6, 2026
2fd75d9
Merge branch 'feat/extra-usage-today' into feat/daily-cost-rate
eric-engberg Oct 6, 2026
90c425e
refactor: keep the Enterprise wording, drop the Spend label detection
eric-engberg Oct 6, 2026
aafb84e
test: check the picker lists the Extra Usage widgets first, however m…
eric-engberg Oct 6, 2026
3544cfb
Merge remote-tracking branch 'origin/feat/extra-usage-spend-label' in…
eric-engberg Oct 6, 2026
ccf71a2
Merge remote-tracking branch 'origin/feat/extra-usage-today' into fea…
eric-engberg Oct 6, 2026
a8db2b9
test: look for the Extra Usage widgets among the widgets that mention…
eric-engberg Oct 6, 2026
a714d3a
Merge remote-tracking branch 'origin/feat/extra-usage-spend-label' in…
eric-engberg Oct 6, 2026
54d625e
Merge branch 'feat/extra-usage-today' into feat/daily-cost-rate
eric-engberg Oct 6, 2026
aaeeaae
refactor(widgets): share Extra Usage Used and Remaining's code
eric-engberg Oct 7, 2026
507020a
Merge branch 'feat/extra-usage-spend-label' into feat/extra-usage-today
eric-engberg Oct 7, 2026
58225e2
Merge branch 'feat/extra-usage-today' into feat/daily-cost-rate
eric-engberg Oct 7, 2026
e998eec
fix: drop extra usage times stamped while the clock ran ahead
eric-engberg Oct 7, 2026
0bb9029
Merge remote-tracking branch 'origin/feat/extra-usage-today' into fea…
eric-engberg Oct 7, 2026
112c2f1
Merge branch 'main' into feat/extra-usage-today
eric-engberg Oct 9, 2026
b458d33
Merge branch 'feat/extra-usage-today' into feat/daily-cost-rate
eric-engberg Oct 9, 2026
d3fe741
Merge branch 'main' into feat/extra-usage-today
eric-engberg Oct 14, 2026
21b244c
Merge branch 'feat/extra-usage-today' into feat/daily-cost-rate
eric-engberg Oct 14, 2026
2fe7acb
fix(daily-cost): count a resumed, forked or re-logged-in session from…
eric-engberg Oct 15, 2026
22dbd49
fix(daily-cost): settle session records stamped while the clock ran a…
eric-engberg Oct 15, 2026
08bcd82
fix(daily-cost-rate): show billed spend in the account's currency
eric-engberg Oct 15, 2026
4078c94
fix(usage): remove daily.json's temp files when a write fails
eric-engberg Oct 15, 2026
d4c543f
fix(usage): keep today's extra usage spend across a token refresh
eric-engberg Oct 16, 2026
9df92cb
Merge branch 'feat/extra-usage-today' into feat/daily-cost-rate
eric-engberg Oct 16, 2026
69bd152
refactor(usage): tidy the account lookup and the record merge
eric-engberg Oct 16, 2026
7aa9ba9
Merge branch 'feat/extra-usage-today' into feat/daily-cost-rate
eric-engberg Oct 16, 2026
0bda9a9
Merge branch 'main' into feat/extra-usage-today
eric-engberg Oct 30, 2026
c6730b6
Merge branch 'feat/extra-usage-today' into feat/daily-cost-rate
eric-engberg Oct 30, 2026
19aa1f9
Merge branch 'main' into feat/extra-usage-today
eric-engberg Oct 30, 2026
ee568a6
Merge branch 'feat/extra-usage-today' into feat/daily-cost-rate
eric-engberg Oct 30, 2026
9d441e9
Merge branch 'main' into feat/extra-usage-today
eric-engberg Oct 30, 2026
c598fb4
Merge branch 'feat/extra-usage-today' into feat/daily-cost-rate
eric-engberg Oct 30, 2026
226aca6
Merge branch 'main' into feat/extra-usage-today
eric-engberg Nov 5, 2026
e46b365
refactor(usage): ask the profile endpoint once for the account email …
eric-engberg Nov 5, 2026
c30ee97
docs(development): the account email and Extra Usage Today share one …
eric-engberg Nov 5, 2026
556c345
Merge branch 'feat/extra-usage-today' into feat/daily-cost-rate
eric-engberg Nov 5, 2026
f7f67ec
refactor(usage): name the account id before fingerprinting it
eric-engberg Nov 6, 2026
1712c2b
Merge branch 'feat/extra-usage-today' into feat/daily-cost-rate
eric-engberg Nov 6, 2026
4cb57d5
Merge branch 'main' into feat/daily-cost-rate
eric-engberg Nov 6, 2026
2b8ed50
fix: enable label editing for Daily Cost Rate
eric-engberg Nov 6, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion docs/USAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ ccstatusline --version
- **Fast Mode** - Show whether Claude Code's fast mode is on, from the status line's `fast_mode` field. It can render as icon plus text (`⚡ on` / `⚡ off`, the default), an icon with a state dot, plain text, or `fast on/off`, with optional Nerd Font lightning icons. It can hide while fast mode is off, and shows nothing on Claude Code versions that don't report fast mode.
- **Sandbox Status** - Show the effective `sandbox.enabled` value from Claude Code's layered project and user settings. It can render as a glyph, `SB: ON/OFF`, or `Sandbox: ON/OFF`, with optional Nerd Font lock icons. The value is refreshed after `/sandbox` changes, but is best effort when managed or CLI settings override files or sandbox initialization fails.
- **Thinking Effort** / **Vim Mode** / **Skills** - Show Claude thinking effort, the current vim editing mode, and skill activity from hook data. Thinking Effort reads live status JSON first, then `/model` or `/effort` transcript output, then settings fallback; it supports `low`, `medium`, `high`, `xhigh`, and `max`, shows `default` when no effort is set, and marks unknown future values with `?`. Claude Code reports Ultracode as `xhigh` in status line data; it does not expose Ultracode as a separate effort level. Thinking Effort can wrap its output in brackets and optionally color each known effort level separately; both options are off by default.
- **Session Clock** / **Session Cost** / **Session Cost Rate** - Show elapsed session time, the current session cost in USD, and that cost per hour (`Rate: $5.00/hr`). Session Cost Rate divides by the time Claude spent working (API time) by default, or by the whole session with clock time on, and shows nothing until a full minute of that time has passed.
- **Session Clock** / **Session Cost** / **Session Cost Rate** / **Daily Cost Rate** - Show elapsed session time, the current session cost in USD, that cost per hour (`Rate: $5.00/hr`), and today's cost per hour across all of today's Claude Code sessions (`Rate Today: $6.20/hr`). Session Cost Rate divides by the time Claude spent working (API time) by default, or by the whole session with clock time on, and shows nothing until a full minute of that time has passed. Daily Cost Rate divides Claude Code's own session costs by default, or today's billed extra usage spend (as Extra Usage Today shows it, including claude.ai and other machines). It divides by the time Claude spent working across sessions (parallel sessions add up) by default, or by the time any session was running. The hours only ever come from this machine's Claude Code sessions, so heavy claude.ai use reads as a higher rate with billed spend. Totals are kept per Claude Code profile in `~/.cache/ccstatusline/daily.json`, from 00:00 UTC. A session counts from the totals ccstatusline first sees it with, so a resumed or forked session leaves out the totals Claude Code carries over to it.

### Git

Expand Down Expand Up @@ -339,6 +339,7 @@ Widget-specific shortcuts:
- **Git Conflicts**: `z` toggles how a visible conflict-free tree renders (`⚠0` or the clean glyph); `g` edits the conflict and clean glyphs
- **Context % widgets**: `u` toggle used vs remaining display, `p` cycle percentage/short bar/short bar only/line bar
- **Session Cost Rate**: `t` switch between active time (how long Claude spent working, the default) and clock time (the whole session)
- **Daily Cost Rate**: `t` switch between active time (how long Claude spent working, the default) and clock time (how long any session was running); `b` switch between Claude Code's session costs (the default) and billed spend
- **Block Usage / Weekly Usage / Weekly Sonnet Usage / Weekly Opus Usage / Weekly Fable Usage / Spend Limit Usage / Extra Usage Utilization**: `p` cycle percentage/full bar/medium bar/short bar/short bar only/line bar and `u` switch between used and remaining percentage in every display mode. The editor row labels the current direction as `used` or `remaining`, while the `u` helper names the direction it will switch to. Block and weekly usage widgets use `t` to toggle the time cursor in bar modes.
- **Extra Usage Daily Budget**: `w` toggle counting weekdays only (Saturday and Sunday, UTC, are skipped; today always counts)
- **Block Forecast**: `u` switch between projected used and remaining percentage
Expand Down
3 changes: 3 additions & 0 deletions src/ccstatusline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {
loadSettings,
saveSettings
} from './utils/config';
import { prefetchDailyCostIfNeeded } from './utils/daily-cost';
import {
GIT_REVIEW_REFRESH_FLAG,
refreshGitReviewCacheFromCli
Expand Down Expand Up @@ -159,6 +160,7 @@ async function renderMultipleLines(data: StatusJSON, rawData: Record<string, unk
]);
const sessionForecast = computeSessionForecastIfNeeded(lines, usageData, getDefaultSessionUsageHistoryDeps(data, usageData));

const dailyCost = prefetchDailyCostIfNeeded(lines, data);
const tokenMetrics = transcriptAnalysis?.tokenMetrics ?? null;
const sessionDuration = transcriptAnalysis?.sessionDuration ?? null;
const speedMetrics = transcriptAnalysis?.speedMetricsCollection?.sessionAverage ?? null;
Expand All @@ -181,6 +183,7 @@ async function renderMultipleLines(data: StatusJSON, rawData: Record<string, unk
speedMetrics,
windowedSpeedMetrics,
usageData,
dailyCost,
sessionForecast,
claudeStatusData,
accountEmail,
Expand Down
2 changes: 2 additions & 0 deletions src/types/RenderContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import type {
BlockMetrics,
SkillsMetrics
} from '../types';
import type { DailyCostTotals } from '../utils/daily-cost';

import type { AccountEmailResult } from './AccountEmail';
import type { SessionForecast } from './SessionForecast';
Expand Down Expand Up @@ -61,6 +62,7 @@ export interface RenderContext {
speedMetrics?: SpeedMetrics | null;
windowedSpeedMetrics?: Record<string, SpeedMetrics> | null;
usageData?: RenderUsageData | null;
dailyCost?: DailyCostTotals | null;
sessionForecast?: SessionForecast | null;
claudeStatusData?: ClaudeStatusRenderData | null;
accountEmail?: AccountEmailResult; // Email of the account the live OAuth credentials belong to
Expand Down
Loading
Loading