ccusage-snapshot.sh v2.2 - per-project/per-model token usage into pg usage.daily
READS: ccusage daily breakdown (Claude Code usage cache). WRITES: UPSERT into postgres usage.daily, so trends across agents/days are queryable. Supports --since/--until backfill. Host all. Registry row 49, primary bin-venus-cc / backup bin-whey-cc. THIS IS THE FLEET TOKEN-SPEND SSOT as far as I know - any other agent sampling ccusage independently is duplicating it and should read usage.daily instead. RETRACTED 2026-08-23, SAME DAY I FILED IT. This script is DEAD and I registered it as live - the exact stale claim this epic exists to surface, introduced by me into the epic. Dead three ways, all verified: no systemd unit or timer exists for it on venus; ccusage is not on PATH (npx fallback only); and it shells out to 'ccusage daily -j -b -i' whose flags no longer exist in ccusage 11.15.0, so it is broken independently of being unscheduled. token-usage-collect.sh has said so in its own header since 2026-07-14 - 'replaces the dead pg usage.daily pipeline (ccusage-watch.sh / ccusage-snapshot.sh)' - and I did not read the successor before describing the predecessor. WITHDRAW THE SSOT CLAIM. The live fleet token-usage source is ~/.local/share/token-usage/token-usage.sqlite (tables usage_daily/usage_hourly), written by token-usage-collect.sh every 15 minutes, current as of today (779 rows, max date 2026-08-23). Spec owner nw-venus-cc, executor bin-venus-cc, registry row 23. pg usage.daily/usage.polls are RETIRED but still populated up to 2026-08-17, which is why they still read as live to a consumer. FOUND BY bin-whey-cc, not by me, and not by any sweep: their ccusage-daily-kpi.sh queried usage.daily for today, got an empty set, and mailed Elazar a 'top 3 by cost' table containing one blank row every morning since 2026-08-18. No error, exit 0 - an empty result set is not a failure, and a reader cannot tell 'nobody spent anything' from 'the collector stopped'. Registry rows 49 and 50 now status=retired with the full historyNote.
Activity
-
parent=#2960
-
was: READS: ccusage daily breakdown (Claude Code usage cache). WRITES: UPSERT into postgres usage.daily, so trends across agents/days are queryable. Supports --since/--until backfill. Host all. Registry row 49, primary bin-venus-cc / backup bin-whey-cc. THIS IS THE FLEET TOKEN-SPEND SSOT as far as I know - any other agent sampling ccusage independently is duplicating it and should read usage.daily instead.
-
OBSOLETED, NOT DONE - the target script was deleted by Elazar in 38bdd55 'retire agent telemetry tracking stack' (2026-09-24, author Elazar Pimentel). Verified on disk and in git history 2026-10-05: no live copy in ~/.local/bin, none in /home/rob/scripts, and no systemd user unit references it. The commit removed the whole stack in one go - llmmsg-kpi-report.sh, llmmsg-kpi-coach.sh, ccusage-snapshot.sh, ccusage-watch.sh, token-usage-web.sh, token-usage-collect.sh, token-usage-push-lezama.py - and fleet-tokens.sh went the same day in 03c7d53. Cancelled rather than closed because the work was never performed; it stopped being wanted. Reopening any of these means re-specifying it against whatever replaces the stack, which is the open Elazar decision recorded on KPI-68. Found while reconciling KPI-68 at pmmaster's request - these four were sitting in the 'large non-blocked KPI backlog' and are not backlog, they are phantom rows against deleted files.