claude-recall 0.23.0 → 0.23.2

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.
@@ -131,10 +131,15 @@ def main():
131
131
  last_search = state.get('lastSearchAt')
132
132
 
133
133
  # FIRST TOOL CALL GATE: If rules have never been loaded this session,
134
- # block on codebase-interacting tools (Read/Glob/Grep/Write/Edit/Bash/Task).
135
- # This ensures Claude loads rules before forming opinions from exploration.
134
+ # only block mutation tools. Read-only exploration (Read/Glob/Grep) passes
135
+ # freely reading a file can't bypass preferences or corrections, and
136
+ # gating it added 1–3 blocked calls of friction per session with no safety
137
+ # benefit. The guarantee that matters (load_rules before mutations) is
138
+ # preserved by the ENFORCE_TOOLS check below.
136
139
  if not last_search:
137
- pass # Fall through to blocking logic below
140
+ if tool_name not in ENFORCE_TOOLS:
141
+ sys.exit(0)
142
+ # Mutation tool on first call — fall through to blocking logic below.
138
143
  else:
139
144
  # Rules loaded at least once — only enforce on mutation tools
140
145
  if tool_name not in ENFORCE_TOOLS:
@@ -41,6 +41,11 @@
41
41
  "type": "command",
42
42
  "command": "node /home/ebiarao/.nvm/versions/node/v20.19.3/lib/node_modules/claude-recall/dist/cli/claude-recall-cli.js hook run tool-outcome-watcher",
43
43
  "timeout": 3
44
+ },
45
+ {
46
+ "type": "command",
47
+ "command": "node /home/ebiarao/.nvm/versions/node/v20.19.3/lib/node_modules/claude-recall/dist/cli/claude-recall-cli.js hook run rule-injection-resolver",
48
+ "timeout": 3
44
49
  }
45
50
  ]
46
51
  }
@@ -52,6 +57,11 @@
52
57
  "type": "command",
53
58
  "command": "node /home/ebiarao/.nvm/versions/node/v20.19.3/lib/node_modules/claude-recall/dist/cli/claude-recall-cli.js hook run tool-failure",
54
59
  "timeout": 3
60
+ },
61
+ {
62
+ "type": "command",
63
+ "command": "node /home/ebiarao/.nvm/versions/node/v20.19.3/lib/node_modules/claude-recall/dist/cli/claude-recall-cli.js hook run rule-injection-resolver",
64
+ "timeout": 3
55
65
  }
56
66
  ]
57
67
  }
@@ -63,6 +73,11 @@
63
73
  {
64
74
  "type": "command",
65
75
  "command": "python3 /home/ebiarao/repos-wsl/personal-projects/claude-recall/.claude/hooks/search_enforcer.py"
76
+ },
77
+ {
78
+ "type": "command",
79
+ "command": "node /home/ebiarao/.nvm/versions/node/v20.19.3/lib/node_modules/claude-recall/dist/cli/claude-recall-cli.js hook run rule-injector",
80
+ "timeout": 5
66
81
  }
67
82
  ]
68
83
  }
@@ -121,5 +136,5 @@
121
136
  }
122
137
  ]
123
138
  },
124
- "hooksVersion": "13.0.0"
139
+ "hooksVersion": "14.0.0"
125
140
  }
@@ -8,15 +8,15 @@ source: claude-recall
8
8
 
9
9
  # Preferences
10
10
 
11
- Auto-generated from 5 memories. Last updated: 2026-04-22.
11
+ Auto-generated from 5 memories. Last updated: 2026-04-23.
12
12
 
13
13
  ## Rules
14
14
 
15
- - integration-fixture session 1776885821647
16
- - integration-fixture preference 1776885821594-2
17
- - integration-fixture preference 1776885821594-1
18
- - integration-fixture preference 1776885821594-0
19
- - integration-fixture memory 1776885821539
15
+ - integration-fixture session 1776936462139
16
+ - integration-fixture preference 1776936462057-2
17
+ - integration-fixture preference 1776936462057-1
18
+ - integration-fixture preference 1776936462057-0
19
+ - integration-fixture memory 1776936461992
20
20
 
21
21
  ---
22
22
  *Auto-generated by Claude Recall. Regenerate: `npx claude-recall skills generate`*
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "topicId": "preferences",
3
- "sourceHash": "886f098b1a582616f10443d10ec5877b85152231a370636321f2f3f8dc37b2dc",
3
+ "sourceHash": "8f6c2515c073f67ccf01ad1386f3694b666e3f56bb1ccdeeb6aae55dfc04a477",
4
4
  "memoryCount": 5,
5
- "generatedAt": "2026-04-22T19:23:41.665Z",
5
+ "generatedAt": "2026-04-23T09:27:42.176Z",
6
6
  "memoryKeys": [
7
- "memory_1776885821648_8b5enno4p",
8
- "memory_1776885821623_73b897xzl",
9
- "memory_1776885821611_admiwaa2s",
10
- "memory_1776885821596_ii942py46",
11
- "memory_1776885821543_yk1wyjqkz"
7
+ "memory_1776936462141_jljtaadmy",
8
+ "memory_1776936462104_21zrli1a5",
9
+ "memory_1776936462081_4cngzrj7y",
10
+ "memory_1776936462058_u48oswvqh",
11
+ "memory_1776936461995_g769cz2vk"
12
12
  ]
13
13
  }
package/README.md CHANGED
@@ -34,33 +34,22 @@ Your preferences, project structure, workflows, corrections, and coding style ar
34
34
 
35
35
  ### Install for Claude Code
36
36
 
37
- #### First-time install
38
-
39
- Run this **once** on your machine:
37
+ Install the global binary once per machine:
40
38
 
41
39
  ```bash
42
40
  npm install -g claude-recall
43
41
  ```
44
42
 
45
- Then run these **in the project directory** where you want claude-recall active:
43
+ Then, in each project directory where you want claude-recall active:
46
44
 
47
45
  ```bash
48
46
  claude-recall setup --install
49
47
  claude mcp add claude-recall -- claude-recall mcp start
50
48
  ```
51
49
 
52
- Restart Claude Code. **Verify**: ask *"Load my rules"* — Claude should call `mcp__claude-recall__load_rules`.
53
-
54
- #### Adding to another project
50
+ Restart Claude Code. Ask *"Load my rules"* to verify — Claude should call `load_rules`.
55
51
 
56
- The global binary is already installed. Just `cd` into the new project and run the per-project commands:
57
-
58
- ```bash
59
- claude-recall setup --install
60
- claude mcp add claude-recall -- claude-recall mcp start
61
- ```
62
-
63
- Restart Claude Code in that project.
52
+ > **Hit `EACCES: permission denied`?** Your global npm is owned by root. Either `sudo npm install -g claude-recall` once, or do the permanent fix described in [Upgrading](#upgrading) below.
64
53
 
65
54
  ### Install for Pi
66
55
 
@@ -68,49 +57,44 @@ Restart Claude Code in that project.
68
57
  pi install npm:claude-recall
69
58
  ```
70
59
 
71
- That's it. The extension registers tools and loads a skill automatically. No further configuration needed.
72
-
73
- **Verify:** Start Pi and ask *"Load my rules"* — Pi should call `recall_load_rules`.
60
+ That's it. Ask Pi to *"Load my rules"* to verify.
74
61
 
75
62
  ### Shared Database
76
63
 
77
- Both agents use the same database (`~/.claude-recall/claude-recall.db`). Memories are scoped per project by working directory. A correction learned in Claude Code is available in Pi and vice versa.
64
+ Both agents use the same database at `~/.claude-recall/claude-recall.db`, scoped per project by working directory. A correction learned in one agent is available in the other.
78
65
 
79
66
  ### Upgrading
80
67
 
81
- #### If you use Claude Code
82
-
83
- Run this **once** to update the global binary:
84
-
85
68
  ```bash
86
- npm install -g claude-recall
87
- ```
88
-
89
- Then run this **in each project directory** where you use claude-recall (the binary upgrade alone isn't enough — new releases sometimes add hook events that need to be registered in each project's `.claude/settings.json`):
90
-
91
- ```bash
92
- claude-recall setup --install
69
+ claude-recall upgrade
93
70
  ```
94
71
 
95
- Restart Claude Code so the new MCP server starts (or run `claude-recall mcp restart` from the project directory to keep the current session running).
72
+ One command. Checks the registry, refreshes the global binary, clears any running MCP servers (Claude Code respawns them on the next tool call, automatically picking up the new version). **No `claude mcp add` re-run needed** existing registrations point at the `claude-recall` command, not a pinned path.
96
73
 
97
- **Verify**: `claude-recall --version` shows the new version, and asking *"Load my rules"* in Claude Code triggers `mcp__claude-recall__load_rules`.
74
+ For Pi, run `pi update npm:claude-recall` and restart Pi.
98
75
 
99
- #### If you use Pi
76
+ <details>
77
+ <summary><b>If <code>claude-recall upgrade</code> reports <code>EACCES: permission denied</code></b></summary>
100
78
 
101
- Run this **once** — the `npm:` prefix is required (it matches the original install command):
79
+ Your global npm prefix is root-owned (common with `apt install nodejs`). Pick one:
102
80
 
81
+ **Quick** — one-time sudo:
103
82
  ```bash
104
- pi update npm:claude-recall
83
+ sudo npm install -g claude-recall
105
84
  ```
106
85
 
107
- Restart Pi to load the updated extension.
108
-
109
- **Verify**: `pi list` shows the new `claude-recall` version, and asking *"Load my rules"* in Pi triggers `recall_load_rules`.
86
+ **Permanent** move the prefix to a user-owned directory, then no global install ever needs sudo again:
87
+ ```bash
88
+ mkdir -p ~/.npm-global
89
+ npm config set prefix ~/.npm-global
90
+ echo 'export PATH=~/.npm-global/bin:$PATH' >> ~/.bashrc
91
+ source ~/.bashrc
110
92
 
111
- #### If you use both
93
+ # now re-run
94
+ claude-recall upgrade
95
+ ```
112
96
 
113
- Both upgrades are independent — run the Claude Code section AND the Pi section. Both agents share the same `~/.claude-recall/claude-recall.db`, so memories captured in either are visible to the other.
97
+ </details>
114
98
 
115
99
  ---
116
100
 
@@ -312,6 +296,7 @@ claude-recall mcp cleanup --all # Stop all stale MCP servers
312
296
  # ── Setup & Diagnostics ─────────────────────────────────────────────
313
297
  claude-recall setup # Show activation instructions
314
298
  claude-recall setup --install # Install skills + hooks
299
+ claude-recall upgrade # One-shot upgrade: global binary + clear stale MCP servers
315
300
  claude-recall status # Installation and system status
316
301
  claude-recall repair # Clean up old hooks, install skills
317
302
  claude-recall hooks check # Verify hook files exist and are valid
@@ -261,6 +261,77 @@ class ClaudeRecallCLI {
261
261
  });
262
262
  this.logger.info('CLI', 'Failures displayed', { count: displayFailures.length });
263
263
  }
264
+ /**
265
+ * One-shot upgrade: check registry, install latest globally, clean up any
266
+ * running MCP servers (so fresh 0.x spawns on next Claude Code tool call).
267
+ *
268
+ * Handles the common failure modes inline so users don't have to figure them out:
269
+ * - EACCES on `/usr/lib/node_modules` → print sudo + permanent-prefix fix
270
+ * - No npm in PATH → actionable error
271
+ * - Registry unreachable → clear error, don't leave install half-done
272
+ */
273
+ async upgrade() {
274
+ const { execSync, spawnSync } = require('child_process');
275
+ // Current version from package.json shipped with the installed binary
276
+ let current;
277
+ try {
278
+ const pkg = JSON.parse(fs.readFileSync(path.join(__dirname, '..', '..', 'package.json'), 'utf-8'));
279
+ current = pkg.version;
280
+ }
281
+ catch {
282
+ current = 'unknown';
283
+ }
284
+ // Latest version from registry
285
+ let latest;
286
+ try {
287
+ latest = execSync('npm view claude-recall version', {
288
+ encoding: 'utf-8',
289
+ stdio: ['pipe', 'pipe', 'pipe'],
290
+ }).trim();
291
+ }
292
+ catch (err) {
293
+ console.error('❌ Could not reach the npm registry.');
294
+ console.error(` ${err?.stderr?.toString().trim() || err?.message || 'unknown error'}`);
295
+ console.error('\nCheck your connection, then run `claude-recall upgrade` again.');
296
+ process.exit(1);
297
+ }
298
+ console.log(`Installed: ${current}`);
299
+ console.log(`Latest: ${latest}`);
300
+ if (current === latest) {
301
+ console.log('\n✓ Already up to date.');
302
+ return;
303
+ }
304
+ console.log(`\n📦 Upgrading ${current} → ${latest}...\n`);
305
+ // Run npm install -g, streaming output so the user sees progress / errors live
306
+ const install = spawnSync('npm', ['install', '-g', 'claude-recall@latest'], {
307
+ stdio: 'inherit',
308
+ });
309
+ if (install.status !== 0) {
310
+ // npm prints its own error — add the practical remediation on top
311
+ console.error('\n❌ Install failed.');
312
+ console.error('\nMost common cause: your global npm prefix is owned by root (EACCES).');
313
+ console.error('\nQuick fix:');
314
+ console.error(' sudo npm install -g claude-recall');
315
+ console.error('\nPermanent fix (no more sudo for any global install on this machine):');
316
+ console.error(' mkdir -p ~/.npm-global');
317
+ console.error(" npm config set prefix ~/.npm-global");
318
+ console.error(" echo 'export PATH=~/.npm-global/bin:$PATH' >> ~/.bashrc");
319
+ console.error(' source ~/.bashrc');
320
+ console.error('\nThen re-run: claude-recall upgrade');
321
+ process.exit(install.status ?? 1);
322
+ }
323
+ // Kill any running MCP servers so Claude Code respawns them with the new binary
324
+ console.log('\n🧹 Cleaning up running MCP servers (Claude Code respawns them on next tool call)...');
325
+ try {
326
+ spawnSync('claude-recall', ['mcp', 'cleanup', '--all'], { stdio: 'inherit' });
327
+ }
328
+ catch {
329
+ // Non-fatal — the user can restart Claude Code manually if this fails
330
+ }
331
+ console.log(`\n✓ Upgraded to ${latest}. No need to re-run \`claude mcp add\` — existing`);
332
+ console.log(' registrations point at the `claude-recall` command and pick up the new');
333
+ console.log(' binary automatically. Just run any tool in Claude Code.');
334
+ }
264
335
  /**
265
336
  * Demote rules loaded often but never cited — excludes them from future load_rules payloads.
266
337
  * Rules remain searchable via search_memory and can be restored with `rules promote <id>`.
@@ -1613,6 +1684,15 @@ async function main() {
1613
1684
  cli.cleanupTestPollution({ dryRun: options.dryRun });
1614
1685
  process.exit(0);
1615
1686
  });
1687
+ // Upgrade command: one-shot upgrade, handles EACCES inline
1688
+ program
1689
+ .command('upgrade')
1690
+ .description('Upgrade claude-recall to the latest version and clear stale MCP servers')
1691
+ .action(async () => {
1692
+ const cli = new ClaudeRecallCLI(program.opts());
1693
+ await cli.upgrade();
1694
+ process.exit(0);
1695
+ });
1616
1696
  // Export command
1617
1697
  program
1618
1698
  .command('export <output>')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-recall",
3
- "version": "0.23.0",
3
+ "version": "0.23.2",
4
4
  "description": "Persistent memory for Claude Code and Pi with native Skills integration, automatic capture, failure learning, and project scoping",
5
5
  "main": "dist/index.js",
6
6
  "bin": {