claude-token-saver 3.9.1 โ 3.9.2
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/LICENSE +21 -0
- package/README.en.md +23 -0
- package/README.md +22 -0
- package/package.json +14 -9
- package/src/commands/route-scan.js +3 -0
- package/src/first-run-note.js +63 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 rootstudioyaml
|
|
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.
|
package/README.en.md
CHANGED
|
@@ -17,6 +17,23 @@ npm i -g claude-token-saver # postinstall auto-registers the statusline + Skil
|
|
|
17
17
|
|
|
18
18
|

|
|
19
19
|
|
|
20
|
+
## ๐บ Came here from the video? โ 60 seconds
|
|
21
|
+
|
|
22
|
+
This is not a router. It never intercepts a request in realtime.
|
|
23
|
+
**After a session ends** it reads your local logs, finds the easy patterns your expensive model
|
|
24
|
+
kept handling, and promotes them into rules so a cheaper model takes them **from the next session
|
|
25
|
+
onward**. Rules are scoped global or per-project.
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
npm i -g claude-token-saver@latest
|
|
29
|
+
claude-token-saver route-scan # find delegation candidates in your own history (0 LLM calls)
|
|
30
|
+
claude-token-saver route-scan rules # list promoted rules ยท rm <N> to remove
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Thresholds come from **your own last-14-day distribution (p25/p75)**, not someone else's benchmark.
|
|
34
|
+
Measured rule-health โ whether a delegated run actually succeeded โ landed in [v3.9.0](#v390-2026-08-01).
|
|
35
|
+
|
|
36
|
+
|
|
20
37
|
## โก Why โ the 30-second pitch
|
|
21
38
|
|
|
22
39
|
| | |
|
|
@@ -265,6 +282,12 @@ Also update `statusLine.command` in `~/.claude/settings.json` to `claude-token-s
|
|
|
265
282
|
|
|
266
283
|
## Release notes
|
|
267
284
|
|
|
285
|
+
### v3.9.2 (2026-08-01)
|
|
286
|
+
- **Added a LICENSE file (MIT)** โ the field existed in `package.json` but the file did not, which blocked license review for company adoption. It ships in the npm tarball now via `files`.
|
|
287
|
+
- **Package description and keywords rewritten for what this actually does** โ leftover cache-monitoring copy meant it never surfaced for `model-routing` / `delegation` / `subagent`.
|
|
288
|
+
- **A 60-second on-ramp at the top of the README** โ that this is post-hoc analysis rather than a router, plus the three commands from install to seeing your own numbers.
|
|
289
|
+
- **One-time note in `route-scan`** โ prints the explainer link exactly once. Disable with `CTS_NO_NOTE=1`.
|
|
290
|
+
|
|
268
291
|
### v3.9.1 (2026-08-01)
|
|
269
292
|
- **compact-window now recommends a 400kโ700k band instead of a single 400k** โ 400k proved too tight in practice and compacted too often. The advice is a range now, and **a window inside it (or below it) is never warned about**; only an unset value or one above 700k raises `๐
ทโ compact-window?` and the briefing. `set` defaults to 500k (mid-band); pick your own with `--value 600k`.
|
|
270
293
|
|
package/README.md
CHANGED
|
@@ -17,6 +17,22 @@ npm i -g claude-token-saver # postinstall์ด statusline + Skill ์๋ ๋ฑ๋ก
|
|
|
17
17
|
|
|
18
18
|

|
|
19
19
|
|
|
20
|
+
## ๐บ ์์ ๋ณด๊ณ ์ค์
จ๋ค๋ฉด โ 60์ด
|
|
21
|
+
|
|
22
|
+
๋ผ์ฐํฐ๊ฐ ์๋๋๋ค. ์์ฒญ์ ์ค์๊ฐ์ผ๋ก ๊ฐ๋ก์ฑ์ง ์์ต๋๋ค.
|
|
23
|
+
**์ธ์
์ด ๋๋ ๋ค** ๋ก์ปฌ ๊ธฐ๋ก์ ์ฝ์ด์, ๋น์ผ ๋ชจ๋ธ์ด ๋ฐ๋ณตํด์ ์ฒ๋ฆฌํด ์จ ์ฌ์ด ์ ํ์ ๋ฝ๊ณ ,
|
|
24
|
+
๊ทธ ์ ํ์ **๋ค์ ์ธ์
๋ถํฐ** ์ผ ๋ชจ๋ธ์ด ๋งก๋๋ก ๋ฃฐ๋ก ๊ฒ๋๋ค. ๋ฃฐ์ ๊ธ๋ก๋ฒยทํ๋ก์ ํธ๋ก ๋ฒ์๊ฐ ๋๋ฉ๋๋ค.
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
npm i -g claude-token-saver@latest
|
|
28
|
+
claude-token-saver route-scan # ๋ด ์ง๋ ์ธ์
์์ ์์ ํ๋ณด ๋ฝ๊ธฐ (LLM ํธ์ถ 0)
|
|
29
|
+
claude-token-saver route-scan rules # ์น๊ฒฉ๋ ๋ฃฐ ํ์ธ ยท rm <N> ์ผ๋ก ์ญ์
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
๊ธฐ์ค์ ์ ๋จ์ ๋ฒค์น๋งํฌ๊ฐ ์๋๋ผ **๋ด ์ต๊ทผ 14์ผ ๋ถํฌ(p25/p75)** ๋ก ์ก์ต๋๋ค.
|
|
33
|
+
๋๊ธด ๋ค ์ค์ ๋ก ์ ๋๋์ง๊น์ง ์ฌ๋ ์ค์ธก rule-health๋ [v3.9.0](#v390-2026-08-01)์ ๋ค์ด๊ฐ์ต๋๋ค.
|
|
34
|
+
|
|
35
|
+
|
|
20
36
|
## โก ์ ์ฐ๋ โ 30์ด ์์ฝ
|
|
21
37
|
|
|
22
38
|
| | |
|
|
@@ -222,6 +238,12 @@ npm uninstall -g claude-cache-monitor && npm i -g claude-token-saver
|
|
|
222
238
|
|
|
223
239
|
## ๋ฆด๋ฆฌ์ค ๋
ธํธ
|
|
224
240
|
|
|
241
|
+
### v3.9.2 (2026-08-01)
|
|
242
|
+
- **LICENSE ํ์ผ ์ถ๊ฐ (MIT)** โ `package.json`์๋ง ์๊ณ ํ์ผ์ด ์์ด์, ์ฌ๋ด ๋์
๊ฒํ ์ ๋ผ์ด์ ์ค ํ์ธ์ด ๋งํ๋ ๋ฌธ์ . npm ํจํค์ง์๋ ํฌํจ๋๋๋ก `files`์ ๋ฃ์์ต๋๋ค.
|
|
243
|
+
- **ํจํค์ง ์ค๋ช
ยทํค์๋๋ฅผ ํ์ฌ ๊ธฐ๋ฅ์ ๋ง๊ฒ ๊ต์ฒด** โ ์บ์ ๋ชจ๋ํฐ๋ง ์์ ๋ฌธ๊ตฌ๊ฐ ๋จ์ ์์ด ๋ชจ๋ธ ์์(`model-routing`ยท`delegation`ยท`subagent`)์ผ๋ก ๊ฒ์๋์ง ์์์ต๋๋ค.
|
|
244
|
+
- **README ์๋จ์ 60์ด ์ง์
๋ก** โ ๋ผ์ฐํฐ๊ฐ ์๋๋ผ ์ฌํ ๋ถ์์ด๋ผ๋ ์ ๊ณผ, ์ค์น๋ถํฐ ๋ด ์ซ์ ํ์ธ๊น์ง์ ๋ช
๋ น 3์ค.
|
|
245
|
+
- **`route-scan` ์ต์ด 1ํ ์๋ด** โ ๊ธฐ๋ฅ ์ค๋ช
์์ ๋งํฌ๋ฅผ ๋ฑ ํ ๋ฒ๋ง ์ถ๋ ฅํฉ๋๋ค. `CTS_NO_NOTE=1`๋ก ๋๋๋ค.
|
|
246
|
+
|
|
225
247
|
### v3.9.1 (2026-08-01)
|
|
226
248
|
- **compact-window ๊ถ์ฅ๊ฐ์ด ๋จ์ผ 40๋ง์์ 40๋ง~70๋ง ๋ฒ์๋ก** โ 40๋ง์ ์ค์ฌ์ฉ์์ ๋๋ฌด ๋นก๋นกํด ์์ถ์ด ์ฆ์์ต๋๋ค. ์ด์ ๋ฒ์๋ฅผ ์ ์ํ๊ณ , **๊ทธ ์(๋๋ ๊ทธ๋ณด๋ค ๋ฎ๊ฒ) ์ก์๋ ์ธ์
์ ๊ฒฝ๊ณ ํ์ง ์์ต๋๋ค.** ๋ฏธ์ค์ ์ด๊ฑฐ๋ 70๋ง ์ด๊ณผ์ผ ๋๋ง `๐
ทโ compact-window?`์ ๋ธ๋ฆฌํ์ด ๋น๋๋ค. `set`์ ๊ธฐ๋ณธ๊ฐ๋ ๋ฒ์ ์ค๊ฐ์ธ 50๋ง์ผ๋ก ์ฌ๋ ธ๊ณ , ์ํ๋ ๊ฐ์ `--value 600k`๋ก ์ง์ ํฉ๋๋ค.
|
|
227
249
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "claude-token-saver",
|
|
3
|
-
"version": "3.9.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "3.9.2",
|
|
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": {
|
|
7
7
|
"claude-token-saver": "bin/cli.js"
|
|
@@ -16,22 +16,27 @@
|
|
|
16
16
|
"presets/",
|
|
17
17
|
"examples/",
|
|
18
18
|
"README.md",
|
|
19
|
-
"README.en.md"
|
|
19
|
+
"README.en.md",
|
|
20
|
+
"LICENSE"
|
|
20
21
|
],
|
|
21
22
|
"engines": {
|
|
22
23
|
"node": ">=18"
|
|
23
24
|
},
|
|
24
25
|
"keywords": [
|
|
25
26
|
"claude",
|
|
27
|
+
"claude-code",
|
|
26
28
|
"anthropic",
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
+
"model-routing",
|
|
30
|
+
"llm-router",
|
|
31
|
+
"delegation",
|
|
32
|
+
"subagent",
|
|
33
|
+
"haiku",
|
|
34
|
+
"cost-savings",
|
|
35
|
+
"token-usage",
|
|
29
36
|
"prompt-caching",
|
|
30
|
-
"
|
|
37
|
+
"cache",
|
|
31
38
|
"statusline",
|
|
32
|
-
"
|
|
33
|
-
"token-usage",
|
|
34
|
-
"cost-savings",
|
|
39
|
+
"cli",
|
|
35
40
|
"1m-context"
|
|
36
41
|
],
|
|
37
42
|
"license": "MIT",
|
|
@@ -202,6 +202,7 @@ export async function run({ args, hasFlag, numArg }) {
|
|
|
202
202
|
console.log(lang === 'ko'
|
|
203
203
|
? '์์ ํ๋ณด ์์ (๋ฐ๋ณต 3ํ ๋ฏธ๋ง์ด๊ฑฐ๋ ์ด๋ฏธ ์ฒ๋ฆฌ๋จ).'
|
|
204
204
|
: 'No delegation candidates (below recurrence threshold or already resolved).');
|
|
205
|
+
(await import('../first-run-note.js')).printOnce('route-scan', lang);
|
|
205
206
|
return;
|
|
206
207
|
}
|
|
207
208
|
console.log(lang === 'ko' ? '\n์์ ํ๋ณด (R<N>=ํ๋ณด ๋ฒํธ, T2/T1=๋์ด๋ ๋ฑ๊ธ):' : '\nDelegation candidates (R<N> = candidate id, T2/T1 = difficulty tier):');
|
|
@@ -223,5 +224,7 @@ export async function run({ args, hasFlag, numArg }) {
|
|
|
223
224
|
console.log(lang === 'ko' ? '๋ฑ๋ก / ๋ฌด์:' : 'Promote / dismiss:');
|
|
224
225
|
console.log(' claude-token-saver harness promote R<N> --project|--global');
|
|
225
226
|
console.log(' claude-token-saver route-scan dismiss <N>');
|
|
227
|
+
// ์ต์ด 1ํ๋ง โ ๋งค๋ฒ ์ฐ์ผ๋ฉด ๋๊ตฌ๊ฐ ๊ด๊ณ ํ์ด ๋๋ค (CTS_NO_NOTE=1 ๋ก ๋)
|
|
228
|
+
(await import('../first-run-note.js')).printOnce('route-scan', lang);
|
|
226
229
|
return;
|
|
227
230
|
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* first-run-note โ a one-time pointer to where a feature is explained.
|
|
3
|
+
*
|
|
4
|
+
* A CLI that advertises on every invocation stops being a tool, so this fires
|
|
5
|
+
* ONCE per note key and then never again: the shown-at timestamp is persisted
|
|
6
|
+
* next to the other state files and checked before anything is printed.
|
|
7
|
+
*
|
|
8
|
+
* Opt out entirely with CTS_NO_NOTE=1 (also honoured by anything that pipes
|
|
9
|
+
* our output somewhere it does not belong).
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import { readFileSync, writeFileSync, existsSync, mkdirSync } from 'node:fs';
|
|
13
|
+
import { join } from 'node:path';
|
|
14
|
+
import { userDataDir } from './paths.js';
|
|
15
|
+
|
|
16
|
+
export function firstRunStatePath() {
|
|
17
|
+
return join(userDataDir(), 'first-run.json');
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function load() {
|
|
21
|
+
try {
|
|
22
|
+
const s = JSON.parse(readFileSync(firstRunStatePath(), 'utf8'));
|
|
23
|
+
return s && typeof s === 'object' ? s : {};
|
|
24
|
+
} catch {
|
|
25
|
+
return {};
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function markShown(key, now) {
|
|
30
|
+
const state = load();
|
|
31
|
+
state[key] = now;
|
|
32
|
+
const dir = userDataDir();
|
|
33
|
+
if (!existsSync(dir)) mkdirSync(dir, { recursive: true });
|
|
34
|
+
writeFileSync(firstRunStatePath(), JSON.stringify(state) + '\n');
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/** True only the first time this key is asked about. Best-effort โ a
|
|
38
|
+
* read-only state dir just means the note repeats, never that we crash. */
|
|
39
|
+
export function shouldShowOnce(key, { now = Date.now() } = {}) {
|
|
40
|
+
if (process.env.CTS_NO_NOTE === '1') return false;
|
|
41
|
+
if (load()[key]) return false;
|
|
42
|
+
try {
|
|
43
|
+
markShown(key, now);
|
|
44
|
+
} catch {
|
|
45
|
+
/* state dir unwritable โ show it, do not fail the command */
|
|
46
|
+
}
|
|
47
|
+
return true;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const NOTES = {
|
|
51
|
+
'route-scan': {
|
|
52
|
+
ko: '๐บ ์ด ๊ธฐ๋ฅ์ ์ค๋ช
ํ ์์: https://www.youtube.com/@DeepPulseKR (์ด ์๋ด๋ ํ ๋ฒ๋ง ํ์๋ฉ๋๋ค)',
|
|
53
|
+
en: '๐บ How this works, in 3 minutes: https://www.youtube.com/@DeepPulseEN (shown once)',
|
|
54
|
+
},
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
/** Print the one-time note for `key`, or nothing. */
|
|
58
|
+
export function printOnce(key, lang = 'en') {
|
|
59
|
+
const note = NOTES[key];
|
|
60
|
+
if (!note || !shouldShowOnce(key)) return;
|
|
61
|
+
console.log('');
|
|
62
|
+
console.log(lang === 'ko' ? note.ko : note.en);
|
|
63
|
+
}
|