claude-usage-limits 1.11.6 → 1.11.7

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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "usage-limits",
3
3
  "displayName": "Usage Limits",
4
- "version": "1.11.6",
4
+ "version": "1.11.7",
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.11.6",
3
+ "version": "1.11.7",
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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-usage-limits",
3
- "version": "1.11.6",
3
+ "version": "1.11.7",
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",
@@ -59,6 +59,16 @@ const DEFAULTS = {
59
59
  // A hook has ten seconds; the reading gets four of them at most.
60
60
  const REFRESH_TIMEOUT_MS = 4000;
61
61
 
62
+ // Past this much of a per-model week, say how to free it. Below it the advice
63
+ // is noise: there is room, and the model in use is the right one.
64
+ const HALF_SPENT = 50;
65
+
66
+ // "fable" -> "Fable", the way the account names the window.
67
+ function familyLabel(family) {
68
+ const name = String(family || '');
69
+ return name ? name.charAt(0).toUpperCase() + name.slice(1) : name;
70
+ }
71
+
62
72
  // The runway is worth saying long before it is worth acting on, because it is
63
73
  // the figure that stops a turn count from flattering. Two hundred turns sounds
64
74
  // like plenty and can be twenty minutes when three sessions are spending.
@@ -269,6 +279,10 @@ function pressure(window, now, config, turnsLeft) {
269
279
  const CACHED_BINDING_FIELDS = [
270
280
  'key',
271
281
  'label',
282
+ // The model family a per-model weekly is scoped to. Read by the line that
283
+ // says a model switch is the only thing that frees such a window, so it has
284
+ // to survive the cache like every other field the wording depends on.
285
+ 'family',
272
286
  'applies',
273
287
  'percentUsed',
274
288
  'stale',
@@ -446,6 +460,17 @@ function briefText(parts) {
446
460
  'the amount that ran out last time, not a fresh allowance.'
447
461
  );
448
462
  }
463
+ // A per-model weekly is the one window effort cannot help with. Nothing you
464
+ // do more cheaply on this model frees it; only running a different model
465
+ // does, and that has to be said, because the obvious move at 90 percent is
466
+ // to drop the effort and keep going, which spends the same window slower.
467
+ if (parts.family) {
468
+ sentences.push(
469
+ 'That window counts ' + parts.family + ' turns only, so lowering effort does not free it: ' +
470
+ 'switching model does. Use /model (or scripts/lowpower.js on --model <other>) for work ' +
471
+ 'that does not need ' + parts.family + ', and keep this one for what does.'
472
+ );
473
+ }
449
474
  if (parts.othersSummary) sentences.push('Other windows: ' + parts.othersSummary + '.');
450
475
 
451
476
  // A window that is not binding can still be the expensive one to exhaust.
@@ -721,6 +746,12 @@ async function run(now, hookInput) {
721
746
  ? usage.formatDuration(now - binding.refusedAt)
722
747
  : null,
723
748
  binding,
749
+ // Named only while the window is actually tight: at 20 percent nobody
750
+ // needs telling how to free it.
751
+ family:
752
+ binding && binding.family && Number.isFinite(binding.percentUsed) && binding.percentUsed >= HALF_SPENT
753
+ ? familyLabel(binding.family)
754
+ : null,
724
755
  othersSummary: view.othersSummary,
725
756
  turnsLeft: view.turnsLeft,
726
757
  resetsIn: