claude-usage-limits 1.11.6 → 1.13.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/.claude-plugin/plugin.json +1 -1
- package/.codex-plugin/plugin.json +1 -1
- package/README.md +133 -3
- package/bin/cli.js +1 -0
- package/commands/relay.md +45 -0
- package/commands/voice.md +33 -0
- package/hooks/hooks.json +24 -1
- package/package.json +1 -1
- package/skills/usage-limits/SKILL.md +130 -5
- package/skills/usage-limits/scripts/bars.js +56 -0
- package/skills/usage-limits/scripts/brief.js +288 -17
- package/skills/usage-limits/scripts/codex-lowpower.js +135 -0
- package/skills/usage-limits/scripts/codex.js +92 -22
- package/skills/usage-limits/scripts/feed.js +136 -5
- package/skills/usage-limits/scripts/install-codex-hook.js +71 -20
- package/skills/usage-limits/scripts/lowpower.js +10 -2
- package/skills/usage-limits/scripts/panel.js +180 -15
- package/skills/usage-limits/scripts/pulse.js +82 -22
- package/skills/usage-limits/scripts/reading.js +121 -0
- package/skills/usage-limits/scripts/recommend.js +16 -3
- package/skills/usage-limits/scripts/relay.js +859 -0
- package/skills/usage-limits/scripts/tally.js +7 -8
- package/skills/usage-limits/scripts/usage.js +842 -53
- package/skills/usage-limits/scripts/view.js +150 -8
- package/skills/usage-limits/scripts/voice.js +416 -0
- package/skills/usage-limits/scripts/wake.js +312 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "usage-limits",
|
|
3
3
|
"displayName": "Usage Limits",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.13.0",
|
|
5
5
|
"description": "Puts your remaining Claude Code usage limit into Claude's context before every prompt, so it opens with what fits in the budget instead of starting work that gets cut off. Reports headroom as turns rather than percentages, prices a job before you start it, and detects your plan tier.",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Ridelink",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "usage-limits",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.13.0",
|
|
4
4
|
"description": "Reports how much of your Codex usage limit is left as turns of work rather than a percentage, prices a job before you start it, and counts the other agents sharing the same budget.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Ridelink",
|
package/README.md
CHANGED
|
@@ -168,6 +168,50 @@ node skills/usage-limits/scripts/usage.js
|
|
|
168
168
|
node skills/usage-limits/scripts/usage.js --json
|
|
169
169
|
```
|
|
170
170
|
|
|
171
|
+
### Keeping it up to date
|
|
172
|
+
|
|
173
|
+
Claude Code can update this for you, but **it will not by default**. Auto-update
|
|
174
|
+
is a per-*marketplace* switch, and it defaults to on only for claude.ai-hosted
|
|
175
|
+
marketplaces and a hard-coded list of official Anthropic ones. Every
|
|
176
|
+
third-party GitHub marketplace, this one included, defaults to off.
|
|
177
|
+
|
|
178
|
+
Turn it on once, either through `/plugin` → Marketplaces → usage-limits, or by
|
|
179
|
+
adding one key to `~/.claude/settings.json`:
|
|
180
|
+
|
|
181
|
+
```json
|
|
182
|
+
{
|
|
183
|
+
"extraKnownMarketplaces": {
|
|
184
|
+
"usage-limits": {
|
|
185
|
+
"source": { "source": "github", "repo": "ridelink0/claude-code-usage-limits" },
|
|
186
|
+
"autoUpdate": true
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
Claude Code then refreshes the marketplace and updates the plugin in the
|
|
193
|
+
background shortly after a session starts (with a random delay of up to ten
|
|
194
|
+
minutes, so a running session keeps the version it launched with), and offers
|
|
195
|
+
`/reload-plugins` when something changed. To update on the spot instead:
|
|
196
|
+
|
|
197
|
+
```
|
|
198
|
+
claude plugin update usage-limits
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
Note that the whole pass is skipped when Claude Code's own auto-updater is
|
|
202
|
+
disabled, unless `FORCE_AUTOUPDATE_PLUGINS` is set.
|
|
203
|
+
|
|
204
|
+
**Cloud and web sessions** never see `~/.claude`, so nothing installed on a
|
|
205
|
+
laptop reaches them. Commit the same block to a repository's
|
|
206
|
+
`.claude/settings.json`, alongside `enabledPlugins`, and any session opened on
|
|
207
|
+
that repository installs the plugin at session start — always at the newest
|
|
208
|
+
commit. This repository carries exactly that file if you want one to copy.
|
|
209
|
+
|
|
210
|
+
The other two channels update themselves the ordinary way: the VS Code
|
|
211
|
+
extension through the Marketplace, and the npm package on the next `npx
|
|
212
|
+
claude-usage-limits` (a global install pins, so `npm i -g claude-usage-limits@latest`
|
|
213
|
+
to move it).
|
|
214
|
+
|
|
171
215
|
## When another Claude is working too
|
|
172
216
|
|
|
173
217
|
Two Claude Code windows share one limit, so headroom measured in turns is
|
|
@@ -264,6 +308,87 @@ The skill also requires Claude to say up front when a job will not fit in what
|
|
|
264
308
|
is left, name what it is doing now, what it is leaving, and when the rest can
|
|
265
309
|
happen, rather than starting and stopping halfway through an edit.
|
|
266
310
|
|
|
311
|
+
## The relay: carrying a project across the reset
|
|
312
|
+
|
|
313
|
+
The handoff has always had the same flaw. It gets written, and then it sits in
|
|
314
|
+
a closed terminal until somebody comes back and reads it. Everything the
|
|
315
|
+
session knew — the files it had open, the half-made decision, the reason the
|
|
316
|
+
second approach was abandoned — expires with the window.
|
|
317
|
+
|
|
318
|
+
The relay closes that gap. Once the binding window passes a threshold you set,
|
|
319
|
+
**and** the session has an unfinished todo list or an approved plan to carry,
|
|
320
|
+
it books a one-shot wake for a few minutes after the reset. Arming costs
|
|
321
|
+
nothing and changes nothing about the work in progress; that is the point,
|
|
322
|
+
because nobody should slow down to prepare for a wall. Then, at the wake, it
|
|
323
|
+
re-checks the meter and hands your continuation back.
|
|
324
|
+
|
|
325
|
+
```
|
|
326
|
+
/usage-limits:relay on
|
|
327
|
+
/usage-limits:relay mode resume
|
|
328
|
+
/usage-limits:relay permission acceptEdits
|
|
329
|
+
```
|
|
330
|
+
|
|
331
|
+
What changes while it is armed is what Claude is told at the wall. Instead of
|
|
332
|
+
"write the handoff and stop", the budget line says the relay has it, that being
|
|
333
|
+
cut off now costs the wait rather than the work, and that the continuation is a
|
|
334
|
+
prompt to be acted on rather than a summary for a person to read.
|
|
335
|
+
|
|
336
|
+
| | |
|
|
337
|
+
| --- | --- |
|
|
338
|
+
| **Off by default** | Scheduling an agent to run while nobody is watching is a decision you make on purpose, not one a plugin makes for you. |
|
|
339
|
+
| **Only with work to carry** | It reads the session's own todo list and approved plan out of the transcript. An idle chat is not a project and never arms. |
|
|
340
|
+
| **`notify` by default** | It raises a notification with the continuation ready to open, and starts nothing. `mode resume` is the opt-in that runs the CLI itself. |
|
|
341
|
+
| **It re-checks the meter** | The reset time is a prediction; the meter is the fact. If the window has not actually turned over it books another wake rather than spending the first minute of a fresh window on a refusal. |
|
|
342
|
+
| **It survives sleep** | Registered through the ScheduledTasks module with `StartWhenAvailable` and `WakeToRun`, so a machine asleep at the moment fires on wake instead of missing it silently. |
|
|
343
|
+
| **It cleans up after itself** | The task carries an expiry, and the wake unregisters it once the outcome is recorded. |
|
|
344
|
+
| **Codex too** | `codex queue --thread` puts the continuation into a live session; `codex exec resume` revives a dead one. |
|
|
345
|
+
|
|
346
|
+
Two honest limits:
|
|
347
|
+
|
|
348
|
+
- **It cannot type into your terminal.** If Computer Use is installed the relay
|
|
349
|
+
uses it to tell whether you are at the keyboard — and if you are, it leaves a
|
|
350
|
+
notification instead of starting a second agent in the directory you are
|
|
351
|
+
working in. It does not send keystrokes to a shell or an editor, because that
|
|
352
|
+
plugin refuses to on purpose and routing around a safety rule because it is
|
|
353
|
+
inconvenient is how safety rules stop meaning anything.
|
|
354
|
+
- **Claude Code's own `autoContinueAtUsageLimit` is better where it applies.**
|
|
355
|
+
It waits inside the open session, so the process never dies and no context is
|
|
356
|
+
reconstructed. It is documented not to offer the wait for `-p` runs or
|
|
357
|
+
background sessions, and it cannot help a terminal that has been closed or a
|
|
358
|
+
machine that slept — and it sends a fixed prompt of its own rather than the
|
|
359
|
+
plan your session actually wrote. That is the gap this fills.
|
|
360
|
+
|
|
361
|
+
`/usage-limits:relay` on its own reports where it stands: whether it is on,
|
|
362
|
+
what is armed, when it wakes, what is available on this machine, and what the
|
|
363
|
+
last relay actually did.
|
|
364
|
+
|
|
365
|
+
## Voice: so the prompt it writes sounds like you
|
|
366
|
+
|
|
367
|
+
The prompt that restarts your work is written by the plugin, not by you. A
|
|
368
|
+
prompt that reads like a form letter gets a reply that reads like a form
|
|
369
|
+
letter, so the plugin keeps a small profile of how you write and uses it there.
|
|
370
|
+
|
|
371
|
+
It is counters — message length, how often you start lowercase, whether you end
|
|
372
|
+
with a full stop, dropped apostrophes, capitals for emphasis, how you open —
|
|
373
|
+
plus at most two short lines of your own text kept as examples. No model call
|
|
374
|
+
is involved, nothing leaves the machine, and it says nothing at all until it
|
|
375
|
+
has seen a dozen prompts, because style measured on less than that is noise.
|
|
376
|
+
|
|
377
|
+
```
|
|
378
|
+
/usage-limits:voice what it knows, including the kept lines
|
|
379
|
+
/usage-limits:voice set "blunt, no preamble"
|
|
380
|
+
/usage-limits:voice forget deletes it outright
|
|
381
|
+
```
|
|
382
|
+
|
|
383
|
+
`set` is the other half, and the more useful one: it is not what the plugin
|
|
384
|
+
learned about you, it is you saying how you want to be talked to. It goes in
|
|
385
|
+
front of every prompt and it wins over anything learned.
|
|
386
|
+
|
|
387
|
+
One deliberate omission: misspellings. They are the most individual thing in
|
|
388
|
+
anyone's writing and the worst thing to put in a prompt — told that somebody
|
|
389
|
+
makes mistakes, a model makes mistakes everywhere. Only patterns that are
|
|
390
|
+
choices are recorded, and the card says outright not to introduce errors.
|
|
391
|
+
|
|
267
392
|
## Releasing
|
|
268
393
|
|
|
269
394
|
```
|
|
@@ -661,9 +786,14 @@ today; and the hooks themselves, ready for the build that runs them. `status`
|
|
|
661
786
|
reports both, `off` removes both, and neither touches anything else in those
|
|
662
787
|
files.
|
|
663
788
|
|
|
664
|
-
The practical difference is that under Codex the budget is read deliberately
|
|
665
|
-
|
|
666
|
-
every
|
|
789
|
+
The practical difference is that under Codex the budget is read deliberately
|
|
790
|
+
rather than being handed to you before every prompt: once at the start of a
|
|
791
|
+
piece of work, again every ten or so tool-heavy turns and before the last long
|
|
792
|
+
step, and when the turns left are fewer than the steps still ahead the block
|
|
793
|
+
tells Codex to stop at a clean boundary, write WORK-PLAN.md and commit rather
|
|
794
|
+
than run into the limit. That last rule exists because a Codex session on
|
|
795
|
+
7 September 2026 read "about 32 turns left", carried on through forty minutes
|
|
796
|
+
of publishing, and was cut off with the handoff unwritten.
|
|
667
797
|
|
|
668
798
|
Two smaller differences. There is no money column: Codex meters a share of an
|
|
669
799
|
allowance and never quotes a price, so the percentages stand alone. And
|
package/bin/cli.js
CHANGED
|
@@ -29,6 +29,7 @@ const HELP = `claude-usage-limits - how much agent usage is left, and whether th
|
|
|
29
29
|
claude-usage-limits lowpower status show the current effort setting
|
|
30
30
|
claude-usage-limits lowpower on lower effortLevel, remembering the old value
|
|
31
31
|
claude-usage-limits lowpower on --effort medium --model sonnet
|
|
32
|
+
claude-usage-limits lowpower on --host codex --effort low
|
|
32
33
|
claude-usage-limits lowpower off put back exactly what was there
|
|
33
34
|
|
|
34
35
|
claude-usage-limits codex-hook status is the Codex prompt hook installed
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Carry the current project across the usage reset - arm, check or cancel the automatic pick-up
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
The relay books a one-shot wake a few minutes after the usage window resets and
|
|
6
|
+
hands your continuation back then, instead of the work ending when the budget
|
|
7
|
+
does. It is off until you turn it on, and it only ever arms while the session
|
|
8
|
+
has an unfinished todo list or an approved plan to carry.
|
|
9
|
+
|
|
10
|
+
Run `node "${CLAUDE_PLUGIN_ROOT}/skills/usage-limits/scripts/relay.js" $ARGUMENTS`
|
|
11
|
+
(add `--host codex` under Codex) and read the answer back.
|
|
12
|
+
|
|
13
|
+
With no arguments that prints the status: whether it is on, where it arms, what
|
|
14
|
+
is armed right now, when it wakes, and what the last relay did.
|
|
15
|
+
|
|
16
|
+
The rest:
|
|
17
|
+
|
|
18
|
+
- `on` / `off` - the master switch.
|
|
19
|
+
- `at 75` - the percentage of the binding window at which a wake is booked.
|
|
20
|
+
Arming costs nothing and does not change the work, so this is deliberately
|
|
21
|
+
well below the wall.
|
|
22
|
+
- `grace 5` - minutes after the reset before the wake fires. The reset time is
|
|
23
|
+
when the window opens; a request one second later has been refused before.
|
|
24
|
+
- `mode notify` - raise a notification with the continuation ready to open.
|
|
25
|
+
This is the default and it starts nothing by itself.
|
|
26
|
+
- `mode resume` - at the wake, run the CLI in the project directory and hand
|
|
27
|
+
the continuation back to the same conversation. Say `permission acceptEdits`
|
|
28
|
+
(or whichever mode you want) as well: a headless resume does **not** inherit
|
|
29
|
+
the session's permission mode, so without one it will sit waiting for an
|
|
30
|
+
approval nobody is there to give.
|
|
31
|
+
- `thinking off|resume|always` - `resume` puts the word ultrathink into the
|
|
32
|
+
prompt the relay delivers. `always` sets `alwaysThinkingEnabled` in your
|
|
33
|
+
settings, backs the file up first, and applies to new sessions.
|
|
34
|
+
- `note "<text>"` (or `note --file <path>`) - store the continuation. This is
|
|
35
|
+
the text that gets delivered, so write it to be acted on: what is done, what
|
|
36
|
+
is next in order, which files are mid-change, what to verify first.
|
|
37
|
+
- `cancel` - drop the wake and remove the scheduled task.
|
|
38
|
+
- `log` - the last twenty lines of what the relay actually did.
|
|
39
|
+
|
|
40
|
+
If the user asks for something the relay cannot do, say so rather than
|
|
41
|
+
approximating it. In particular it cannot type into a terminal or an editor:
|
|
42
|
+
Computer Use refuses to send input to a shell on purpose, and the relay uses it
|
|
43
|
+
only to tell whether somebody is at the keyboard.
|
|
44
|
+
|
|
45
|
+
Report the answer and stop. Do not start other work as part of this command.
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Show, set or delete what the plugin has learned about how you write
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
The plugin watches the prompts you type and keeps a small profile of how you
|
|
6
|
+
write - message length, punctuation, capitals, openings, contractions. No model
|
|
7
|
+
call is involved and nothing leaves the machine: it is counters, plus at most
|
|
8
|
+
two short lines of your own text kept as examples.
|
|
9
|
+
|
|
10
|
+
It exists so that text written on your behalf sounds like you. The one place
|
|
11
|
+
that happens today is the relay: when a project is carried across a usage
|
|
12
|
+
reset, the prompt that restarts it is written by the plugin, not by you.
|
|
13
|
+
|
|
14
|
+
Run `node "${CLAUDE_PLUGIN_ROOT}/skills/usage-limits/scripts/voice.js" $ARGUMENTS`
|
|
15
|
+
and read the answer back verbatim - especially the kept lines, which are the
|
|
16
|
+
only raw text stored.
|
|
17
|
+
|
|
18
|
+
- (no arguments) - what it knows, how many prompts it has seen, and where the
|
|
19
|
+
file is.
|
|
20
|
+
- `card` - the exact text that gets injected when the plugin writes as you.
|
|
21
|
+
- `set "<instruction>"` - tell the agent how you want to be talked to. This is
|
|
22
|
+
the other half: it goes in front of every prompt, it wins over anything
|
|
23
|
+
learned, and it is the thing to use for "be blunt", "no preamble", "explain
|
|
24
|
+
like I already know the codebase".
|
|
25
|
+
- `clear` - drop that instruction and go back to the learned traits alone.
|
|
26
|
+
- `off` / `on` - stop or resume learning. `off` keeps what it has.
|
|
27
|
+
- `forget` - delete the profile entirely.
|
|
28
|
+
|
|
29
|
+
It says nothing until it has seen a dozen prompts, and calls itself provisional
|
|
30
|
+
until fifty; short-text style measurements below that are noise, and it should
|
|
31
|
+
not pretend otherwise.
|
|
32
|
+
|
|
33
|
+
Report the answer and stop. Do not start other work as part of this command.
|
package/hooks/hooks.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"description": "Tells Claude how much usage budget is left: once before each prompt, and again during long turns so the figure it is working from does not go stale. Tells you what each reply and each session cost, after the reply and when the session closes.",
|
|
2
|
+
"description": "Tells Claude how much usage budget is left: once before each prompt, and again during long turns so the figure it is working from does not go stale. Tells you what each reply and each session cost, after the reply and when the session closes. Says the number once more right before a Workflow or Agent call, because the agents it spawns spend the same window and nothing can speak again until they stop.",
|
|
3
3
|
"hooks": {
|
|
4
4
|
"Stop": [
|
|
5
5
|
{
|
|
@@ -44,6 +44,29 @@
|
|
|
44
44
|
}
|
|
45
45
|
]
|
|
46
46
|
}
|
|
47
|
+
],
|
|
48
|
+
"SubagentStop": [
|
|
49
|
+
{
|
|
50
|
+
"hooks": [
|
|
51
|
+
{
|
|
52
|
+
"type": "command",
|
|
53
|
+
"command": "node \"${CLAUDE_PLUGIN_ROOT}/skills/usage-limits/scripts/pulse.js\"",
|
|
54
|
+
"timeout": 10
|
|
55
|
+
}
|
|
56
|
+
]
|
|
57
|
+
}
|
|
58
|
+
],
|
|
59
|
+
"PreToolUse": [
|
|
60
|
+
{
|
|
61
|
+
"matcher": "Workflow|Agent|Task",
|
|
62
|
+
"hooks": [
|
|
63
|
+
{
|
|
64
|
+
"type": "command",
|
|
65
|
+
"command": "node \"${CLAUDE_PLUGIN_ROOT}/skills/usage-limits/scripts/pulse.js\"",
|
|
66
|
+
"timeout": 10
|
|
67
|
+
}
|
|
68
|
+
]
|
|
69
|
+
}
|
|
47
70
|
]
|
|
48
71
|
}
|
|
49
72
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "claude-usage-limits",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.13.0",
|
|
4
4
|
"description": "Puts your remaining Claude Code usage limit into Claude's context before every prompt, so it opens with what fits in the budget instead of starting work that gets cut off. Reports headroom as turns rather than percentages, prices a job before you start it, and detects your plan tier.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"claude",
|
|
@@ -389,6 +389,82 @@ afternoon, so there is no longer anything to buy by winding down.
|
|
|
389
389
|
The one thing not to economise on is the handoff itself. Everything else can be
|
|
390
390
|
picked up next session; a session that ends without one cannot.
|
|
391
391
|
|
|
392
|
+
## 6. The relay: when the handoff picks itself up
|
|
393
|
+
|
|
394
|
+
If a relay is armed, the budget line says so, and the shape of the last hour
|
|
395
|
+
changes. The handoff stops being a note for a person to find and becomes the
|
|
396
|
+
prompt this conversation will be handed back a few minutes after the window
|
|
397
|
+
reopens. So do not wind down, do not narrow the request, and do not stop to
|
|
398
|
+
ask whether to carry on — write the continuation properly and keep working
|
|
399
|
+
until the window actually ends.
|
|
400
|
+
|
|
401
|
+
Write it with:
|
|
402
|
+
|
|
403
|
+
```
|
|
404
|
+
node "$CLAUDE_PLUGIN_ROOT/skills/usage-limits/scripts/relay.js" note "<text>"
|
|
405
|
+
```
|
|
406
|
+
|
|
407
|
+
Write it to be **acted on**, not read: what is done, what is next in order,
|
|
408
|
+
which files are mid-change, what must be verified before anything is built on
|
|
409
|
+
it. It is delivered as a prompt, so an instruction beats a summary. If nothing
|
|
410
|
+
is written, the relay falls back to the outstanding todo list, which is worse.
|
|
411
|
+
|
|
412
|
+
The relay is off unless the user turned it on, and it only arms while there is
|
|
413
|
+
an unfinished todo list or an approved plan to carry. Do not turn it on for
|
|
414
|
+
them, and do not promise behaviour it does not have:
|
|
415
|
+
|
|
416
|
+
- It **cannot** type into a terminal or an editor. Computer Use refuses to send
|
|
417
|
+
input to a shell on purpose; the relay uses it only to tell whether somebody
|
|
418
|
+
is at the keyboard, and to show a banner.
|
|
419
|
+
- In `notify` mode — the default — it raises a notification and starts nothing.
|
|
420
|
+
- In `resume` mode it runs the CLI itself. A headless resume does **not**
|
|
421
|
+
inherit the session's permission mode, so unless one was set the resumed run
|
|
422
|
+
will sit waiting for an approval nobody is there to give.
|
|
423
|
+
- Claude Code's own `autoContinueAtUsageLimit` is better wherever it applies,
|
|
424
|
+
because the process never dies. It does not apply to `-p` runs, background
|
|
425
|
+
sessions, or a terminal that has been closed.
|
|
426
|
+
|
|
427
|
+
`node scripts/relay.js` with no arguments reports all of it.
|
|
428
|
+
|
|
429
|
+
## Voice
|
|
430
|
+
|
|
431
|
+
The plugin keeps a small local profile of how the user writes — counters, plus
|
|
432
|
+
at most two short lines of their own text — so that anything written *as* them
|
|
433
|
+
sounds like them. It costs no model call and never leaves the machine.
|
|
434
|
+
|
|
435
|
+
Two separate things live there and they are not the same:
|
|
436
|
+
|
|
437
|
+
- The **learned traits** are for writing as the user. Today that is the relay
|
|
438
|
+
prompt. Do not imitate them in your own replies.
|
|
439
|
+
- The **instruction** they typed at `/usage-limits:voice set` is how they want
|
|
440
|
+
to be talked to. It appears in the budget line and it applies to you.
|
|
441
|
+
|
|
442
|
+
If asked what it knows, run `node scripts/voice.js` and read it back verbatim,
|
|
443
|
+
including the kept lines. `forget` deletes it outright.
|
|
444
|
+
|
|
445
|
+
## Codex, seen from Claude Code
|
|
446
|
+
|
|
447
|
+
When Codex is installed on the same machine, every display shows its meter
|
|
448
|
+
underneath Claude's: the panel, the status line, the budget line before each
|
|
449
|
+
prompt, the VS Code view and `check`. It is read from the rollouts Codex has
|
|
450
|
+
already written — no child process, no network, and nothing at all if Codex is
|
|
451
|
+
not installed.
|
|
452
|
+
|
|
453
|
+
**It counts the other way, and that is not a bug.** Codex writes what it has
|
|
454
|
+
*spent* but shows what is *left*: its own status card prints "82% left" where
|
|
455
|
+
Claude Code prints "62% used". So the Codex rows report what remains, their
|
|
456
|
+
bars drain as they are spent where Claude's fill, and every figure carries the
|
|
457
|
+
word "left" so the two can never be read as the same kind of number. The
|
|
458
|
+
colours turn at the same real moment either way — 80% used is 20% left is
|
|
459
|
+
yellow, 90% used is 10% left is red.
|
|
460
|
+
|
|
461
|
+
There is no mark beside it, only the word "Codex" in OpenAI's green. Codex has
|
|
462
|
+
no mark of its own — it uses OpenAI's Blossom, and there is no Blossom codepoint
|
|
463
|
+
in Unicode, so a terminal cannot draw one. The nearest rosette is a flower, and
|
|
464
|
+
a flower in the slot where a logo should be is not the logo; the word is
|
|
465
|
+
unambiguous and cannot come out as something else in a font that has never heard
|
|
466
|
+
of it.
|
|
467
|
+
|
|
392
468
|
## Running under Codex
|
|
393
469
|
|
|
394
470
|
Everything above works the same. The numbers come from a different place and
|
|
@@ -410,11 +486,14 @@ happened to write. It starts a short-lived `codex app-server`, takes about a
|
|
|
410
486
|
second, and is the Codex equivalent of running `/usage` in Claude Code. Use it
|
|
411
487
|
when the report says the snapshot is old, not routinely.
|
|
412
488
|
|
|
413
|
-
The difference that matters: **
|
|
414
|
-
Claude Code lets a plugin ship hooks, so it gets one
|
|
415
|
-
not load hooks from a plugin
|
|
416
|
-
`~/.codex/hooks.json`
|
|
417
|
-
|
|
489
|
+
The difference that matters: **the budget line is not automatic until you say
|
|
490
|
+
so.** Claude Code lets a plugin ship hooks, so it gets one on install. Codex
|
|
491
|
+
does not load hooks from a plugin (`plugin_hooks` is a removed feature), and it
|
|
492
|
+
runs the ones in `~/.codex/hooks.json` only after a one-time review it shows
|
|
493
|
+
when `codex` starts in a terminal: "Hooks need review - Trust all and
|
|
494
|
+
continue". The desktop app never shows that review, so a machine using only
|
|
495
|
+
the app can have the hooks installed for weeks and never run them once.
|
|
496
|
+
`install-codex-hook.js status` says whether they have ever run.
|
|
418
497
|
|
|
419
498
|
What replaces it is an instruction, installed by:
|
|
420
499
|
|
|
@@ -437,6 +516,45 @@ say and there is no dollar figure to attach. `scripts/lowpower.js` is for Claude
|
|
|
437
516
|
Code only: it writes Claude's `settings.json`, so it must not be run under
|
|
438
517
|
Codex. Change model or effort through Codex's own controls instead.
|
|
439
518
|
|
|
519
|
+
### The effort setting is the thing that empties the window
|
|
520
|
+
|
|
521
|
+
On Codex this matters more than anywhere else, because the reasoning effort is
|
|
522
|
+
set in `~/.codex/config.toml` and then applies to everything until it is
|
|
523
|
+
changed:
|
|
524
|
+
|
|
525
|
+
```toml
|
|
526
|
+
model = "gpt-6-astra"
|
|
527
|
+
model_reasoning_effort = "ultra"
|
|
528
|
+
```
|
|
529
|
+
|
|
530
|
+
A percentage and a turn count do not warn you about that, and it is the single
|
|
531
|
+
most common way an allowance disappears. The headroom figure is built from what
|
|
532
|
+
a turn has cost *on average*, and the average is dominated by whatever effort
|
|
533
|
+
you were running last week. Move to a dearer one and every estimate is too
|
|
534
|
+
generous until enough expensive turns have landed to drag the average up — and
|
|
535
|
+
on a five-hour window on Plus there is no "enough", because the window is gone
|
|
536
|
+
first. One ordinary task at `ultra` on Astra can take the lot while the report
|
|
537
|
+
still says there is room.
|
|
538
|
+
|
|
539
|
+
So the report measures each effort separately and prices the window at the one
|
|
540
|
+
actually set. Two things surface it:
|
|
541
|
+
|
|
542
|
+
- `node scripts/usage.js --host codex` prints **what each effort costs,
|
|
543
|
+
measured on this machine** — turns, output written per turn, and a `*` on the
|
|
544
|
+
one in force.
|
|
545
|
+
- When the current effort is materially dearer than a cheaper one on record,
|
|
546
|
+
the budget line says so outright, with what the window really holds at this
|
|
547
|
+
setting rather than at the blend.
|
|
548
|
+
|
|
549
|
+
The comparison is on **output tokens per turn**, not cost per turn. Cost per
|
|
550
|
+
turn mostly tracks how big the context happened to be — measured that way,
|
|
551
|
+
`low` turns on a huge context can look dearer than `ultra` ones on a short one,
|
|
552
|
+
which is exactly backwards. Output is the part the effort setting controls.
|
|
553
|
+
|
|
554
|
+
Act on it the same way as everything else here: keep the high effort where the
|
|
555
|
+
work genuinely needs the thinking, and drop it where it does not. It changes
|
|
556
|
+
what every turn costs, not how many turns you get.
|
|
557
|
+
|
|
440
558
|
## When to skip this skill
|
|
441
559
|
|
|
442
560
|
Do not run the report on every prompt. Once at the start of a long piece of
|
|
@@ -471,4 +589,11 @@ stop.
|
|
|
471
589
|
| `scripts/feed.js` | The status line command Claude Code runs. Not meant to be called by hand. |
|
|
472
590
|
| `scripts/live.js` | The usage reading itself, taken the way Claude Code takes it for `/usage`, kept in `usage-limits-live.json` where `collect()` prefers it when newer than the cache. |
|
|
473
591
|
| `scripts/view.js`, `scripts/bars.js`, `scripts/activity.js` | The display model, the drawing in Claude's colours, and the working/idle marks the hooks leave for the panel. Not meant to be called by hand. |
|
|
592
|
+
| `scripts/relay.js` | The relay: `status`, `on`/`off`, `at N`, `grace N`, `mode notify\|resume`, `permission MODE`, `thinking off\|resume\|always`, `note "<text>"`, `cancel`, `log`. |
|
|
593
|
+
| `scripts/wake.js` | What the scheduler runs after the reset: re-checks the meter, then notifies or resumes. Never called by hand. |
|
|
594
|
+
| `scripts/voice.js` | The local writing profile: `show`, `card`, `set "<instruction>"`, `clear`, `off`/`on`, `forget`. |
|
|
474
595
|
| `references/how-it-works.md` | Where the numbers come from and where they are soft. |
|
|
596
|
+
|
|
597
|
+
## Codex controls
|
|
598
|
+
|
|
599
|
+
Under Codex, use `node scripts/lowpower.js on --host codex --effort low` to save defaults for new sessions, optionally adding `--model <supported-model-id>`. `off --host codex` restores them; `--dry-run` previews them. These writes cannot change an active task. Use host controls for its current model and effort; do not prescribe Claude models or /effort in Codex. Headroom is an estimate shared with other account activity, not reserved capacity.
|
|
@@ -34,6 +34,13 @@ const THEME = {
|
|
|
34
34
|
permission: [177, 185, 249],
|
|
35
35
|
ultra: [175, 135, 255],
|
|
36
36
|
ultraShimmer: [208, 180, 255],
|
|
37
|
+
// The Codex row's mark, in the green OpenAI's own products have used, chosen
|
|
38
|
+
// because it sits at the same visual weight as Claude's orange rather than
|
|
39
|
+
// shouting over it: relative luminance 0.278 against Claude's 0.283, and a
|
|
40
|
+
// hue about 148 degrees away, so the two marks read as a pair on one line
|
|
41
|
+
// and neither one wins. The shimmer is the same lift the Claude one gets.
|
|
42
|
+
codex: [16, 163, 127],
|
|
43
|
+
codexShimmer: [36, 203, 167],
|
|
37
44
|
rainbow: [
|
|
38
45
|
[235, 95, 87],
|
|
39
46
|
[245, 139, 87],
|
|
@@ -73,6 +80,35 @@ const EMPTY = '░';
|
|
|
73
80
|
const FILL_ASCII = '#';
|
|
74
81
|
const EMPTY_ASCII = '-';
|
|
75
82
|
|
|
83
|
+
// Claude Code's own six-pointed asterisk, in the two forms.
|
|
84
|
+
const CLAUDE_MARK = '✻';
|
|
85
|
+
const CLAUDE_MARK_ASCII = '*';
|
|
86
|
+
|
|
87
|
+
// Codex is labelled with its name, not a mark.
|
|
88
|
+
//
|
|
89
|
+
// It has no mark of its own: it uses OpenAI's Blossom, and there is no Blossom
|
|
90
|
+
// codepoint in Unicode, so a terminal cannot draw one. The nearest rosette is
|
|
91
|
+
// a flower, and a flower standing in for a logo is not the logo - it is a
|
|
92
|
+
// different picture in the same slot, which is worse than no picture at all.
|
|
93
|
+
// The word is unambiguous, costs five columns, and cannot come out as
|
|
94
|
+
// something else in a font that has never heard of it.
|
|
95
|
+
const CODEX_LABEL = 'Codex';
|
|
96
|
+
|
|
97
|
+
// Claude's mark, in the two forms, so the status line, the panel and the VS
|
|
98
|
+
// Code view cannot end up drawing different ones.
|
|
99
|
+
function mark(options) {
|
|
100
|
+
const opts = options || {};
|
|
101
|
+
return opts.ascii ? CLAUDE_MARK_ASCII : CLAUDE_MARK;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
function markColour(which) {
|
|
105
|
+
return which === 'codex' ? THEME.codex : THEME.claude;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
function markShimmer(which) {
|
|
109
|
+
return which === 'codex' ? THEME.codexShimmer : THEME.claudeShimmer;
|
|
110
|
+
}
|
|
111
|
+
|
|
76
112
|
const DAYS = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
|
|
77
113
|
|
|
78
114
|
function level(percent) {
|
|
@@ -82,6 +118,19 @@ function level(percent) {
|
|
|
82
118
|
return 'fill';
|
|
83
119
|
}
|
|
84
120
|
|
|
121
|
+
// The same two thresholds, read from the other end.
|
|
122
|
+
//
|
|
123
|
+
// Codex counts down: it reports what is LEFT, and its own status card says
|
|
124
|
+
// "82% left" where Claude Code says "62% used". So the Codex rows are drawn
|
|
125
|
+
// draining rather than filling, and the colours have to turn at the same real
|
|
126
|
+
// moment: 80 percent used is 20 percent left, and 90 used is 10 left.
|
|
127
|
+
function levelLeft(percentLeft) {
|
|
128
|
+
if (!Number.isFinite(percentLeft)) return 'fill';
|
|
129
|
+
if (percentLeft <= 100 - DANGER_AT) return 'error';
|
|
130
|
+
if (percentLeft <= 100 - WARN_AT) return 'warning';
|
|
131
|
+
return 'fill';
|
|
132
|
+
}
|
|
133
|
+
|
|
85
134
|
function levelColour(name) {
|
|
86
135
|
if (name === 'error') return THEME.error;
|
|
87
136
|
if (name === 'warning') return THEME.warning;
|
|
@@ -333,7 +382,14 @@ module.exports = {
|
|
|
333
382
|
SPINNER,
|
|
334
383
|
FRAMES,
|
|
335
384
|
level,
|
|
385
|
+
levelLeft,
|
|
336
386
|
levelColour,
|
|
387
|
+
CLAUDE_MARK,
|
|
388
|
+
CLAUDE_MARK_ASCII,
|
|
389
|
+
CODEX_LABEL,
|
|
390
|
+
mark,
|
|
391
|
+
markColour,
|
|
392
|
+
markShimmer,
|
|
337
393
|
colourMode,
|
|
338
394
|
to256,
|
|
339
395
|
paint,
|