claude-token-saver 2.10.0 → 2.10.1
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/package.json +1 -1
- package/src/harness.js +7 -5
package/package.json
CHANGED
package/src/harness.js
CHANGED
|
@@ -125,15 +125,17 @@ export function harnessInit({ root = findProjectRoot(), force = false } = {}) {
|
|
|
125
125
|
writeFileSync(cmPath, next);
|
|
126
126
|
result.wrote.push(cmPath + ' (block updated in place)');
|
|
127
127
|
} else {
|
|
128
|
-
// Backup, then
|
|
129
|
-
//
|
|
130
|
-
// is
|
|
128
|
+
// Backup as safety net, then APPEND the harness block to existing
|
|
129
|
+
// content (do not clobber). Users keep all their prior CLAUDE.md content;
|
|
130
|
+
// the harness block is added at the end and managed in-place on re-runs
|
|
131
|
+
// via the BEGIN/END markers.
|
|
131
132
|
const stamp = new Date().toISOString().replace(/[:.]/g, '').slice(0, 15); // YYYYMMDDTHHMMSS
|
|
132
133
|
const bak = `${cmPath}.bak-${stamp}`;
|
|
133
134
|
writeFileSync(bak, existing);
|
|
134
|
-
|
|
135
|
+
const sep = existing.endsWith('\n') ? '\n' : '\n\n';
|
|
136
|
+
writeFileSync(cmPath, existing + sep + block);
|
|
135
137
|
result.backedUp.push(bak);
|
|
136
|
-
result.wrote.push(cmPath);
|
|
138
|
+
result.wrote.push(cmPath + ' (harness block appended)');
|
|
137
139
|
}
|
|
138
140
|
} else {
|
|
139
141
|
writeFileSync(cmPath, block);
|