claude-self-reflect 9.2.0 → 9.3.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/README.md CHANGED
@@ -12,10 +12,11 @@ Single 44MB binary. No databases. No containers. No API keys required.
12
12
 
13
13
  [Install](#install) | [How It Works](#how-it-works) | [MCP Tools](#mcp-tools) | [FAQ](https://ramakay.github.io/claude-self-reflect/#/docs/troubleshooting)
14
14
 
15
- > **v8.0Complete Rust Rewrite**
16
- > The entire Python/Docker/Qdrant stack has been replaced with a single Rust binary.
17
- > Sub-millisecond search, 93ms startup, 273 tests, zero external dependencies.
18
- > [Release notes](https://github.com/ramakay/claude-self-reflect/releases/tag/v8.0.5) | [Announcement](https://github.com/ramakay/claude-self-reflect/discussions/175)
15
+ > **v9.2Episode Intelligence**
16
+ > Sessions end as structured episodes; new sessions open with a CONTINUUM of where you left off.
17
+ > Provenance re-ranking, semantic intent routing, code graph, full-transcript recall, telemetry dashboard.
18
+ > Sub-millisecond search, ~150ms cached startup, 570+ tests, zero external dependencies.
19
+ > [Release notes](https://github.com/ramakay/claude-self-reflect/releases/tag/v9.2.0) | [Announcement](https://github.com/ramakay/claude-self-reflect/discussions/175)
19
20
 
20
21
  <img src="docs-site/public/images/csr-demo.gif" alt="CSR Demo — Setup, Search, and Hooks" width="800" />
21
22
 
@@ -26,7 +27,7 @@ Single 44MB binary. No databases. No containers. No API keys required.
26
27
  - [The Problem](#the-forgetting-problem) — Why Claude needs memory
27
28
  - [The Architecture](#one-binary-44mb) — How CSR solves it
28
29
  - [The Pipeline](#the-pipeline) — Progressive enrichment (9.3x improvement)
29
- - [Install](#install) — One command setup
30
+ - [Install](#install) — One-command install, consent-first activation
30
31
  - [What You'll Ask](#what-youll-ask) — Natural language, no syntax
31
32
  - [Performance](#performance) | [MCP Tools](#mcp-tools) | [Hooks](#hooks) | [CLI](#cli-reference)
32
33
  - [AI Narratives](#ai-narratives-optional) | [Upgrading](#upgrading-from-v7x) | [Troubleshooting](#troubleshooting)
@@ -103,7 +104,9 @@ Higher quality context. Better decisions. Fewer tokens.
103
104
  curl -fsSL https://raw.githubusercontent.com/ramakay/claude-self-reflect/main/scripts/install.sh | sh
104
105
  ```
105
106
 
106
- One command. Downloads the binary, runs setup, registers MCP server, installs 6 hooks. Restart Claude Code.
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.
107
110
 
108
111
  | Platform | Support |
109
112
  |----------|---------|
@@ -117,8 +120,11 @@ One command. Downloads the binary, runs setup, registers MCP server, installs 6
117
120
 
118
121
  ```bash
119
122
  npm install -g claude-self-reflect
123
+ csr-engine setup # activation is a separate, explicit step
120
124
  ```
121
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
+
122
128
  </details>
123
129
 
124
130
  <details>
@@ -147,11 +153,11 @@ No special syntax. No commands. CSR finds relevant past context and injects it a
147
153
  </details>
148
154
 
149
155
  <details>
150
- <summary><strong>Performance</strong> — sub-millisecond search, 93ms startup</summary>
156
+ <summary><strong>Performance</strong> — sub-millisecond search, ~150ms cached startup</summary>
151
157
 
152
158
  | Metric | Value |
153
159
  |--------|-------|
154
- | **Cached startup** | 93ms |
160
+ | **Cached startup** | ~150ms (p50, 54K-chunk index) |
155
161
  | **Search latency (p95)** | <1ms |
156
162
  | **Binary size** | 44MB |
157
163
  | **Import speed** | ~20 conversations/sec |
@@ -212,6 +218,14 @@ csr-engine daemon
212
218
  | Token compression | 100% | 18% (82% reduction) |
213
219
  | Cost per conversation | - | ~$0.012 (Batch API) |
214
220
 
221
+ > **Token transparency:** Optional AI narratives (session briefings + story extraction) run
222
+ > `claude -p` against your existing Claude subscription — smallest available model, capped
223
+ > prompts, debounced, and skipped entirely when nothing changed. Every call — including failures and timeouts — is counted:
224
+ > `csr-engine status` shows calls and tokens spent today; cache read/creation tokens (often
225
+ > the majority of real usage) are tracked separately in the status JSON (`cache_tokens_today` /
226
+ > `cache_tokens_total`). Disable anytime with
227
+ > `CSR_NO_AI_NARRATIVES=1`; pin a model with `CSR_NARRATIVE_MODEL=<model>`.
228
+
215
229
  </details>
216
230
 
217
231
  <details>
@@ -253,7 +267,7 @@ Your conversation data (`~/.claude/projects/`) is untouched. The new engine re-i
253
267
  | No search results | Run `csr-engine setup` |
254
268
  | MCP tools not available | Run `csr-engine setup`, restart Claude Code |
255
269
  | "spawn ENOENT" in MCP | Ensure `csr-engine` is in PATH |
256
- | Slow first startup | Normal (~14s for index rebuild, subsequent: ~93ms) |
270
+ | Slow first startup | Normal (~14s for index rebuild, subsequent: ~150ms) |
257
271
 
258
272
  Full guide: [Documentation](https://ramakay.github.io/claude-self-reflect/#/docs/troubleshooting)
259
273
 
@@ -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\n`);
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
- // Auto-run setup
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:');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-self-reflect",
3
- "version": "9.2.0",
3
+ "version": "9.3.1",
4
4
  "description": "Give Claude perfect memory of all your conversations. Single binary, zero dependencies.",
5
5
  "keywords": [
6
6
  "claude",