claude-self-reflect 9.3.0 → 9.4.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.md +8 -3
- package/installer/postinstall.js +33 -10
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -27,7 +27,7 @@ Single 44MB binary. No databases. No containers. No API keys required.
|
|
|
27
27
|
- [The Problem](#the-forgetting-problem) — Why Claude needs memory
|
|
28
28
|
- [The Architecture](#one-binary-44mb) — How CSR solves it
|
|
29
29
|
- [The Pipeline](#the-pipeline) — Progressive enrichment (9.3x improvement)
|
|
30
|
-
- [Install](#install) — One
|
|
30
|
+
- [Install](#install) — One-command install, consent-first activation
|
|
31
31
|
- [What You'll Ask](#what-youll-ask) — Natural language, no syntax
|
|
32
32
|
- [Performance](#performance) | [MCP Tools](#mcp-tools) | [Hooks](#hooks) | [CLI](#cli-reference)
|
|
33
33
|
- [AI Narratives](#ai-narratives-optional) | [Upgrading](#upgrading-from-v7x) | [Troubleshooting](#troubleshooting)
|
|
@@ -71,7 +71,7 @@ Everything runs locally in a single process. No Docker, no database server, no A
|
|
|
71
71
|
- **FastEmbed** — 384-dim local embeddings
|
|
72
72
|
- **AST** — code-aware search across 6 languages
|
|
73
73
|
|
|
74
|
-
**6 hooks** fire across the session lifecycle. **
|
|
74
|
+
**6 hooks** fire across the session lifecycle. **15 MCP tools** for explicit search — including `csr_code_graph`, linking code symbols to the conversations that shaped them.
|
|
75
75
|
|
|
76
76
|
<br clear="both" />
|
|
77
77
|
|
|
@@ -104,7 +104,9 @@ Higher quality context. Better decisions. Fewer tokens.
|
|
|
104
104
|
curl -fsSL https://raw.githubusercontent.com/ramakay/claude-self-reflect/main/scripts/install.sh | sh
|
|
105
105
|
```
|
|
106
106
|
|
|
107
|
-
|
|
107
|
+
Downloads the binary (SHA256-verified), then asks before activating. Setup — which registers the MCP server, installs 6 hooks, and imports your conversations — only runs with your consent. Restart Claude Code after.
|
|
108
|
+
|
|
109
|
+
Non-interactive installs never activate on their own: set `CSR_AUTO_SETUP=1` to opt in, or run `csr-engine setup` yourself.
|
|
108
110
|
|
|
109
111
|
| Platform | Support |
|
|
110
112
|
|----------|---------|
|
|
@@ -118,8 +120,11 @@ One command. Downloads the binary, runs setup, registers MCP server, installs 6
|
|
|
118
120
|
|
|
119
121
|
```bash
|
|
120
122
|
npm install -g claude-self-reflect
|
|
123
|
+
csr-engine setup # activation is a separate, explicit step
|
|
121
124
|
```
|
|
122
125
|
|
|
126
|
+
By default `npm install` only downloads the checksummed binary — it does not touch `~/.claude` or index conversations. Activation happens when you run `csr-engine setup`, or set `CSR_AUTO_SETUP=1` during install to opt in.
|
|
127
|
+
|
|
123
128
|
</details>
|
|
124
129
|
|
|
125
130
|
<details>
|
package/installer/postinstall.js
CHANGED
|
@@ -2,11 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Post-install hook for npm.
|
|
5
|
-
* Downloads the csr-engine binary from GitHub Releases
|
|
5
|
+
* Downloads the csr-engine binary from GitHub Releases and verifies its
|
|
6
|
+
* checksum. By default nothing else: activation (hook registration, MCP
|
|
7
|
+
* registration, conversation import) happens when the user explicitly runs
|
|
8
|
+
* `csr-engine setup` — postinstall does not touch ~/.claude or index data
|
|
9
|
+
* unless the user opts in with CSR_AUTO_SETUP=1.
|
|
6
10
|
* Detects existing Python CSR installations and guides upgrade.
|
|
7
11
|
*
|
|
8
12
|
* Environment variables:
|
|
9
13
|
* CSR_SKIP_BINARY_DOWNLOAD=1 — Skip binary download (CI, offline, custom builds)
|
|
14
|
+
* CSR_AUTO_SETUP=1 — Opt in to running `csr-engine setup` after download
|
|
10
15
|
*/
|
|
11
16
|
|
|
12
17
|
import {
|
|
@@ -186,6 +191,30 @@ function findExpectedChecksum(checksumData, filename) {
|
|
|
186
191
|
throw new Error(`No checksum entry found for ${filename}`);
|
|
187
192
|
}
|
|
188
193
|
|
|
194
|
+
// --- Activation ---
|
|
195
|
+
|
|
196
|
+
// Activation is a separate consent event: setup writes hooks into
|
|
197
|
+
// ~/.claude/settings.json, registers the MCP server, and imports
|
|
198
|
+
// conversation transcripts. Never do that from a package manager
|
|
199
|
+
// lifecycle script unless the user explicitly opted in.
|
|
200
|
+
function runOrExplainActivation(binaryPath) {
|
|
201
|
+
if (process.env.CSR_AUTO_SETUP === '1') {
|
|
202
|
+
console.log(' CSR_AUTO_SETUP=1 — running setup...');
|
|
203
|
+
try {
|
|
204
|
+
execFileSync(binaryPath, ['setup'], { stdio: 'inherit', timeout: 60000 });
|
|
205
|
+
console.log('\n \x1b[32mDone. Restart Claude Code to activate.\x1b[0m\n');
|
|
206
|
+
} catch {
|
|
207
|
+
console.log('\n Setup failed. Run manually: csr-engine setup\n');
|
|
208
|
+
process.exitCode = 1;
|
|
209
|
+
}
|
|
210
|
+
} else {
|
|
211
|
+
console.log('\n \x1b[1mTo activate\x1b[0m (registers the MCP server, installs hooks,');
|
|
212
|
+
console.log(' and imports your conversations), run:');
|
|
213
|
+
console.log('\n \x1b[1;32mcsr-engine setup\x1b[0m\n');
|
|
214
|
+
console.log(' Then restart Claude Code.\n');
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
|
|
189
218
|
// --- Existing installation detection ---
|
|
190
219
|
|
|
191
220
|
function findExistingBinary() {
|
|
@@ -251,7 +280,8 @@ async function main() {
|
|
|
251
280
|
stdio: ['ignore', 'pipe', 'ignore'],
|
|
252
281
|
}).trim();
|
|
253
282
|
if (version === pkgVersion || version === tag || version.includes(` ${pkgVersion}`)) {
|
|
254
|
-
console.log(`\n \x1b[1;32mcsr-engine ${pkgVersion} already installed.\x1b[0m
|
|
283
|
+
console.log(`\n \x1b[1;32mcsr-engine ${pkgVersion} already installed.\x1b[0m`);
|
|
284
|
+
runOrExplainActivation(existingBinary);
|
|
255
285
|
return;
|
|
256
286
|
}
|
|
257
287
|
console.log(` Updating ${existingBinary} to ${tag}...`);
|
|
@@ -301,14 +331,7 @@ async function main() {
|
|
|
301
331
|
|
|
302
332
|
console.log(` \x1b[1;32mInstalled:\x1b[0m ${destPath}`);
|
|
303
333
|
|
|
304
|
-
|
|
305
|
-
console.log(' Running setup...');
|
|
306
|
-
try {
|
|
307
|
-
execFileSync(destPath, ['setup'], { stdio: 'inherit', timeout: 60000 });
|
|
308
|
-
console.log('\n \x1b[32mDone. Restart Claude Code to activate.\x1b[0m\n');
|
|
309
|
-
} catch {
|
|
310
|
-
console.log('\n Setup encountered errors. Run manually: csr-engine setup\n');
|
|
311
|
-
}
|
|
334
|
+
runOrExplainActivation(destPath);
|
|
312
335
|
|
|
313
336
|
if (pythonSignals.length > 0) {
|
|
314
337
|
console.log(' Old Python stack can be cleaned up:');
|