ccpace 0.1.0__tar.gz

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.
@@ -0,0 +1,3 @@
1
+ __pycache__/
2
+ *.pyc
3
+ dist/
ccpace-0.1.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 thevibeworks
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
ccpace-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,121 @@
1
+ Metadata-Version: 2.4
2
+ Name: ccpace
3
+ Version: 0.1.0
4
+ Summary: Pace your Claude quota: multi-account usage monitor with a countable 5h-window budget, weekday forecasts, and push notifications
5
+ Project-URL: Homepage, https://thevibeworks.github.io/ccpace/
6
+ Project-URL: Repository, https://github.com/thevibeworks/ccpace
7
+ Project-URL: Changelog, https://github.com/thevibeworks/ccpace/blob/main/CHANGELOG.md
8
+ Author: thevibeworks
9
+ License: MIT
10
+ License-File: LICENSE
11
+ Keywords: claude,claude-code,monitor,quota,rate-limit,usage
12
+ Classifier: Environment :: Console
13
+ Classifier: License :: OSI Approved :: MIT License
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Topic :: Utilities
16
+ Requires-Python: >=3.11
17
+ Requires-Dist: httpx[socks]
18
+ Description-Content-Type: text/markdown
19
+
20
+ # ccpace
21
+
22
+ Pace your Claude quota. Multi-account usage monitor for Claude
23
+ subscriptions: real utilization from the official usage endpoint — not
24
+ estimates from transcripts — a countable 5h-window budget, weekday
25
+ forecasts learned from your own history, and push notifications.
26
+
27
+ ```
28
+ ── [20x] work · period ends ~Aug 11 ────────────────────────────────
29
+ 5h 7% █▒░░░░░░░░ 3h 48m @19:00 0.3x
30
+ 7d 3% █░░░░░░░░░ 6d 8h @Thu 13 00:00 0.3x
31
+ fable 3% █░░░░░░░░░ 6d 8h @Thu 13 00:00 0.3x
32
+ ··▁▮▫▫▫▫▫▫▫▫▫▫▫▫▫▫▫▫▫▫▫▫▫▫▫▫┤
33
+ budget: ~24 windows left · 4.0%/window stays even · period ends ~Aug 11
34
+ forecast: +38% rest of week on your pattern · lands ~41% (12d history)
35
+ ```
36
+
37
+ ## Install
38
+
39
+ ```sh
40
+ uvx ccpace # one glance, all discovered accounts
41
+ uvx ccpace --watch # live TUI: r=refresh, q=quit
42
+ ```
43
+
44
+ Or grab the single file — it is the whole tool:
45
+
46
+ ```sh
47
+ curl -fsSLO https://raw.githubusercontent.com/thevibeworks/ccpace/main/ccpace.py
48
+ uv run --script ccpace.py
49
+ ```
50
+
51
+ As a Claude Code plugin (`/ccpace` inside Claude Code):
52
+
53
+ ```
54
+ /plugin marketplace add thevibeworks/ccpace
55
+ /plugin install ccpace@ccpace
56
+ ```
57
+
58
+ Requires [uv](https://docs.astral.sh/uv/) and a Claude subscription
59
+ you are logged into (`claude login`); credentials are discovered from
60
+ `~/.claude/.credentials*.json`. Multiple credential files = fleet view,
61
+ sorted by tier.
62
+
63
+ ## What it shows
64
+
65
+ - One block per account: 5h window, 7d window, per-model caps, extra
66
+ usage spend, prepaid credit balance when nonzero.
67
+ - Dual bars merge usage with window-elapsed time: `█` both passed, `▓`
68
+ usage ahead (hot), `▒` time ahead (headroom), `░` untouched.
69
+ - The window ledger: the 7d period as its 5h windows, one cell each.
70
+ `▁▂▃▄▅▆▇█` what a window burned (from your sample history), `·` idle,
71
+ `░` unknown, `▮` now, `▫` ahead, `×` won't be covered at current pace,
72
+ `┤` access ends there. Cells right of `▮` are countable — they equal
73
+ the advisor's "windows left".
74
+ - The advisor: pace warnings (`!`), budget per remaining window, and a
75
+ weekday forecast once it has 3+ days of your history.
76
+ - Budget math truncates at the subscription period end (derived from
77
+ the billing anniversary — the API exposes no cancel/renew date, so
78
+ the boundary is assumed and marked with `~`).
79
+
80
+ ## Notifications
81
+
82
+ System notifications (macOS/Linux) fire on threshold, quota-full,
83
+ pace, and reset events. Add push channels:
84
+
85
+ ```sh
86
+ ccpace --watch --ntfy https://ntfy.sh/your-topic
87
+ ccpace --watch --bark https://api.day.app/YOUR_KEY
88
+ ccpace --watch --notifier ~/bin/my-hook.sh # JSON on stdin
89
+ ```
90
+
91
+ Env: `CCPACE_NTFY`, `CCPACE_BARK`, `CCPACE_NOTIFIER`, `CCPACE_INTERVAL`,
92
+ `CCPACE_THRESHOLD`, `CCPACE_TZ` (e.g. `America/New_York,Asia/Tokyo`).
93
+
94
+ ## Data
95
+
96
+ Samples append to a shared store compatible with
97
+ [claude-code-statusline](https://github.com/thevibeworks/claude-code-statusline)
98
+ (`~/.claude/statusline/accounts/<alias>/usage.jsonl`): both tools feed
99
+ one history, so the ledger and forecasts get richer whichever tool you
100
+ run. Contract in [docs/data.md](docs/data.md). `--no-log` disables
101
+ writing; `CCPACE_DATA_DIR` relocates the store.
102
+
103
+ ## Honest caveats
104
+
105
+ - Uses the same undocumented OAuth endpoints as the Claude Code CLI,
106
+ read-only, against your own account. Anthropic can change or gate
107
+ them at any release; expect breakage, report it, don't build a
108
+ business on it.
109
+ - One deliberate write: expired tokens are refreshed via the official
110
+ OAuth flow and written back to the credentials file — the same thing
111
+ Claude Code does on your behalf.
112
+ - Polling is deliberately polite: 15 min default interval with jitter,
113
+ minimum 60 s, exponential backoff on errors, no polling of accounts
114
+ pinned at 100%.
115
+ - Forecasts are your own history extrapolated, not a promise. Below 3
116
+ days of samples the forecast stays silent instead of guessing.
117
+ - Not affiliated with Anthropic.
118
+
119
+ ## License
120
+
121
+ MIT
ccpace-0.1.0/README.md ADDED
@@ -0,0 +1,102 @@
1
+ # ccpace
2
+
3
+ Pace your Claude quota. Multi-account usage monitor for Claude
4
+ subscriptions: real utilization from the official usage endpoint — not
5
+ estimates from transcripts — a countable 5h-window budget, weekday
6
+ forecasts learned from your own history, and push notifications.
7
+
8
+ ```
9
+ ── [20x] work · period ends ~Aug 11 ────────────────────────────────
10
+ 5h 7% █▒░░░░░░░░ 3h 48m @19:00 0.3x
11
+ 7d 3% █░░░░░░░░░ 6d 8h @Thu 13 00:00 0.3x
12
+ fable 3% █░░░░░░░░░ 6d 8h @Thu 13 00:00 0.3x
13
+ ··▁▮▫▫▫▫▫▫▫▫▫▫▫▫▫▫▫▫▫▫▫▫▫▫▫▫┤
14
+ budget: ~24 windows left · 4.0%/window stays even · period ends ~Aug 11
15
+ forecast: +38% rest of week on your pattern · lands ~41% (12d history)
16
+ ```
17
+
18
+ ## Install
19
+
20
+ ```sh
21
+ uvx ccpace # one glance, all discovered accounts
22
+ uvx ccpace --watch # live TUI: r=refresh, q=quit
23
+ ```
24
+
25
+ Or grab the single file — it is the whole tool:
26
+
27
+ ```sh
28
+ curl -fsSLO https://raw.githubusercontent.com/thevibeworks/ccpace/main/ccpace.py
29
+ uv run --script ccpace.py
30
+ ```
31
+
32
+ As a Claude Code plugin (`/ccpace` inside Claude Code):
33
+
34
+ ```
35
+ /plugin marketplace add thevibeworks/ccpace
36
+ /plugin install ccpace@ccpace
37
+ ```
38
+
39
+ Requires [uv](https://docs.astral.sh/uv/) and a Claude subscription
40
+ you are logged into (`claude login`); credentials are discovered from
41
+ `~/.claude/.credentials*.json`. Multiple credential files = fleet view,
42
+ sorted by tier.
43
+
44
+ ## What it shows
45
+
46
+ - One block per account: 5h window, 7d window, per-model caps, extra
47
+ usage spend, prepaid credit balance when nonzero.
48
+ - Dual bars merge usage with window-elapsed time: `█` both passed, `▓`
49
+ usage ahead (hot), `▒` time ahead (headroom), `░` untouched.
50
+ - The window ledger: the 7d period as its 5h windows, one cell each.
51
+ `▁▂▃▄▅▆▇█` what a window burned (from your sample history), `·` idle,
52
+ `░` unknown, `▮` now, `▫` ahead, `×` won't be covered at current pace,
53
+ `┤` access ends there. Cells right of `▮` are countable — they equal
54
+ the advisor's "windows left".
55
+ - The advisor: pace warnings (`!`), budget per remaining window, and a
56
+ weekday forecast once it has 3+ days of your history.
57
+ - Budget math truncates at the subscription period end (derived from
58
+ the billing anniversary — the API exposes no cancel/renew date, so
59
+ the boundary is assumed and marked with `~`).
60
+
61
+ ## Notifications
62
+
63
+ System notifications (macOS/Linux) fire on threshold, quota-full,
64
+ pace, and reset events. Add push channels:
65
+
66
+ ```sh
67
+ ccpace --watch --ntfy https://ntfy.sh/your-topic
68
+ ccpace --watch --bark https://api.day.app/YOUR_KEY
69
+ ccpace --watch --notifier ~/bin/my-hook.sh # JSON on stdin
70
+ ```
71
+
72
+ Env: `CCPACE_NTFY`, `CCPACE_BARK`, `CCPACE_NOTIFIER`, `CCPACE_INTERVAL`,
73
+ `CCPACE_THRESHOLD`, `CCPACE_TZ` (e.g. `America/New_York,Asia/Tokyo`).
74
+
75
+ ## Data
76
+
77
+ Samples append to a shared store compatible with
78
+ [claude-code-statusline](https://github.com/thevibeworks/claude-code-statusline)
79
+ (`~/.claude/statusline/accounts/<alias>/usage.jsonl`): both tools feed
80
+ one history, so the ledger and forecasts get richer whichever tool you
81
+ run. Contract in [docs/data.md](docs/data.md). `--no-log` disables
82
+ writing; `CCPACE_DATA_DIR` relocates the store.
83
+
84
+ ## Honest caveats
85
+
86
+ - Uses the same undocumented OAuth endpoints as the Claude Code CLI,
87
+ read-only, against your own account. Anthropic can change or gate
88
+ them at any release; expect breakage, report it, don't build a
89
+ business on it.
90
+ - One deliberate write: expired tokens are refreshed via the official
91
+ OAuth flow and written back to the credentials file — the same thing
92
+ Claude Code does on your behalf.
93
+ - Polling is deliberately polite: 15 min default interval with jitter,
94
+ minimum 60 s, exponential backoff on errors, no polling of accounts
95
+ pinned at 100%.
96
+ - Forecasts are your own history extrapolated, not a promise. Below 3
97
+ days of samples the forecast stays silent instead of guessing.
98
+ - Not affiliated with Anthropic.
99
+
100
+ ## License
101
+
102
+ MIT