claude-token-saver 2.11.0 → 2.13.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 +3 -0
- package/README.md +3 -0
- package/package.json +7 -2
- package/src/formatters/statusline.js +2 -0
- package/src/harness.js +12 -0
package/README.en.md
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
[한국어](./README.md) · **English**
|
|
2
2
|
|
|
3
|
+
[](https://www.youtube.com/@deeppulse)
|
|
4
|
+
[](https://www.npmjs.com/package/claude-token-saver)
|
|
5
|
+
|
|
3
6
|
# claude-token-saver
|
|
4
7
|
|
|
5
8
|
> Renamed from `claude-cache-monitor` in v2.0. Existing users — see [Migration](#migration-from-claude-cache-monitor).
|
package/README.md
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
**한국어** · [English](./README.en.md)
|
|
2
2
|
|
|
3
|
+
[](https://www.youtube.com/@deeppulse)
|
|
4
|
+
[](https://www.npmjs.com/package/claude-token-saver)
|
|
5
|
+
|
|
3
6
|
# claude-token-saver
|
|
4
7
|
|
|
5
8
|
> v2.0에서 `claude-cache-monitor` → `claude-token-saver`로 이름이 바뀌었습니다. 기존 사용자는 아래 [마이그레이션](#마이그레이션-claude-cache-monitor에서) 항목을 참고하세요.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "claude-token-saver",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.13.0",
|
|
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": {
|
|
@@ -36,5 +36,10 @@
|
|
|
36
36
|
"repository": {
|
|
37
37
|
"type": "git",
|
|
38
38
|
"url": "git+https://github.com/rootstudioyaml/claude-token-saver.git"
|
|
39
|
-
}
|
|
39
|
+
},
|
|
40
|
+
"homepage": "https://www.youtube.com/@deeppulse",
|
|
41
|
+
"bugs": {
|
|
42
|
+
"url": "https://github.com/rootstudioyaml/claude-token-saver/issues"
|
|
43
|
+
},
|
|
44
|
+
"author": "DeepPulse (https://www.youtube.com/@deeppulse)"
|
|
40
45
|
}
|
|
@@ -284,6 +284,8 @@ export function formatReport(data, { color = true, verbose = false, timer = true
|
|
|
284
284
|
// error / no-evidence / racing edits) is more actionable than a
|
|
285
285
|
// missing ratchet section. Always red so it stands out.
|
|
286
286
|
harnessSeg = `${c(RED)}${icon}⚠ ${harnessInfo.warning}${c(RESET)}`;
|
|
287
|
+
} else if (harnessInfo.custom) {
|
|
288
|
+
harnessSeg = `${c(CYAN)}${icon} custom${c(RESET)}`;
|
|
287
289
|
} else {
|
|
288
290
|
const tone = harnessInfo.configured >= harnessInfo.total ? GREEN : YELLOW;
|
|
289
291
|
harnessSeg = `${c(tone)}${icon} ${harnessInfo.configured}/${harnessInfo.total}${c(RESET)}`;
|
package/src/harness.js
CHANGED
|
@@ -82,18 +82,29 @@ export function harnessStatus(root = findProjectRoot()) {
|
|
|
82
82
|
return { configured: 0, total: HARNESS_SECTIONS.length, missing: [], hasBlock: false, hasFile: true, root };
|
|
83
83
|
}
|
|
84
84
|
const hasBlock = content.includes(HARNESS_BLOCK_BEGIN);
|
|
85
|
+
// Opt-out marker — when the user intentionally customizes the harness block
|
|
86
|
+
// and doesn't want the statusline to nag, they can drop this comment
|
|
87
|
+
// anywhere in CLAUDE.md to silence the 🅷 indicator entirely.
|
|
88
|
+
const optOut = /<!--\s*harness-check:\s*off\s*-->/i.test(content);
|
|
85
89
|
const present = [];
|
|
86
90
|
const missing = [];
|
|
87
91
|
for (const s of HARNESS_SECTIONS) {
|
|
88
92
|
if (content.includes(s.heading)) present.push(s.id);
|
|
89
93
|
else missing.push(s.id);
|
|
90
94
|
}
|
|
95
|
+
// Custom state — user has the harness block but at least one header was
|
|
96
|
+
// hand-edited away from the canonical text. Treat as intentional divergence
|
|
97
|
+
// (don't show N/5 nag) but still surface a neutral 🅷 custom marker so they
|
|
98
|
+
// know the auto-check no longer applies.
|
|
99
|
+
const custom = hasBlock && present.length < HARNESS_SECTIONS.length;
|
|
91
100
|
return {
|
|
92
101
|
configured: present.length,
|
|
93
102
|
total: HARNESS_SECTIONS.length,
|
|
94
103
|
missing,
|
|
95
104
|
hasBlock,
|
|
96
105
|
hasFile: true,
|
|
106
|
+
optOut,
|
|
107
|
+
custom,
|
|
97
108
|
root,
|
|
98
109
|
};
|
|
99
110
|
}
|
|
@@ -278,6 +289,7 @@ export function harnessStatusForStatusline(cfg, { root } = {}) {
|
|
|
278
289
|
// Silent when the project has neither CLAUDE.md nor a .claude/ dir — the
|
|
279
290
|
// user hasn't opted in, no point nagging.
|
|
280
291
|
if (!status.hasFile && !existsSync(join(projectRoot, '.claude'))) return null;
|
|
292
|
+
if (status.optOut) return null;
|
|
281
293
|
// Attach a warning derived from the analyzer state file (if any). Precedence:
|
|
282
294
|
// ratchet? > no-evidence > PEV-skip. Only surfaces when the state's
|
|
283
295
|
// sessionId or cwd matches this project, so unrelated sessions don't leak.
|