claude-token-saver 2.0.0 → 2.0.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.
Files changed (2) hide show
  1. package/README.md +23 -3
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -9,13 +9,15 @@
9
9
 
10
10
  **Save tokens on Claude Code.** Catch the session that suddenly burned 10× your usual input, figure out *why*, and get a one-line remediation you can paste.
11
11
 
12
- v1.5 adds three things on top of the original cache monitor:
12
+ v1.5 adds three things on top of the original `claude-cache-monitor`:
13
13
  - **Spike diagnosis** — detect recent sessions whose input tokens exploded vs. your own baseline, and name the cause (1M context, 5m TTL churn, cache rebuild, chatty output).
14
14
  - **1M-context detection** — Opus 4.7+ auto-enables 1M context on Max plans, silently. This tool surfaces it on the statusline as `Ctx 1M` (red) vs. `Ctx 200k` (green), with the OS-specific command to turn it off.
15
15
  - **Actionable advice** — OS-aware remediation (`~/.zshrc` vs. `setx`) and the warning for the known `/model` toggle bug ([anthropics/claude-code#31640](https://github.com/anthropics/claude-code/issues/31640)).
16
16
 
17
17
  The original functionality still works: cache hit rate, TTL breakdown, cost impact vs. no-cache, TTL countdown timer, and Claude Code statusline integration.
18
18
 
19
+ **Runs standalone or as a plugin under another statusline.** Use `npx claude-token-saver` as a one-shot report, wire it into Claude Code's native statusline as the sole segment, or drop it in as an appended segment under a richer statusline like [rz1989s/claude-code-statusline](https://github.com/rz1989s/claude-code-statusline). See [Three Ways to Use It](#three-ways-to-use-it).
20
+
19
21
  ---
20
22
 
21
23
  **Claude Code 토큰 아껴쓰기 도구.** 평소보다 10배 토큰을 태운 세션을 찾고, *왜 튀었는지* 진단하고, 붙여넣을 수 있는 한 줄 해결책까지 내줍니다.
@@ -27,6 +29,8 @@ v1.5 신규:
27
29
 
28
30
  기존 기능(캐시 히트율·TTL 분포·비용 절감·TTL 카운트다운·statusline)은 그대로 유지됩니다.
29
31
 
32
+ **단독 도구로도, 다른 statusline의 플러그인으로도 동작합니다.** `npx claude-token-saver` 한 줄로 진단 리포트만 보는 것도 가능하고, Claude Code 내장 statusline에 직접 연결해 상시 표시할 수도 있고, [rz1989s/claude-code-statusline](https://github.com/rz1989s/claude-code-statusline) 같은 기존 statusline 아래에 세그먼트로 덧붙일 수도 있습니다. 자세한 용법은 [Three Ways to Use It](#three-ways-to-use-it) 참고.
33
+
30
34
  ## Quick Start
31
35
 
32
36
  ```bash
@@ -82,6 +86,18 @@ Issue codes detected:
82
86
 
83
87
  Remediation commands are chosen from `process.platform` — macOS/Linux/WSL get `~/.zshrc` snippets, Windows gets `setx` and the PowerShell equivalent.
84
88
 
89
+ ## Three Ways to Use It
90
+
91
+ `claude-token-saver` is primarily a **standalone tool**; the plugin mode is just a convenience for users who already run another statusline.
92
+
93
+ | Mode | What you run | When to pick this |
94
+ |---|---|---|
95
+ | **1. Standalone CLI report** | `npx claude-token-saver` | One-off diagnosis. Prints the full report (spikes + cache + cost + trend). Zero setup. |
96
+ | **2. Standalone Claude Code statusline** | `claude-token-saver --statusline` wired via `~/.claude/settings.json` | You want the chip (hit rate · TTL countdown · Ctx 200k/1M · spike) visible all the time. The default story. |
97
+ | **3. Plugin under another statusline** | `examples/statusline-with-rz1989s.sh` appends our segment to rz1989s or any wrapper script | You already have a rich statusline (repo info, cost, MCP, prayer times, themes) and want to bolt the token-saver segment on the end. |
98
+
99
+ Detail for each mode below.
100
+
85
101
  ## Statusline Mode (new in v1.2.0)
86
102
 
87
103
  Always-on one-line display in Claude Code's native statusline — no need to run commands manually.
@@ -142,7 +158,7 @@ The Claude Code statusline is event-driven — it only re-renders on assistant m
142
158
  }
143
159
  ```
144
160
 
145
- Or combine with an existing statusline script — see [`examples/statusline-command.sh`](examples/statusline-command.sh) for a drop-in that prints `user@host:cwd | <cache monitor>`.
161
+ Or combine with an existing statusline script — see [`examples/statusline-command.sh`](examples/statusline-command.sh) for a drop-in that prints `user@host:cwd | <token-saver segment>`.
146
162
 
147
163
  #### Windows (native PowerShell, not WSL)
148
164
 
@@ -214,9 +230,13 @@ When the hook is installed:
214
230
  ## Output Example
215
231
 
216
232
  ```
217
- Claude Cache Monitor — Last 30 days
233
+ Claude 토큰 아껴쓰기 — Last 30 days
234
+ (claude-token-saver v2.0.1)
218
235
  ══════════════════════════════════════════════════
219
236
 
237
+ Context window: 200k ✓ 200k 컨텍스트 (표준)
238
+ (최근 단일 요청 최대 83k 토큰)
239
+
220
240
  Summary
221
241
  Sessions: 380 | API calls: 10,813 | Model: claude-opus-new
222
242
  Cache hit rate: 98.2% | Total input: 1957.94M tokens
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-token-saver",
3
- "version": "2.0.0",
3
+ "version": "2.0.2",
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": {