claude-token-saver 2.0.2 → 2.0.3
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.md +44 -10
- package/package.json +2 -3
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# claude-token-saver
|
|
2
2
|
|
|
3
|
-
> **Renamed from `claude-cache-monitor` in v2.0.** The old
|
|
3
|
+
> **Renamed from `claude-cache-monitor` in v2.0.** The old npm package is deprecated and points here. The `claude-cache-monitor` binary is gone — use `claude-token-saver` instead. See [migration notes](#migration-from-claude-cache-monitor).
|
|
4
4
|
|
|
5
5
|
> 📺 **HNPulse Shorts** — 이 도구가 만들어진 배경 (캐시 TTL 1h→5m 변경 이슈):
|
|
6
6
|
> **[▶ Watch the Short](https://www.youtube.com/shorts/oSx2sg935nI)** · [All HNPulse Shorts](https://www.youtube.com/@HNPulseKR/shorts)
|
|
@@ -47,6 +47,12 @@ npx claude-token-saver --format json
|
|
|
47
47
|
npx claude-token-saver --format csv
|
|
48
48
|
```
|
|
49
49
|
|
|
50
|
+
> **Upgrading from `claude-cache-monitor`?** Uninstall the old package first, then install the new one and update your settings command name:
|
|
51
|
+
> ```bash
|
|
52
|
+
> npm uninstall -g claude-cache-monitor && npm i -g claude-token-saver
|
|
53
|
+
> ```
|
|
54
|
+
> After upgrading, change any `claude-cache-monitor …` invocations (including `statusLine.command` in `~/.claude/settings.json`) to `claude-token-saver …`. See [Migration](#migration-from-claude-cache-monitor).
|
|
55
|
+
|
|
50
56
|
## Spike Diagnosis (new in v1.5.0)
|
|
51
57
|
|
|
52
58
|
When you run `npx claude-token-saver`, sessions from the last 24 hours whose total input tokens are **≥ 3× your p95 baseline** (or whose single-request context exceeds 250k, indicating 1M context) appear at the top of the report with root causes and remediation commands. Example output:
|
|
@@ -342,24 +348,52 @@ Zero dependencies.
|
|
|
342
348
|
|
|
343
349
|
## Migration from claude-cache-monitor
|
|
344
350
|
|
|
345
|
-
v2.0 renamed the package to reflect the expanded scope (spike diagnosis + 1M-context detection + remediation, not just cache monitoring).
|
|
351
|
+
v2.0 renamed the package to reflect the expanded scope (spike diagnosis + 1M-context detection + remediation, not just cache monitoring).
|
|
352
|
+
|
|
353
|
+
### New users
|
|
354
|
+
|
|
355
|
+
```bash
|
|
356
|
+
npm i -g claude-token-saver
|
|
357
|
+
# or, no install:
|
|
358
|
+
npx claude-token-saver
|
|
359
|
+
```
|
|
360
|
+
|
|
361
|
+
Skip the rest of this section.
|
|
346
362
|
|
|
347
|
-
|
|
348
|
-
- The binary `claude-cache-monitor` still works alongside the new `claude-token-saver` (both map to the same entry point).
|
|
349
|
-
- Your existing `statusLine.command` setting in `~/.claude/settings.json` keeps working.
|
|
363
|
+
### Upgrading from `claude-cache-monitor` v1.x
|
|
350
364
|
|
|
351
|
-
|
|
365
|
+
Two steps:
|
|
352
366
|
|
|
353
367
|
```bash
|
|
368
|
+
# 1. Remove the old package (its claude-cache-monitor bin is now obsolete).
|
|
354
369
|
npm uninstall -g claude-cache-monitor
|
|
370
|
+
|
|
371
|
+
# 2. Install the new one.
|
|
355
372
|
npm i -g claude-token-saver
|
|
373
|
+
```
|
|
356
374
|
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
375
|
+
Then update any `claude-cache-monitor …` references. The main one is `statusLine.command` in `~/.claude/settings.json`:
|
|
376
|
+
|
|
377
|
+
```jsonc
|
|
378
|
+
// before
|
|
379
|
+
"command": "claude-cache-monitor --statusline --icon"
|
|
380
|
+
|
|
381
|
+
// after
|
|
382
|
+
"command": "claude-token-saver --statusline --icon"
|
|
361
383
|
```
|
|
362
384
|
|
|
385
|
+
### Why we dropped the `claude-cache-monitor` bin alias
|
|
386
|
+
|
|
387
|
+
Earlier v2.0 releases shipped a `claude-cache-monitor` bin alongside `claude-token-saver` so existing settings would keep working without edits. In practice this caused an `EEXIST: file already exists` error on `npm i -g claude-token-saver` when v1.x was still installed — and that collision forced the uninstall step anyway. Dropping the alias makes the upgrade path a clean two-liner and lets `npm i -g claude-token-saver` succeed directly if you've never installed the old one.
|
|
388
|
+
|
|
389
|
+
### Zero-install (npx)
|
|
390
|
+
|
|
391
|
+
```bash
|
|
392
|
+
npx claude-token-saver@latest --statusline --icon
|
|
393
|
+
```
|
|
394
|
+
|
|
395
|
+
No uninstall needed; npm just fetches the new name.
|
|
396
|
+
|
|
363
397
|
## License
|
|
364
398
|
|
|
365
399
|
MIT
|
package/package.json
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "claude-token-saver",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.3",
|
|
4
4
|
"description": "Save tokens on Claude Code — spike diagnosis, 1M-context detection, TTL countdown, statusline. (formerly claude-cache-monitor)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
|
-
"claude-token-saver": "./bin/cli.js"
|
|
8
|
-
"claude-cache-monitor": "./bin/cli.js"
|
|
7
|
+
"claude-token-saver": "./bin/cli.js"
|
|
9
8
|
},
|
|
10
9
|
"files": [
|
|
11
10
|
"bin/",
|