claude-token-saver 3.16.0 โ†’ 3.17.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/README.en.md CHANGED
@@ -6,9 +6,7 @@
6
6
 
7
7
  ## ๐Ÿ”€ Routing saved โ€” the reason this tool exists
8
8
 
9
- ```
10
- ๐Ÿ”€ Routing saved $2.09 | fableโ†’sonnet 1ร— $0.72 ยท opusโ†’haiku 1ร— $0.57 ยท fableโ†’haiku 1ร— $0.51 ยท opusโ†’sonnet 2ร— $0.29
11
- ```
9
+ ![statusline example โ€” routing savings on row 1, diagnostics on row 2](./docs/statusline.png)
12
10
 
13
11
  **That figure on the first statusline row is the whole product.** It is money actually saved by moving the easy work your expensive model kept repeating onto cheaper ones โ€” and right beside it is which model that money moved off, and onto what.
14
12
 
@@ -40,8 +38,6 @@ By run (newest first):
40
38
  npm i -g claude-token-saver # postinstall auto-registers the statusline + Skill
41
39
  ```
42
40
 
43
- ![statusline example](./docs/statusline.png)
44
-
45
41
  ---
46
42
 
47
43
  ## โšก Why โ€” the 30-second pitch
@@ -87,6 +83,8 @@ npm i -g claude-token-saver
87
83
 
88
84
  The statusline appears at the bottom of Claude Code right away. If auto-registration was skipped (`--ignore-scripts`, sudo, sandboxed installs), run `claude-token-saver install`.
89
85
 
86
+ One install sets up everything: **statusline, Skill, SessionStart hook, the ๐Ÿ…ท Harness (5 principles), and a first route-scan.** The harness is **appended** to `~/.claude/CLAUDE.md` as a marked block (your existing content is backed up and preserved) and is left alone if one is already there. Skip it with `CTS_NO_HARNESS=1 npm i -g claude-token-saver`; undo it with `claude-token-saver harness uninit --global`.
87
+
90
88
  > โš ๏ธ Avoid `sudo` global installs โ€” the Skill lands in root's `~/.claude` instead of yours. Use nvm/fnm/Volta or `npm config set prefix ~/.npm-global`.
91
89
 
92
90
  ## Reading the statusline
@@ -339,6 +337,10 @@ Also update `statusLine.command` in `~/.claude/settings.json` to `claude-token-s
339
337
 
340
338
  ## Release notes
341
339
 
340
+ ### v3.17.0 (2026-08-22)
341
+ - **One install now sets up the ๐Ÿ…ท Harness too** โ€” until now `harness init` was a separate step, without which the ๐Ÿ…ท score and ratchet-rule delivery did nothing. The install **appends** the 5-principle block to `~/.claude/CLAUDE.md` (existing content backed up and preserved; an existing block is left alone). Skip with `CTS_NO_HARNESS=1`, undo with `harness uninit --global`.
342
+ - **The README leads with the real statusline screenshot** โ€” the capture replaces the code block at the top, and the duplicate image further down was removed.
343
+
342
344
  ### v3.16.0 (2026-08-22)
343
345
  - **README restructured around routing savings** โ€” `๐Ÿ”€ Routing saved` now opens the page, with how the figure is derived (before / after / gap) and the real `route-scan savings` output alongside it. Channel and homepage badges moved to a "Who makes this" section at the bottom.
344
346
  - **Statusline screenshot refreshed to the current two-row layout** โ€” captured from real output rather than mocked up. Regenerate with `npm run docs:statusline` (headless Chrome; no dependencies added).
package/README.md CHANGED
@@ -6,9 +6,7 @@
6
6
 
7
7
  ## ๐Ÿ”€ Routing saved โ€” ์ด ๋„๊ตฌ๊ฐ€ ์กด์žฌํ•˜๋Š” ์ด์œ 
8
8
 
9
- ```
10
- ๐Ÿ”€ Routing saved $2.09 | fableโ†’sonnet 1ร— $0.72 ยท opusโ†’haiku 1ร— $0.57 ยท fableโ†’haiku 1ร— $0.51 ยท opusโ†’sonnet 2ร— $0.29
11
- ```
9
+ ![statusline ์˜ˆ์‹œ โ€” 1์ค„์งธ ๋ผ์šฐํŒ… ์ ˆ๊ฐ, 2์ค„์งธ ์ง„๋‹จ ์นฉ](./docs/statusline.png)
12
10
 
13
11
  **statusline ์ฒซ ์ค„์— ๋œจ๋Š” ์ด ๊ธˆ์•ก์ด ์ „๋ถ€์ž…๋‹ˆ๋‹ค.** ๋น„์‹ผ ๋ชจ๋ธ์ด ๋ฐ˜๋ณต ์ฒ˜๋ฆฌํ•ด ์˜จ ์‰ฌ์šด ์ž‘์—…์„ ๋” ์‹ผ ๋ชจ๋ธ๋กœ ๋‚ด๋ ค๋ณด๋‚ด์„œ **์‹ค์ œ๋กœ ์•„๋‚€ ๋ˆ**์ด๊ณ , ์˜†์—๋Š” ๊ทธ ๋ˆ์ด ์–ด๋А ๋ชจ๋ธ์—์„œ ์–ด๋А ๋ชจ๋ธ๋กœ ์˜ฎ๊ฒจ์„œ ์ƒ๊ฒผ๋Š”์ง€๊ฐ€ ๊ทธ๋Œ€๋กœ ๋ถ™์Šต๋‹ˆ๋‹ค.
14
12
 
@@ -40,8 +38,6 @@ $ claude-token-saver route-scan savings
40
38
  npm i -g claude-token-saver # postinstall์ด statusline + Skill ์ž๋™ ๋“ฑ๋ก
41
39
  ```
42
40
 
43
- ![statusline ์˜ˆ์‹œ](./docs/statusline.png)
44
-
45
41
  ---
46
42
 
47
43
  ## โšก ์™œ ์“ฐ๋‚˜ โ€” 30์ดˆ ์š”์•ฝ
@@ -86,6 +82,8 @@ npm i -g claude-token-saver
86
82
 
87
83
  ์„ค์น˜ ์ฆ‰์‹œ Claude Code ํ•˜๋‹จ์— statusline์ด ๋‚˜ํƒ€๋‚ฉ๋‹ˆ๋‹ค. `--ignore-scripts`/sudo ๋“ฑ์œผ๋กœ ์ž๋™ ๋“ฑ๋ก์ด ์•ˆ ๋๋‹ค๋ฉด `claude-token-saver install`๋กœ ์ˆ˜๋™ ๋“ฑ๋กํ•˜์„ธ์š”.
88
84
 
85
+ ์„ค์น˜ ํ•œ ๋ฒˆ์œผ๋กœ **statusline ยท Skill ยท SessionStart ํ›… ยท ๐Ÿ…ท Harness(5์›์น™) ยท ์ตœ์ดˆ route-scan** ์ด ๋ชจ๋‘ ์ค€๋น„๋ฉ๋‹ˆ๋‹ค. Harness๋Š” `~/.claude/CLAUDE.md`์— ํ‘œ์‹œ๋œ ๋ธ”๋ก์œผ๋กœ **์ถ”๊ฐ€**๋˜๋ฉฐ(๊ธฐ์กด ๋‚ด์šฉ์€ ๋ฐฑ์—… ํ›„ ๋ณด์กด), ์ด๋ฏธ ์„ค์ •๋ผ ์žˆ์œผ๋ฉด ๊ฑด๋“œ๋ฆฌ์ง€ ์•Š์Šต๋‹ˆ๋‹ค. ์›์น˜ ์•Š์œผ๋ฉด `CTS_NO_HARNESS=1 npm i -g claude-token-saver`๋กœ ๊ฑด๋„ˆ๋›ฐ๊ณ , ๋˜๋Œ๋ฆฌ๋ ค๋ฉด `claude-token-saver harness uninit --global`์„ ์‹คํ–‰ํ•˜์„ธ์š”.
86
+
89
87
  > โš ๏ธ sudo ๊ธ€๋กœ๋ฒŒ ์„ค์น˜๋Š” Skill์ด root์˜ `~/.claude`์— ๋“ฑ๋ก๋˜๋Š” ํ•จ์ •์ด ์žˆ์Šต๋‹ˆ๋‹ค โ€” nvm/fnm/Volta๋กœ ์‚ฌ์šฉ์ž ์˜์—ญ ์„ค์น˜๋ฅผ ๊ถŒ์žฅํ•ฉ๋‹ˆ๋‹ค.
90
88
 
91
89
  ## statusline ์ฝ๋Š” ๋ฒ•
@@ -305,6 +303,10 @@ npm uninstall -g claude-cache-monitor && npm i -g claude-token-saver
305
303
 
306
304
  ## ๋ฆด๋ฆฌ์Šค ๋…ธํŠธ
307
305
 
306
+ ### v3.17.0 (2026-08-22)
307
+ - **์„ค์น˜ ํ•œ ๋ฒˆ์œผ๋กœ ๐Ÿ…ท Harness๊นŒ์ง€ ์ ์šฉ๋ฉ๋‹ˆ๋‹ค** โ€” ์ง€๊ธˆ๊นŒ์ง€๋Š” ์„ค์น˜ ํ›„ `harness init`์„ ๋”ฐ๋กœ ์‹คํ–‰ํ•ด์•ผ statusline์˜ ๐Ÿ…ท ์ ์ˆ˜์™€ ratchet ๋ฃฐ ์ „๋‹ฌ์ด ๋™์ž‘ํ–ˆ์Šต๋‹ˆ๋‹ค. ์ด์ œ ์„ค์น˜๊ฐ€ `~/.claude/CLAUDE.md`์— 5์›์น™ ๋ธ”๋ก์„ **์ถ”๊ฐ€**ํ•ฉ๋‹ˆ๋‹ค(๊ธฐ์กด ๋‚ด์šฉ์€ ๋ฐฑ์—… ํ›„ ๋ณด์กด, ์ด๋ฏธ ์žˆ์œผ๋ฉด ๊ฑด๋“œ๋ฆฌ์ง€ ์•Š์Œ). ๊ฑด๋„ˆ๋›ฐ๋ ค๋ฉด `CTS_NO_HARNESS=1`, ๋˜๋Œ๋ฆฌ๋ ค๋ฉด `harness uninit --global`.
308
+ - **README ์ƒ๋‹จ์„ statusline ์‹ค์ œ ์Šคํฌ๋ฆฐ์ƒท์œผ๋กœ ๊ต์ฒด** โ€” ์ฝ”๋“œ ๋ธ”๋ก ๋Œ€์‹  ์‹ค์ œ ์บก์ฒ˜๋ฅผ ์ตœ์ƒ๋‹จ์— ๋‘๊ณ , ์•„๋ž˜์ชฝ์— ์ค‘๋ณต์œผ๋กœ ์žˆ๋˜ ์ด๋ฏธ์ง€๋Š” ๋บ์Šต๋‹ˆ๋‹ค.
309
+
308
310
  ### v3.16.0 (2026-08-22)
309
311
  - **README๋ฅผ ๋ผ์šฐํŒ… ์ ˆ๊ฐ ์ค‘์‹ฌ์œผ๋กœ ์žฌ๊ตฌ์„ฑ** โ€” ์ด ๋„๊ตฌ์˜ ํ•ต์‹ฌ์ด ๋ฌด์—‡์ธ์ง€ ์ฒซ ํ™”๋ฉด์—์„œ ๋ฐ”๋กœ ๋ณด์ด๋„๋ก `๐Ÿ”€ Routing saved`๋ฅผ ์ตœ์ƒ๋‹จ์— ์˜ฌ๋ฆฌ๊ณ , ๊ธˆ์•ก์ด ์›์žฅ์—์„œ ์–ด๋–ป๊ฒŒ ๋‚˜์˜ค๋Š”์ง€(before/after/์ฐจ์•ก)์™€ `route-scan savings` ์‹ค์ œ ์ถœ๋ ฅ์„ ํ•จ๊ป˜ ์‹ค์—ˆ์Šต๋‹ˆ๋‹ค. ์ฑ„๋„ยทํ™ˆํŽ˜์ด์ง€ ๋ฐฐ์ง€๋Š” ์ตœํ•˜๋‹จ "๋งŒ๋“  ๊ณณ"์œผ๋กœ ๋‚ด๋ ธ์Šต๋‹ˆ๋‹ค.
310
312
  - **statusline ์Šคํฌ๋ฆฐ์ƒท์„ ํ˜„์žฌ 2์ค„ ๋ ˆ์ด์•„์›ƒ์œผ๋กœ ๊ฐฑ์‹ ** โ€” ๋ชฉ์—…์ด ์•„๋‹ˆ๋ผ ์‹ค์ œ ์ถœ๋ ฅ์„ ์บก์ฒ˜ํ•ฉ๋‹ˆ๋‹ค. `npm run docs:statusline`์œผ๋กœ ์žฌ์ƒ์„ฑํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค(headless Chrome ์‚ฌ์šฉ, ์˜์กด์„ฑ ์ถ”๊ฐ€ ์—†์Œ).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-token-saver",
3
- "version": "3.16.0",
3
+ "version": "3.17.0",
4
4
  "description": "Route the easy work your expensive Claude model keeps repeating down to haiku/sonnet โ€” post-hoc session analysis, no realtime router, no extra LLM calls.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -59,6 +59,55 @@ export async function run({ hasFlag }) {
59
59
  } catch (e) { debug('install:route-scan-seed', e); /* hook-triggered scan covers it on the first session instead */ }
60
60
  }
61
61
  }
62
+ // Harness, set up as part of the install rather than left as a manual
63
+ // follow-up step. The ๐Ÿ…ท statusline segment and the ratchet rules that
64
+ // route-scan promotes both depend on the block existing in CLAUDE.md, so
65
+ // an install without it ships a tool that is half wired up.
66
+ //
67
+ // Scope is global (~/.claude/CLAUDE.md): a global install is not tied to
68
+ // any one project, and the harness principles are project-independent.
69
+ // Only ever ADDS โ€” harnessInit appends its own marked block, backs up the
70
+ // previous file, and leaves surrounding content untouched. Skipped when a
71
+ // block is already there (nothing to do) and when CTS_NO_HARNESS=1 is set,
72
+ // for anyone who wants the statusline without the CLAUDE.md rules.
73
+ try {
74
+ const { harnessInit, harnessStatus } = await import('../harness.js');
75
+ const before = harnessStatus(undefined, { scope: 'global' });
76
+ if (process.env.CTS_NO_HARNESS === '1') {
77
+ console.log('');
78
+ console.log(lang === 'ko'
79
+ ? ' harness: CTS_NO_HARNESS=1 ์ด๋ฏ€๋กœ ๊ฑด๋„ˆ๋œ๋‹ˆ๋‹ค (๋‚˜์ค‘์— `harness init --global`).'
80
+ : ' harness: skipped (CTS_NO_HARNESS=1) โ€” run `harness init --global` later.');
81
+ } else if (before.hasBlock) {
82
+ console.log('');
83
+ console.log(lang === 'ko'
84
+ ? ` harness: ์ด๋ฏธ ์„ค์ •๋จ โ€” ๐Ÿ…ท ${before.configured}/${before.total} (${before.file})`
85
+ : ` harness: already set up โ€” ๐Ÿ…ท ${before.configured}/${before.total} (${before.file})`);
86
+ } else {
87
+ const h = harnessInit({ scope: 'global' });
88
+ console.log('');
89
+ for (const p of h.backedUp) {
90
+ console.log(lang === 'ko' ? ` harness: ๋ฐฑ์—… ${p}` : ` harness: backed up ${p}`);
91
+ }
92
+ for (const p of h.wrote) {
93
+ console.log(lang === 'ko' ? ` harness: ์ž‘์„ฑ ${p}` : ` harness: wrote ${p}`);
94
+ }
95
+ console.log(lang === 'ko'
96
+ ? ' harness: 5์›์น™์„ ~/.claude/CLAUDE.md ์— ์„ค์ •ํ–ˆ์Šต๋‹ˆ๋‹ค โ€” statusline์— ๐Ÿ…ท 5/5 ๊ฐ€ ํ‘œ์‹œ๋ฉ๋‹ˆ๋‹ค.'
97
+ : ' harness: 5 principles installed in ~/.claude/CLAUDE.md โ€” the statusline now shows ๐Ÿ…ท 5/5.');
98
+ console.log(lang === 'ko'
99
+ ? ' ๋˜๋Œ๋ฆฌ๋ ค๋ฉด: claude-token-saver harness uninit --global'
100
+ : ' to undo: claude-token-saver harness uninit --global');
101
+ }
102
+ } catch (e) {
103
+ // Never fail an install over this โ€” the statusline and Skill are already
104
+ // in place, and `harness init` remains available as a manual step.
105
+ debug('install:harness-init', e);
106
+ console.log(lang === 'ko'
107
+ ? ' harness: ์ž๋™ ์„ค์ •์„ ๊ฑด๋„ˆ๋›ฐ์—ˆ์Šต๋‹ˆ๋‹ค โ€” `claude-token-saver harness init --global` ๋กœ ์ง์ ‘ ์„ค์ •ํ•˜์„ธ์š”.'
108
+ : ' harness: auto-setup skipped โ€” run `claude-token-saver harness init --global` yourself.');
109
+ }
110
+
62
111
  console.log('');
63
112
  console.log('Open Claude Code in any directory and just mention:');
64
113
  console.log(' "cache hit rate" / "1M context" / "5H cap" โ€” the skill auto-activates.');