cctally 1.57.1 → 1.59.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +39 -0
- package/README.md +78 -46
- package/bin/_lib_pricing.py +14 -2
- package/dashboard/static/assets/index-BatfACUX.css +1 -0
- package/dashboard/static/assets/index-VUPDfWul.js +80 -0
- package/dashboard/static/dashboard.html +2 -2
- package/package.json +1 -1
- package/dashboard/static/assets/index-CIMIZmQ2.js +0 -80
- package/dashboard/static/assets/index-D3Xnfr7K.css +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,45 @@ based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
|
|
|
5
5
|
|
|
6
6
|
## [Unreleased]
|
|
7
7
|
|
|
8
|
+
## [1.59.0] - 2026-07-02
|
|
9
|
+
|
|
10
|
+
### Changed
|
|
11
|
+
- Dashboard detail modals now scale their charts and tables to the real data instead of collapsing on it. The Cache Report hit-% timeline auto-zooms its y-axis to the data band, so a line clustered at 96–98% shows real day-to-day variation and the ±5pp median band is visible instead of pinning flat to the top of a fixed 0–100% axis. The Projects chart switches from an unreadable near-solid stacked area to a ranked top-N + "(other)" horizontal-bar view when one project dominates the window (each bar still drills into that project), and the stacked-area mode gains y-axis labels. The Forecast range bar gets brighter, outlined zones, a 0→110% scale, a "now ▸" marker at the current weekly usage, and a legend. The Trend chart's secondary "used %" line gains its own right-hand axis, and the whole chart becomes interactive with hover- and keyboard-focus tooltips (week · $/1% · used %). A single-model session collapses its redundant "Models" and "Cost by model" sections into one "Model · … · $…" line, and the empty Recent Alerts state becomes a teaching gauge showing current usage against the configured fire thresholds. On mobile, the Cache Report daily table reflows into labeled cards instead of unlabeled number run-ons and its header no longer truncates to "Cache ⋯". Every panel modal now lands keyboard and screen-reader focus on its heading when it opens (#250).
|
|
12
|
+
- Dashboard dates and labels now read consistently and say what they mean. Every human-facing date and timestamp renders in one style — the Session modal's Started / Last activity and the header freshness tooltip localize to your display timezone ("Jun 28 12:08 +03") instead of leaking a raw UTC ISO stamp, and every Cache Report date (daily table and mobile cards, today's spotlight, and the Net-$ chart axis) reads "Jun 29" instead of three competing "2026-06-29" / "06-29" forms. The Trend view states a single, self-consistent week count derived from the data instead of contradicting itself with a hardcoded "12" / "8", and its chart median line now names its window ("10-wk median $26.93") so it is no longer confused with the hero's separate "4-week median". The Projects table renames its two percent columns to state what they actually measure — "Used pp" (percentage-points summed across the window, so a 165 no longer reads as a broken percentage) and "Cost share" — each with a hover tooltip spelling out the definition. The active 5-hour Block projection now reads "191 min left" instead of "191M LEFT" (which looked like millions under the uppercase label), and the Cache Report by-project list shows plain repo basenames ("cctally-dev") with the full path on hover (#251).
|
|
13
|
+
- Dashboard Settings overlay redesigned into one predictable deferred-commit form: every edit is now staged with a "Save · N changes" badge (Save is disabled until you actually change something) and per-section change markers, and the Reset buttons no longer silently discard your other pending edits — closing a long-standing data-loss trap where a reset applied instantly and closed the sheet, dropping any unsaved timezone/alerts/sort/filter edits. Disabled rows (the Codex budget toggles when no Codex budget is set) now read as dimmed, Alerts are grouped into Threshold / Budget / Test with the projected-weekly toggle nested under its master, the three scattered Reset buttons are consolidated into one "Restore defaults" section with explicit non-overlapping scopes, the Save/Cancel bar is now sticky on desktop as well as mobile, and an accidental Esc or backdrop click while you have unsaved changes now asks before discarding (#252).
|
|
14
|
+
- Dashboard chrome and controls are now more discoverable, legible, and accessible. The Settings (⚙) and Help (?) icons are shown in the desktop header instead of being reachable only via keyboard shortcuts, and the sync-freshness indicator reads in plain language ("synced 8m ago" rather than "synced 480s ago") and escalates colour as it ages — neutral when fresh, amber past 5 minutes, red past 30 — with a matching freshness dot surfaced on mobile where the text is hidden. The Doctor chip reconciles to the freshest report when you open its modal (so it no longer under-reports a failure the modal is already showing), and the Doctor category headers gain an expand/collapse caret. In Recent Sessions, search now highlights the matched text in-cell and gives the current match a distinct emphasis with `aria-current` instead of one uniform wash across every match, and on mobile the search box drops to its own full-width row so a remembered-filter chip can no longer crush it to a sliver. Sortable table headers show a dim glyph at rest so they look sortable before you click, the Sessions control buttons gain the standard 2px accent focus ring, the Doctor and Basket chips now meet the 44px mobile touch target, the Weekly/Monthly/Projects modal rows are keyboard-selectable (Tab, then Enter/Space), and the Help overlay's key/description columns are tightened for readability (#253).
|
|
15
|
+
- Dashboard's Daily, Weekly, and Monthly views are now one **History** modal with a Day / Week / Month toggle, opened from a single "History" card (the daily-usage heatmap) and a single keyboard shortcut instead of three separate cards and shortcuts. All three periods share one mini-bar navigator — Weekly and Monthly gain the visual navigator the Daily view already had — and the per-period detail adopts the Projects drill's cleaner presentation (per-model cost bars and a keyboard-hint footer). The up/down arrows and the navigator's ‹/› buttons step through the period timeline, the Weekly/Monthly table is now sortable by any column with its previously unlabeled "Δ" column now reading "Δ cost", and the Daily navigator's "today" axis label no longer duplicates the last date. Your last-used period is remembered between opens, and clicking a day in the heatmap still opens that exact day (#254).
|
|
16
|
+
- Dashboard freshness readouts now all speak the same plain language: the Current Week hero's "as of" pill and the Doctor report's "Latest snapshot" line read "1d 3h ago" or "27m ago" instead of a raw seconds count like "97928s ago", finishing the humanization started on the sync-freshness chip in #253 — and any freshness older than a day now reads in days-and-hours ("1d 3h ago") rather than a large hour count (#259).
|
|
17
|
+
- Dashboard Session and 5-hour Block detail modals now present their per-model cost breakdown in the same one-row-per-model format the History cards use — a colour-coded model chip, a bar sized to that model's cost relative to the top model, and the dollar cost — replacing each modal's older one-off stacked bar and separate legend so the breakdown reads consistently everywhere. The Session modal also drops its now-redundant standalone "Models" chip row, since the cost breakdown already labels every model (#260).
|
|
18
|
+
|
|
19
|
+
### Fixed
|
|
20
|
+
- Dashboard Settings overlay no longer overwrites a pending edit when a concurrent same-field change arrives from another browser tab or a CLI `cctally config set` while the panel is open — the incoming value is adopted only for fields you have not touched since the last sync, so your in-progress timezone, alerts, notifier, or viewer-toggle edit is kept and the "Save · N changes" badge stays accurate; untouched fields still re-seed live as before (#258).
|
|
21
|
+
- Dashboard Forecast modal: the two end-of-week projection pills no longer overlap on narrow and mobile widths — a hard pixel min-gap now pushes them apart (collapsing to a single "low–high%" range pill only when they genuinely cannot fit), and the mobile scale labels no longer crowd into "100%110%" (#250).
|
|
22
|
+
- Dashboard modal polish follow-ups to #250: on mobile the Projects ranked-bar view (shown when one project dominates the window) now wraps each bar's label to its full project name instead of truncating it, so long names are readable on touch where there is no hover tooltip; the Forecast range bar reflows its projection pills immediately when the modal is resized instead of waiting for the next data refresh; and the empty Recent Alerts teaching gauge now gives interior thresholds a distinct middle tone (amber → orange → red) when three or more alert thresholds are configured, instead of painting every non-lowest tick red (#257).
|
|
23
|
+
- Dashboard History modal polish follow-ups to #254: the Day / Week / Month toggle is now an idiomatic keyboard radio group — Tab lands on the currently-selected period rather than always on "Day", and ←/→ move both the focus and the selection through the three options (with wraparound) while ↑/↓ keep stepping the period timeline — and a long model name in the per-period cost breakdown (e.g. `opus-4-6-fast`) no longer wraps onto a second line, so every cost-bar row keeps the same height (#261).
|
|
24
|
+
- Dashboard cost-by-model chips now use one consistent style everywhere the per-model cost breakdown appears: the History detail card's model chips — previously pill-shaped with white text — now match the compact, hue-tinted, monospace chips already used by the Projects drill, Session, and Block modals, so the shared breakdown reads identically across all four surfaces and consistently with the rest of the dashboard's chips (#262).
|
|
25
|
+
- Dashboard Projects drill's per-model cost chips now show a short, one-line model name (e.g. `opus-4-8`) instead of the full canonical id (e.g. `claude-opus-4-8`), which wrapped to a second line in the drill's narrow chip column and left those rows uneven — finishing the cost-by-model chip parity from #262 so all four per-model cost-bar surfaces (History, Session, Block, and now the Projects drill) render short display names identically (#263).
|
|
26
|
+
|
|
27
|
+
## [1.58.0] - 2026-06-30
|
|
28
|
+
|
|
29
|
+
### Added
|
|
30
|
+
- Embedded pricing for Claude Sonnet 5 (`claude-sonnet-5`) so its sessions are costed correctly instead of falling back to $0 as an unknown model. The rate is the standard $3/$15 per-MTok price (flat across the full 1M-token context window, identical to Claude Sonnet 4.6) — the durable rate that takes effect after Anthropic's introductory $2/$10 pricing ends 2026-08-31 — and the pricing snapshot date is bumped to 2026-07-01. LiteLLM has no Sonnet 5 entry yet, so the table is simply ahead of it (not flagged as drift by `pricing-check`).
|
|
31
|
+
|
|
32
|
+
### Changed
|
|
33
|
+
- Dashboard at-a-glance redesign: the weekly Used % now dominates as a full-width hero strip — replacing the five header stats and the Current Week grid card — flanked by four spelled-out metrics (cost / 1%, Forecast, 5-hour, vs last week) and a freshness chip, and opening the rich Current Week modal on click. The panel grid is now two-tier: uniform-height summary tiles (Forecast, Weekly, Monthly, Blocks, Alerts) pack into a responsive auto-fit row above full-width data cards (Sessions, Trend, Projects, Daily, Cache Report), with within-tier drag-and-keyboard reorder that cannot cross tiers, eliminating the old forced two-column grid's dead space and roughly halving the page height. Weekly/Monthly/Blocks compact to their three most-recent rows (full history stays one tap away in each panel's modal), Forecast becomes a calm verdict tile, the empty Recent Alerts state collapses to a single line, and on mobile the hero stacks with a 2×2 metric grid while the sticky top bar collapses to one ≤64px row that reveals a condensed Used%/reset readout once you scroll past the hero (#248).
|
|
34
|
+
- Dashboard styling is now built entirely on the shared design tokens: every `border-radius`, `box-shadow`, and accent colour across the dashboard chrome (rgba *and* hex) resolves to the radius/shadow/accent token scale instead of a raw literal, with a small documented allowlist for intentional data-viz and bespoke values. A new global lint keeps it that way — it fails the build if any orphan literal creeps back into the dashboard CSS (the conversation viewer, which owns its own token story, is excluded). There is no visible change; this is the maintainability follow-through on the #247 token foundation (#255).
|
|
35
|
+
- Dashboard cards now wear a calm, neutral chrome: borders, hover elevation, header dividers, the keyboard focus ring, and every panel header title read in one consistent neutral treatment instead of eleven competing accent colours, and accent colour is reserved for genuine state — Cache Report's healthy/anomaly header and the Forecast verdict keep their meaningful hues while healthy cards stay quiet; the look is built on a new radius/shadow/type-scale design-token foundation, and Recent Sessions now caps its height and scrolls internally with its column headers pinned (#247).
|
|
36
|
+
- Dashboard cards read truer at a glance: when every visible Recent Session uses the same model (the common single-model case) the redundant per-row model pills collapse to a single "all · model" caption and the reclaimed width goes to the Project column so names render in full instead of truncating; the Weekly, Monthly, and Blocks model-split bars gain a compact inline legend (model dot + short name + %, with a "+N" overflow) so the breakdown is legible at a glance and on touch instead of hiding in a hover tooltip; the panel drag-to-reorder grip is now visible at rest on desktop and brightens on hover (it previously appeared only on touch) so reordering is discoverable without hovering; the footer keyboard-hint strip is hidden on touch devices where it carries no meaning; and the Current Week modal's early-week progress gauge no longer crowds its per-percent milestone ticks into a sliver below 15% used (#249).
|
|
37
|
+
|
|
38
|
+
### Fixed
|
|
39
|
+
- Dashboard Projects panel on mobile no longer clips a four-figure project cost — the cost column is now content-sized so a value like $1,234.56 renders at full precision (the project name ellipsizes first instead). The Forecast panel's verdict chip now shows the glyph that matches its state — ✓ when healthy, ⚠ on warn, ⛔ when over — instead of always painting a warning triangle even on a perfectly healthy forecast (#248).
|
|
40
|
+
- Conversation viewer: navigating away from (or closing) a conversation while a jump-to-message is still settling no longer leaves the reader running layout-measurement animation frames against the now-unmounted view — the quiesce wait loop now stops the instant the jump is cancelled. This was invisible in normal use but surfaced as cross-test flakiness in the dashboard test suite, where a leaked frame ran after the test environment was torn down and intermittently failed the full parallel run (#256).
|
|
41
|
+
- Dashboard on mobile: form controls (the Recent Sessions filter/search, the Settings inputs and dropdowns, and the Cache Report threshold popover) no longer trigger iOS Safari's auto-zoom on focus, and the smallest primary data text in Sessions, Projects, and Trend is raised to a legible 14px floor (#247).
|
|
42
|
+
- Dashboard Current Week card no longer shows the snapshot freshness twice — the duplicate "Last snapshot" footer is gone and a single header freshness chip is now the one source of truth, rendered in a calm neutral tone when fresh and a loud amber ⚠ only when the data is genuinely stale (#247).
|
|
43
|
+
|
|
44
|
+
### Documentation
|
|
45
|
+
- README rewritten as a feature-led landing page: a per-capability tour (live dashboard, conversation viewer, cost-per-1% trend, forecast & budget, threshold alerts, 5-hour analytics, live TUI, shareable reports, Codex parity, diagnostics) replaces the prior single bullet list, with a dedicated conversation-viewer showcase and two new screenshots (desktop reader + mobile phone). All marketing screenshots were regenerated against the current model lineup (Opus 4.8 and Fable 5), and the stale "nine-panel" dashboard description is corrected to the actual eleven panels.
|
|
46
|
+
|
|
8
47
|
## [1.57.1] - 2026-06-28
|
|
9
48
|
|
|
10
49
|
### Fixed
|
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
</p>
|
|
7
7
|
|
|
8
8
|
<p align="center">
|
|
9
|
-
<strong>
|
|
9
|
+
<strong>Local-first usage tracker for Claude Code on Pro/Max - live dashboard, conversation viewer, weekly cost-per-percent trend, quota forecast, and threshold alerts. ccusage-compatible.</strong>
|
|
10
10
|
</p>
|
|
11
11
|
|
|
12
12
|
<p align="center">
|
|
@@ -16,59 +16,46 @@
|
|
|
16
16
|
<a href="https://github.com/omrikais/cctally/stargazers"><img src="https://img.shields.io/github/stars/omrikais/cctally.svg" alt="GitHub stars"></a>
|
|
17
17
|
</p>
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
Claude Code's Pro/Max plans meter you on a weekly quota, but the only signal you get is a percentage that creeps up until you cap. `cctally` turns that percentage into something you can act on: it reads your local session logs, computes cost in-process, and shows you **how much each percent of quota is actually costing you, whether you're on track to cap this week, and exactly where the spend is going** - across a live web dashboard, a read-only conversation viewer, and a full set of CLI reports. Everything runs locally against your own `~/.claude` data. No account, no API key, no telemetry, nothing leaves your machine.
|
|
20
20
|
|
|
21
21
|
<p align="center">
|
|
22
22
|
<img src="docs/img/dashboard-desktop.png" alt="cctally dashboard, desktop view" width="900">
|
|
23
23
|
</p>
|
|
24
24
|
|
|
25
|
-
##
|
|
25
|
+
## Quick start
|
|
26
26
|
|
|
27
27
|
**Requirements:** Python 3.11+, macOS or Linux, Claude Code installed and run at least once.
|
|
28
28
|
|
|
29
|
-
### Homebrew (macOS / Linux)
|
|
30
|
-
|
|
31
|
-
```bash
|
|
32
|
-
brew install omrikais/cctally/cctally
|
|
33
|
-
cctally setup
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
### npm
|
|
37
|
-
|
|
38
29
|
```bash
|
|
39
|
-
|
|
40
|
-
cctally setup
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
Needs Python 3. If `cctally setup` fails with "python3 not found", install it with `brew install python` (macOS) and try again.
|
|
30
|
+
# Homebrew (macOS / Linux)
|
|
31
|
+
brew install omrikais/cctally/cctally && cctally setup
|
|
44
32
|
|
|
45
|
-
|
|
33
|
+
# …or npm
|
|
34
|
+
npm install -g cctally && cctally setup
|
|
46
35
|
|
|
47
|
-
|
|
48
|
-
git clone https://github.com/omrikais/cctally
|
|
49
|
-
cd cctally
|
|
50
|
-
./bin/cctally setup
|
|
36
|
+
# …or from source
|
|
37
|
+
git clone https://github.com/omrikais/cctally && cd cctally && ./bin/cctally setup
|
|
51
38
|
```
|
|
52
39
|
|
|
53
|
-
`cctally setup`
|
|
40
|
+
`cctally setup` symlinks the binaries into `~/.local/bin/`, adds three additive hooks to `~/.claude/settings.json` (it never overwrites existing entries), and bootstraps the local SQLite cache. If `~/.local/bin/` isn't on your `PATH`, the script prints the line to add. The npm install needs Python 3 on `PATH` - if setup reports "python3 not found", install it (`brew install python` on macOS) and re-run.
|
|
54
41
|
|
|
55
42
|
```bash
|
|
56
43
|
cctally setup --status # verify hooks + symlinks
|
|
57
|
-
cctally daily # cost-by-day
|
|
44
|
+
cctally daily # cost-by-day - your first table
|
|
58
45
|
cctally dashboard # opens http://127.0.0.1:8789
|
|
59
46
|
```
|
|
60
47
|
|
|
61
|
-
For status-line integration
|
|
48
|
+
For status-line integration and tuning, see [docs/installation.md](docs/installation.md) and [docs/configuration.md](docs/configuration.md).
|
|
62
49
|
|
|
63
|
-
##
|
|
50
|
+
## The live dashboard
|
|
64
51
|
|
|
65
|
-
|
|
52
|
+
`cctally dashboard` serves a web app at `localhost:8789` that updates live as you work - no refresh, no polling. Eleven panels cover the whole picture: **current week**, **forecast**, **$/1% trend**, **recent sessions**, **weekly**, **monthly**, **5-hour blocks**, **daily heatmap**, **projects**, **cache report**, and **recent alerts**. Any panel expands into a focused view, sessions are filterable and searchable, and a settings drawer tunes alerts and display options on the fly. It runs only on your own machine by default; one flag opens it to the other devices on your network when you want that.
|
|
66
53
|
|
|
67
54
|
<table>
|
|
68
55
|
<tr>
|
|
69
56
|
<td>
|
|
70
57
|
<img src="docs/img/dashboard-modal.png" alt="Dashboard with trend modal open">
|
|
71
|
-
<br><em>Any panel expands into a focused view
|
|
58
|
+
<br><em>Any panel expands into a focused view - here, twelve weeks of cost per percent.</em>
|
|
72
59
|
</td>
|
|
73
60
|
<td>
|
|
74
61
|
<img src="docs/img/dashboard-warn.png" alt="Dashboard in warn state">
|
|
@@ -78,12 +65,34 @@ For status-line integration, alerts, and configuration, see [docs/installation.m
|
|
|
78
65
|
<tr>
|
|
79
66
|
<td colspan="2" align="center">
|
|
80
67
|
<img src="docs/img/dashboard-mobile.png" alt="Dashboard on phone" width="350">
|
|
81
|
-
<br><em>The same dashboard
|
|
68
|
+
<br><em>The same dashboard, reflowed for your phone.</em>
|
|
82
69
|
</td>
|
|
83
70
|
</tr>
|
|
84
71
|
</table>
|
|
85
72
|
|
|
86
|
-
|
|
73
|
+
See [docs/commands/dashboard.md](docs/commands/dashboard.md).
|
|
74
|
+
|
|
75
|
+
## Conversation viewer ⭐
|
|
76
|
+
|
|
77
|
+
The dashboard's **Conversations** tab is a read-only reader for your Claude Code transcripts - your local session history, rendered the way you'd actually want to review it. A searchable rail lists every conversation with its project, branch, model chips, and cost; the reader shows the full turn-by-turn flow with thinking blocks, tool calls (with diffs and command output), and a per-turn cost-and-token breakdown. Parallel **subagent threads** render as their own nested threads, an outline pane jumps you to any turn, and an in-conversation find bar plus a faceted full-text search (prompts, assistant text, tools, thinking) make a month of sessions navigable. The open conversation **live-tails** as you work, updating within a second.
|
|
78
|
+
|
|
79
|
+
It only reads your transcripts - it never changes them - and everything stays on your own machine. Nothing is uploaded, and the viewer is reachable only from your computer unless you choose to share the dashboard with your network.
|
|
80
|
+
|
|
81
|
+
<p align="center">
|
|
82
|
+
<img src="docs/img/conversation-reader.png" alt="Conversation viewer: rail, threaded reader, and outline" width="900">
|
|
83
|
+
<br>
|
|
84
|
+
<em>Rail, threaded reader with tool cards and a subagent thread, and the jump-to outline.</em>
|
|
85
|
+
</p>
|
|
86
|
+
|
|
87
|
+
<p align="center">
|
|
88
|
+
<img src="docs/img/conversation-mobile.png" alt="Conversation viewer on a phone" width="300">
|
|
89
|
+
<br>
|
|
90
|
+
<em>The same reader on your phone.</em>
|
|
91
|
+
</p>
|
|
92
|
+
|
|
93
|
+
## Cost per 1% of quota
|
|
94
|
+
|
|
95
|
+
The signature view. `cctally report` reframes each subscription week's spend as **dollars per percent of quota used**, so you can see your spending efficiency trend week over week - and whether this week is pulling above or below the line - instead of staring at a raw percentage. Persisted to SQLite, so the comparison survives across runs.
|
|
87
96
|
|
|
88
97
|
<p align="center">
|
|
89
98
|
<img src="docs/img/cli-report.svg" alt="cctally report: $ per 1% weekly trend">
|
|
@@ -91,19 +100,39 @@ For status-line integration, alerts, and configuration, see [docs/installation.m
|
|
|
91
100
|
<em>Weekly cost as dollars per percent of quota, with the delta against the prior week.</em>
|
|
92
101
|
</p>
|
|
93
102
|
|
|
103
|
+
See [docs/commands/report.md](docs/commands/report.md).
|
|
104
|
+
|
|
105
|
+
## Forecast & budget
|
|
106
|
+
|
|
107
|
+
`cctally forecast` projects where your weekly percentage lands at the next reset - using both a week-average and a recent-24h rate - and tells you the daily $/% budget you'd need to stay under the 100% and 90% ceilings. When the data is thin it says so (`LOW CONF`) rather than guessing.
|
|
108
|
+
|
|
94
109
|
<p align="center">
|
|
95
110
|
<img src="docs/img/cli-forecast.svg" alt="cctally forecast: will I cap this week?">
|
|
96
111
|
<br>
|
|
97
112
|
<em>Projected percent at the weekly reset, plus the daily budget to stay under the cap.</em>
|
|
98
113
|
</p>
|
|
99
114
|
|
|
115
|
+
For dollar budgets, `cctally budget` tracks an equivalent-vs-actual spend target over a configurable calendar period - per vendor, for both Claude and Codex - with a pace projection and an `ok`/`warn`/`over` verdict. See [docs/commands/forecast.md](docs/commands/forecast.md) and [docs/commands/budget.md](docs/commands/budget.md).
|
|
116
|
+
|
|
117
|
+
## Threshold alerts
|
|
118
|
+
|
|
119
|
+
Get a native desktop notification the moment you cross a percent milestone, so a runaway week can't sneak up on you. Alerts fire on weekly percent, 5-hour blocks, and budget thresholds, with three severity levels (info / warn / critical) and native popups on macOS and Linux - or run a command of your own. `cctally alerts test` confirms it's wired up. See [docs/commands/alerts.md](docs/commands/alerts.md).
|
|
120
|
+
|
|
121
|
+
## 5-hour analytics
|
|
122
|
+
|
|
123
|
+
Claude Code's quota also runs on rolling 5-hour windows. `cctally blocks` and `cctally five-hour-blocks` break usage down per window - anchored to the real API resets, not a re-sizable guess - with model and project rollups and cross-reset flags, and `cctally five-hour-breakdown` drills into the per-percent milestones inside a single block.
|
|
124
|
+
|
|
100
125
|
<p align="center">
|
|
101
126
|
<img src="docs/img/cli-five-hour-blocks.svg" alt="cctally five-hour-blocks: 5h analytics with model breakdown">
|
|
102
127
|
<br>
|
|
103
|
-
<em>Each 5-hour window,
|
|
128
|
+
<em>Each 5-hour window, with rollup totals and 7-day drift.</em>
|
|
104
129
|
</p>
|
|
105
130
|
|
|
106
|
-
|
|
131
|
+
See [docs/commands/blocks.md](docs/commands/blocks.md) and [docs/commands/five-hour-blocks.md](docs/commands/five-hour-blocks.md).
|
|
132
|
+
|
|
133
|
+
## Live terminal UI
|
|
134
|
+
|
|
135
|
+
Prefer to stay in the terminal, or working over SSH? `cctally tui` shows the same live data as a refreshing terminal dashboard. It's the one feature that needs the optional `rich` library; every other command runs on a plain Python install with nothing else to set up.
|
|
107
136
|
|
|
108
137
|
<p align="center">
|
|
109
138
|
<img src="docs/img/cli-tui.svg" alt="cctally tui: live terminal dashboard">
|
|
@@ -111,29 +140,32 @@ For status-line integration, alerts, and configuration, see [docs/installation.m
|
|
|
111
140
|
<em>The same data in the terminal, refreshed live.</em>
|
|
112
141
|
</p>
|
|
113
142
|
|
|
114
|
-
|
|
143
|
+
See [docs/commands/tui.md](docs/commands/tui.md).
|
|
144
|
+
|
|
145
|
+
## Shareable reports
|
|
146
|
+
|
|
147
|
+
All eight reporting commands (`report`, `daily`, `monthly`, `weekly`, `forecast`, `project`, `five-hour-blocks`, `session`) can render to shareable Markdown, HTML, or SVG with `--format`, a light/dark `--theme`, and `--output` / `--copy` / `--open`. Project names anonymize by default (`--reveal-projects` opts in), so you can post a snapshot without leaking where you work. See [docs/commands/share.md](docs/commands/share.md).
|
|
148
|
+
|
|
149
|
+
## Codex parity
|
|
150
|
+
|
|
151
|
+
If you also use OpenAI's Codex CLI, `cctally codex daily / monthly / session` are drop-ins for `ccusage codex daily / monthly / session`, reading from `~/.codex/sessions/`. The flat `codex-*` forms (drop-ins for the standalone `ccusage-codex` binary) stay as aliases, and `cctally codex weekly` adds a subscription-week rollup that upstream doesn't have. See [docs/commands/codex.md](docs/commands/codex.md).
|
|
152
|
+
|
|
153
|
+
## Diagnostics & upkeep
|
|
154
|
+
|
|
155
|
+
`cctally doctor` gives you a read-only health check - install, hooks, sign-in, database, data freshness, pricing, and safety - and the same status shows up in the dashboard. `cctally pricing-check` warns you when the built-in model pricing is getting stale, `cctally db` manages the local database, and `cctally update` keeps your install current. The local cache is always safe to delete or rebuild.
|
|
115
156
|
|
|
116
|
-
|
|
157
|
+
## A faster, local-first ccusage
|
|
117
158
|
|
|
118
|
-
|
|
119
|
-
- **TUI live mode.** The same data inside your terminal (`cctally tui`; requires the optional `rich` package).
|
|
120
|
-
- **$-per-1% weekly trend.** The `report` table reframes weekly cost as cost-per-percent-of-quota, so spending efficiency is visible week over week.
|
|
121
|
-
- **Forecast.** Projects current-week percent and daily $/% budgets against the 100% and 90% ceilings (`cctally forecast`).
|
|
122
|
-
- **Threshold alerts.** Configurable percent crossings with native macOS popups (`cctally alerts`).
|
|
123
|
-
- **5-hour block analytics.** Per-block usage with model and project breakdowns (`cctally five-hour-blocks --breakdown=model`).
|
|
124
|
-
- **Time-window diff.** Compare two windows with model and project decomposition (`cctally diff`).
|
|
125
|
-
- **Project rollup.** Usage by Git project (`cctally project`).
|
|
126
|
-
- **Codex parity.** `cctally codex daily / monthly / session` are drop-ins for `ccusage codex daily / monthly / session`; the flat `codex-*` forms (drop-ins for the standalone `ccusage-codex` binary) remain as aliases, plus an added `cctally codex weekly` / `cctally codex-weekly` rollup (upstream has no `codex weekly`).
|
|
127
|
-
- **Persistent SQLite.** Week-over-week comparisons survive across runs.
|
|
159
|
+
`cctally` started as a local replacement for [`ccusage`](https://github.com/ryoppippi/ccusage) and stays compatible at the level of common flows: `cctally claude <cmd>` is a drop-in for `ccusage claude <cmd>` (and `cctally codex <cmd>` for `ccusage codex <cmd>`), with the flat forms (`cctally daily`, `cctally codex-daily`, …) kept as aliases. Paste your ccusage commands verbatim - then reach for the dashboard, forecast, trend, conversation viewer, and alerts that ccusage doesn't have.
|
|
128
160
|
|
|
129
|
-
|
|
161
|
+
It's also fast. Pricing is built in and computed in-process from a local SQLite cache, with no external tools to spawn. First table on 30 days of session data: **~2.6s (cctally) vs ~31s (ccusage)**, about 12× faster. Measured by `bench/cctally-vs-ccusage.sh` on macOS arm64, 2026-05-05; your numbers will vary.[^bench]
|
|
130
162
|
|
|
131
163
|
<!--
|
|
132
164
|
Footnote target uses an absolute URL because GitHub's relative-link
|
|
133
165
|
rewriter doesn't traverse into GFM footnote `<li>` content; on the
|
|
134
166
|
repo home page (`/omrikais/cctally`, no trailing slash) the browser
|
|
135
167
|
would resolve `bench/README.md` against the page URL and produce
|
|
136
|
-
`/omrikais/bench/README.md`
|
|
168
|
+
`/omrikais/bench/README.md` - a broken path. Regular paragraph links
|
|
137
169
|
are unaffected.
|
|
138
170
|
-->
|
|
139
171
|
[^bench]: Methodology and reproduction: [`bench/README.md`](https://github.com/omrikais/cctally/blob/main/bench/README.md).
|
package/bin/_lib_pricing.py
CHANGED
|
@@ -53,7 +53,7 @@ def _chip_for_model(name: str) -> str:
|
|
|
53
53
|
# Date the embedded pricing snapshots below were last verified against
|
|
54
54
|
# vendor sources. Bump whenever CLAUDE_MODEL_PRICING / CODEX_MODEL_PRICING
|
|
55
55
|
# is synced. Read by `pricing-check` + the release pre-flight staleness nudge.
|
|
56
|
-
PRICING_SNAPSHOT_DATE = "2026-
|
|
56
|
+
PRICING_SNAPSHOT_DATE = "2026-07-01"
|
|
57
57
|
PRICING_STALENESS_DAYS = 60 # release pre-flight WARNs past this age
|
|
58
58
|
|
|
59
59
|
# Canonical machine-readable pricing source (Claude values + Codex values).
|
|
@@ -71,11 +71,17 @@ PRICING_DRIFT_ALLOWLIST: list[dict] = []
|
|
|
71
71
|
|
|
72
72
|
# Anthropic API pricing snapshot:
|
|
73
73
|
# - Source: https://raw.githubusercontent.com/BerriAI/litellm/main/model_prices_and_context_window.json
|
|
74
|
-
# - Captured: 2026-
|
|
74
|
+
# - Captured: 2026-07-01 (see PRICING_SNAPSHOT_DATE)
|
|
75
75
|
# - Verified by maintainer against docs.claude.com/en/docs/about-claude/pricing;
|
|
76
76
|
# update in PRs touching this table.
|
|
77
77
|
# 2026-06-10: added claude-fable-5 ($10/$50 per MTok; 1M context, no
|
|
78
78
|
# long-context premium) — issue #172.
|
|
79
|
+
# 2026-07-01: added claude-sonnet-5 ($3/$15 per MTok; 1M context, flat-rate
|
|
80
|
+
# across the full window — no long-context premium, same shape as
|
|
81
|
+
# claude-sonnet-4-6). Embedded the STANDARD rate, not the $2/$10 introductory
|
|
82
|
+
# rate in effect through 2026-08-31, to match what LiteLLM will publish and
|
|
83
|
+
# the durable post-cutover price. LiteLLM has no sonnet-5 entry yet, so the
|
|
84
|
+
# table is ahead_of_litellm (not a drift finding).
|
|
79
85
|
CLAUDE_MODEL_PRICING: dict[str, dict[str, Any]] = {
|
|
80
86
|
"claude-3-5-haiku-20241022": {
|
|
81
87
|
"input_cost_per_token": 8e-07,
|
|
@@ -267,6 +273,12 @@ CLAUDE_MODEL_PRICING: dict[str, dict[str, Any]] = {
|
|
|
267
273
|
"cache_creation_input_token_cost": 3.75e-06,
|
|
268
274
|
"cache_read_input_token_cost": 3e-07,
|
|
269
275
|
},
|
|
276
|
+
"claude-sonnet-5": {
|
|
277
|
+
"input_cost_per_token": 3e-06,
|
|
278
|
+
"output_cost_per_token": 1.5e-05,
|
|
279
|
+
"cache_creation_input_token_cost": 3.75e-06,
|
|
280
|
+
"cache_read_input_token_cost": 3e-07,
|
|
281
|
+
},
|
|
270
282
|
}
|
|
271
283
|
|
|
272
284
|
_unknown_model_warnings: set[str] = set()
|