claude-token-saver 3.6.3 โ 3.6.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 +3 -0
- package/README.md +3 -0
- package/package.json +1 -1
- package/src/harness.js +27 -5
package/README.en.md
CHANGED
|
@@ -243,6 +243,9 @@ Also update `statusLine.command` in `~/.claude/settings.json` to `claude-token-s
|
|
|
243
243
|
|
|
244
244
|
## Release notes
|
|
245
245
|
|
|
246
|
+
### v3.6.4 (2026-07-29)
|
|
247
|
+
- **Fixed: false `๐
ทโ ratchet-unloaded`** โ the import check looked at a single CLAUDE.md. When the project file carried the harness block, only that file was inspected, so the common layout of block-in-project + `@` imports-in-global raised the warning even though the rules loaded fine. Claude Code loads both files, so the flags are now the union of the two, and `importSource` (`project`/`global`/`both`) says which file carries them. The warning fires only when neither file imports.
|
|
248
|
+
|
|
246
249
|
### v3.6.3 (2026-07-27)
|
|
247
250
|
- **Fixed: approved ratchet rules never reached the session** โ `harness promote` appended rules to `ratchet.md`, but nothing ever read that file. Claude Code loads `CLAUDE.md` (plus whatever it imports) and the harness block carried no import line, so "approved rules apply automatically from the next session" was unimplemented. The block now imports `@.claude/ratchet.md` (project) / `@~/.claude/ratchet.md` (global). Re-running `harness init` upgrades an existing block in place.
|
|
248
251
|
- **`ratchet-model.md` is imported explicitly too** โ delegation rules now travel the same declared path instead of relying on a host that happens to pick the file up. To keep the import from dangling, `harness init` seeds an empty file and `syncAllFiles` empties rather than deletes a target that loses its last rule.
|
package/README.md
CHANGED
|
@@ -200,6 +200,9 @@ npm uninstall -g claude-cache-monitor && npm i -g claude-token-saver
|
|
|
200
200
|
|
|
201
201
|
## ๋ฆด๋ฆฌ์ค ๋
ธํธ
|
|
202
202
|
|
|
203
|
+
### v3.6.4 (2026-07-29)
|
|
204
|
+
- **`๐
ทโ ratchet-unloaded`๊ฐ ์๋ชป ๋จ๋ ๋ฒ๊ทธ ์์ ** โ import ์ฌ๋ถ๋ฅผ CLAUDE.md ํ ํ์ผ์์๋ง ํ์ธํ์ต๋๋ค. ํ๋ก์ ํธ `CLAUDE.md`์ harness ๋ธ๋ก์ด ์์ผ๋ฉด ๊ทธ ํ์ผ๋ง ๋ณด๊ณ ํ์ ํ๊ธฐ ๋๋ฌธ์, `@` import๊ฐ ๊ธ๋ก๋ฒ `~/.claude/CLAUDE.md`์ ์๋ ํํ ์กฐํฉ์์๋ ๋ฃฐ์ด ์ ์ ๋ก๋๋๋๋ฐ๋ ๊ฒฝ๊ณ ๊ฐ ๋ด์ต๋๋ค. Claude Code๋ ๋ ํ์ผ์ ๋ชจ๋ ๋ก๋ํ๋ฏ๋ก ์ด์ ์์ชฝ์ import๋ฅผ ํฉ์ณ์ ํ์ ํ๊ณ , ์ด๋ ์ชฝ์ด ๋ค๊ณ ์๋์ง๋ `importSource`(`project`/`global`/`both`)๋ก ์๋ ค์ค๋๋ค. ๋ ํ์ผ ๋ค import๊ฐ ์์ ๋๋ง ๊ฒฝ๊ณ ํฉ๋๋ค.
|
|
205
|
+
|
|
203
206
|
### v3.6.3 (2026-07-27)
|
|
204
207
|
- **์น์ธํ ratchet ๋ฃฐ์ด ์ธ์
์ ์ ๋ฌ๋์ง ์๋ ๋ฒ๊ทธ ์์ ** โ `harness promote`๋ ๋ฃฐ์ `ratchet.md`์ appendํ์ง๋ง, ๊ทธ ํ์ผ์ ์ฝ๋ ์๋น์๊ฐ ์ด๋์๋ ์์์ต๋๋ค. Claude Code๋ `CLAUDE.md`(์ ๊ทธ๊ฒ์ด importํ๋ ํ์ผ)๋ง ๋ก๋ํ๋๋ฐ harness ๋ธ๋ก์ import ๋ผ์ธ์ด ์์๊ธฐ ๋๋ฌธ์, "์น์ธ๋ ๋ฃฐ์ ๋ค์ ์ธ์
๋ถํฐ ์๋ ์ ์ฉ"์ ์ฌ์ค์ ๋ฏธ๊ตฌํ ์ํ์์ต๋๋ค. ์ด์ harness ๋ธ๋ก์ด `@.claude/ratchet.md`(project) / `@~/.claude/ratchet.md`(global)๋ฅผ importํฉ๋๋ค. `harness init`์ ๋ค์ ๋๋ฆฌ๋ฉด ๊ธฐ์กด ๋ธ๋ก๋ ์ ์๋ฆฌ์์ ๊ฐฑ์ ๋ฉ๋๋ค.
|
|
205
208
|
- **`ratchet-model.md`๋ ๋ช
์์ ์ผ๋ก import** โ ๋ชจ๋ธ ํผํ
๋ฃฐ๋ ํธ์คํธ๊ฐ ์์์ ์ฝ์ด์ฃผ๊ธธ ๊ธฐ๋ํ์ง ์๊ณ ๊ฐ์ ๊ฒฝ๋ก๋ก ์ ๋ฌํฉ๋๋ค. import๊ฐ ๋๊ธฐ์ง ์๋๋ก `harness init`์ด ๋น ํ์ผ์ ๋ฏธ๋ฆฌ ๋ง๋ค๊ณ , ๋ง์ง๋ง ๋ฃฐ์ด ์ฌ๋ผ์ ธ๋ `syncAllFiles`๊ฐ ํ์ผ์ ์ง์ฐ๋ ๋์ ๋น์๋๋ค.
|
package/package.json
CHANGED
package/src/harness.js
CHANGED
|
@@ -153,15 +153,37 @@ function statusForFile(filePath) {
|
|
|
153
153
|
* relies on a globally-installed harness report ๐
ท 5/5 (covered by global),
|
|
154
154
|
* matching reality: Claude Code loads ~/.claude/CLAUDE.md for every project.
|
|
155
155
|
* The returned `source` ('project'|'global') tells callers which file was used.
|
|
156
|
+
*
|
|
157
|
+
* The `@` import flags are the union of both files, not just the source one:
|
|
158
|
+
* Claude Code loads ~/.claude/CLAUDE.md for every project *and* the project
|
|
159
|
+
* CLAUDE.md, so a project-scope block with the imports living in the global
|
|
160
|
+
* file still gets the ratchet rules. Checking only the source file made that
|
|
161
|
+
* layout report a false `ratchet-unloaded`. `importSource` says which file
|
|
162
|
+
* actually carries them ('project' | 'global' | 'both' | null).
|
|
156
163
|
*/
|
|
157
164
|
export function harnessStatus(root = findProjectRoot(), { scope = 'auto' } = {}) {
|
|
158
|
-
if (scope === 'project') return { ...statusForFile(claudeMdPath(root)), root, source: 'project' };
|
|
159
|
-
if (scope === 'global') return { ...statusForFile(globalClaudeMdPath()), root, source: 'global' };
|
|
160
165
|
const project = statusForFile(claudeMdPath(root));
|
|
161
|
-
if (project.hasBlock) return { ...project, root, source: 'project' };
|
|
162
166
|
const global = statusForFile(globalClaudeMdPath());
|
|
163
|
-
|
|
164
|
-
|
|
167
|
+
const pick = (s, source) => ({ ...s, ...unionImports(project, global), root, source });
|
|
168
|
+
if (scope === 'project') return pick(project, 'project');
|
|
169
|
+
if (scope === 'global') return pick(global, 'global');
|
|
170
|
+
if (project.hasBlock) return pick(project, 'project');
|
|
171
|
+
if (global.hasBlock) return pick(global, 'global');
|
|
172
|
+
return pick(project, 'project');
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
// Union the two files' import flags. Same file read twice (project root === ~)
|
|
176
|
+
// is harmless โ OR is idempotent.
|
|
177
|
+
function unionImports(project, global) {
|
|
178
|
+
const samePath = project.file === global.file;
|
|
179
|
+
const g = samePath ? { hasRatchetImport: false, hasModelRatchetImport: false } : global;
|
|
180
|
+
const inProject = project.hasRatchetImport || project.hasModelRatchetImport;
|
|
181
|
+
const inGlobal = g.hasRatchetImport || g.hasModelRatchetImport;
|
|
182
|
+
return {
|
|
183
|
+
hasRatchetImport: project.hasRatchetImport || g.hasRatchetImport,
|
|
184
|
+
hasModelRatchetImport: project.hasModelRatchetImport || g.hasModelRatchetImport,
|
|
185
|
+
importSource: inProject && inGlobal ? 'both' : inProject ? 'project' : inGlobal ? 'global' : null,
|
|
186
|
+
};
|
|
165
187
|
}
|
|
166
188
|
|
|
167
189
|
/**
|