claude-token-saver 2.9.2 → 2.9.4

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
@@ -12,6 +12,24 @@ A CLI to **diagnose and save tokens on Claude Code**. Cache hit rate, TTL countd
12
12
 
13
13
  ## Install
14
14
 
15
+ ### Prerequisite — Node.js (≥ 18)
16
+
17
+ `npm` ships with Node.js. Check whether it's installed:
18
+
19
+ ```bash
20
+ node -v # v18.0.0 or later is fine
21
+ ```
22
+
23
+ If not, install it:
24
+
25
+ - **macOS** — `brew install node` (Homebrew) or the installer at [nodejs.org](https://nodejs.org/)
26
+ - **Windows** — [nodejs.org](https://nodejs.org/) LTS installer, or `winget install OpenJS.NodeJS.LTS`
27
+ - **Linux / WSL** — your distro's package manager (`apt install nodejs npm`, etc.) or — recommended — [nvm](https://github.com/nvm-sh/nvm) for a user-scoped install (no sudo)
28
+
29
+ > Avoid installing globally with `sudo`. The postinstall hook writes the Skill into root's `~/.claude` instead of yours, and auto-registration silently misses. Use nvm/fnm/Volta, or set `npm config set prefix ~/.npm-global` first.
30
+
31
+ ### Install claude-token-saver
32
+
15
33
  ```bash
16
34
  # (existing users) remove the old package
17
35
  npm uninstall -g claude-cache-monitor
@@ -191,6 +209,13 @@ Node.js ≥ 18 · macOS / Windows / Linux / WSL · zero dependencies.
191
209
 
192
210
  ## Release notes
193
211
 
212
+ ### v2.9.4 (2026-04-27)
213
+ - README now opens with a Node.js prerequisite block (macOS / Windows / Linux). First-time visitors arriving from GitHub no longer hit `npm: command not found` with no guidance. Also flags the `sudo` global-install trap where postinstall writes the Skill under root's home instead of the user's.
214
+
215
+ ### v2.9.3 (2026-04-27)
216
+ - Skill body (`SKILL.md`) now instructs Claude to respond in the user's configured output language. Previously even when the CLI was on `mode ko`, Claude itself still narrated the answer in English ("All clear — no warnings…"), so the language toggle felt half-applied.
217
+ - `installSkill` now auto-updates the on-disk `SKILL.md` whenever the bundled body differs, so upgrades pick up new instructions without `--force`.
218
+
194
219
  ### v2.9.2 (2026-04-27)
195
220
  - `last` / `history` empty-state messages now respect the language setting too. Previously they were hard-coded English, so users on `mode ko` still saw English when there were no warnings to report.
196
221
 
package/README.md CHANGED
@@ -12,6 +12,24 @@ Claude Code의 **토큰 사용량을 진단·절약**하는 CLI. 캐시 히트
12
12
 
13
13
  ## 설치
14
14
 
15
+ ### 사전 준비 — Node.js (≥ 18) 필요
16
+
17
+ `npm`은 Node.js에 포함되어 있습니다. 설치돼 있는지 확인:
18
+
19
+ ```bash
20
+ node -v # v18.0.0 이상이면 OK
21
+ ```
22
+
23
+ 설치되어 있지 않다면:
24
+
25
+ - **macOS** — `brew install node` (Homebrew) 또는 [nodejs.org](https://nodejs.org/) 설치 프로그램
26
+ - **Windows** — [nodejs.org](https://nodejs.org/) LTS 설치 프로그램, 또는 `winget install OpenJS.NodeJS.LTS`
27
+ - **Linux / WSL** — 배포판 패키지 매니저(`apt install nodejs npm` 등) 또는 [nvm](https://github.com/nvm-sh/nvm)으로 사용자 영역 설치 (sudo 없이 가능, 추천)
28
+
29
+ > sudo로 글로벌 설치하면 postinstall 훅이 root의 `~/.claude`에 SKILL을 만들어 자동 등록이 어긋납니다. 가능하면 nvm/fnm/Volta로 사용자 영역에 Node를 설치하거나 `npm config set prefix ~/.npm-global` 같은 prefix 변경 후 사용하세요.
30
+
31
+ ### claude-token-saver 설치
32
+
15
33
  ```bash
16
34
  # (기존 사용자) 구 패키지 제거
17
35
  npm uninstall -g claude-cache-monitor
@@ -151,6 +169,13 @@ Node.js ≥ 18 · macOS / Linux / Windows / WSL · 의존성 0.
151
169
 
152
170
  ## 릴리스 노트
153
171
 
172
+ ### v2.9.4 (2026-04-27)
173
+ - README에 Node.js 사전 설치 안내 추가 (macOS/Windows/Linux별). GitHub에서 처음 본 사용자가 npm 명령부터 막히는 일을 방지. sudo 글로벌 설치 시 postinstall이 root 홈에 SKILL을 만드는 함정도 함께 안내.
174
+
175
+ ### v2.9.3 (2026-04-27)
176
+ - Skill 본문(`SKILL.md`)에 "사용자 설정 언어로 응답" 지시 추가. 이전엔 Skill이 호출돼도 Claude가 영어로 요약을 생성하는 탓에 `mode ko` 상태에서도 영문 답이 나왔습니다 (`All clear - no warnings...` 같은 문구).
177
+ - `installSkill`이 번들된 SKILL.md와 디스크의 내용이 다르면 자동 갱신하도록 변경 (`--force` 없이도 업그레이드 시 새 지시가 적용됨).
178
+
154
179
  ### v2.9.2 (2026-04-27)
155
180
  - `last`/`history`가 경고 없을 때 출력하는 안내 문구도 언어 설정을 따르도록 수정 (이전엔 항상 영문 출력 → 한국어 모드인데도 영문이 보이는 버그).
156
181
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-token-saver",
3
- "version": "2.9.2",
3
+ "version": "2.9.4",
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": {
package/src/installer.js CHANGED
@@ -31,6 +31,18 @@ This skill helps users interpret and act on the \`claude-token-saver\` statuslin
31
31
  in Claude Code. The statusline updates every ~1s and shows cache health, TTL
32
32
  countdown, savings, and (when relevant) a leading warning chip.
33
33
 
34
+ ## Response language
35
+
36
+ Respond in the user's configured output language. Run
37
+ \`claude-token-saver mode\` once at the start of the session and read the
38
+ \`Output language\` field — if it shows \`language: ko\`, write **all of your
39
+ prose to the user in Korean** (summary, "All clear" status lines, headings,
40
+ recommendations). If it shows \`language: en\` (the default), write in
41
+ English. Tool output (the body of \`last\`/\`history\`/the table report) is
42
+ already localized by the CLI — do not retranslate it; just mirror your
43
+ own narration to match. If the user asks for a different language inline,
44
+ honor that for the rest of the turn without changing the saved setting.
45
+
34
46
  ## When this skill should activate
35
47
 
36
48
  - The user references any chip wording: \`🚨 5H NN%\`, \`🚨 7D NN%\`,
@@ -118,7 +130,14 @@ export function installSkill({ force = false } = {}) {
118
130
  const dir = join(claudeUserDir(), 'skills', 'claude-token-saver');
119
131
  const file = join(dir, 'SKILL.md');
120
132
  mkdirSync(dir, { recursive: true });
121
- return writeIfNeeded(file, SKILL_BODY, force);
133
+ // SKILL.md is fully package-controlled — overwrite whenever the bundled
134
+ // body differs from what's on disk so postinstall picks up new instructions
135
+ // (e.g. the response-language directive added in v2.9.3) without forcing
136
+ // users to re-run \`install --force\`.
137
+ if (existsSync(file) && readFileSync(file, 'utf8') === SKILL_BODY) {
138
+ return { path: file, action: 'exists' };
139
+ }
140
+ return writeIfNeeded(file, SKILL_BODY, true);
122
141
  }
123
142
 
124
143
  // Removes the legacy /token-monitor slash command from prior versions.