claude-recall 0.24.1 โ†’ 0.24.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.
@@ -391,43 +391,51 @@ class ClaudeRecallCLI {
391
391
  }
392
392
  console.log(`Installed: ${current}`);
393
393
  console.log(`Latest: ${latest}`);
394
- if (current === latest) {
395
- console.log('\nโœ“ Already up to date.');
396
- return;
394
+ const needsInstall = current !== latest;
395
+ if (needsInstall) {
396
+ console.log(`\n๐Ÿ“ฆ Upgrading ${current} โ†’ ${latest}...\n`);
397
+ // Run npm install -g, streaming output so the user sees progress / errors live
398
+ const install = spawnSync('npm', ['install', '-g', 'claude-recall@latest'], {
399
+ stdio: 'inherit',
400
+ });
401
+ if (install.status !== 0) {
402
+ // npm prints its own error โ€” add the practical remediation on top
403
+ console.error('\nโŒ Install failed.');
404
+ console.error('\nMost common cause: your global npm prefix is owned by root (EACCES).');
405
+ console.error('\nQuick fix:');
406
+ console.error(' sudo npm install -g claude-recall');
407
+ console.error('\nPermanent fix (no more sudo for any global install on this machine):');
408
+ console.error(' mkdir -p ~/.npm-global');
409
+ console.error(" npm config set prefix ~/.npm-global");
410
+ console.error(" echo 'export PATH=~/.npm-global/bin:$PATH' >> ~/.bashrc");
411
+ console.error(' source ~/.bashrc');
412
+ console.error('\nThen re-run: claude-recall upgrade');
413
+ process.exit(install.status ?? 1);
414
+ }
415
+ // Kill any running MCP servers so Claude Code respawns them with the new binary
416
+ console.log('\n๐Ÿงน Cleaning up running MCP servers (Claude Code respawns them on next tool call)...');
417
+ try {
418
+ spawnSync('claude-recall', ['mcp', 'cleanup', '--all'], { stdio: 'inherit' });
419
+ }
420
+ catch {
421
+ // Non-fatal โ€” the user can restart Claude Code manually if this fails
422
+ }
397
423
  }
398
- console.log(`\n๐Ÿ“ฆ Upgrading ${current} โ†’ ${latest}...\n`);
399
- // Run npm install -g, streaming output so the user sees progress / errors live
400
- const install = spawnSync('npm', ['install', '-g', 'claude-recall@latest'], {
401
- stdio: 'inherit',
402
- });
403
- if (install.status !== 0) {
404
- // npm prints its own error โ€” add the practical remediation on top
405
- console.error('\nโŒ Install failed.');
406
- console.error('\nMost common cause: your global npm prefix is owned by root (EACCES).');
407
- console.error('\nQuick fix:');
408
- console.error(' sudo npm install -g claude-recall');
409
- console.error('\nPermanent fix (no more sudo for any global install on this machine):');
410
- console.error(' mkdir -p ~/.npm-global');
411
- console.error(" npm config set prefix ~/.npm-global");
412
- console.error(" echo 'export PATH=~/.npm-global/bin:$PATH' >> ~/.bashrc");
413
- console.error(' source ~/.bashrc');
414
- console.error('\nThen re-run: claude-recall upgrade');
415
- process.exit(install.status ?? 1);
416
- }
417
- // Kill any running MCP servers so Claude Code respawns them with the new binary
418
- console.log('\n๐Ÿงน Cleaning up running MCP servers (Claude Code respawns them on next tool call)...');
419
- try {
420
- spawnSync('claude-recall', ['mcp', 'cleanup', '--all'], { stdio: 'inherit' });
424
+ // Detect stale project-local installs that would shadow the global binary
425
+ // when invoked via `npx claude-recall`. Runs on every upgrade invocation,
426
+ // including when already up-to-date โ€” so `claude-recall upgrade` doubles
427
+ // as a diagnostic for the npx-walks-up-and-finds-stale-local trap, and
428
+ // `claude-recall upgrade --clean-locals` works as a one-shot cleanup
429
+ // command even when no version change is pending.
430
+ this.warnOrCleanStaleLocals(latest, opts.cleanLocals === true);
431
+ if (needsInstall) {
432
+ console.log(`\nโœ“ Upgraded to ${latest}. No need to re-run \`claude mcp add\` โ€” existing`);
433
+ console.log(' registrations point at the `claude-recall` command and pick up the new');
434
+ console.log(' binary automatically. Just run any tool in Claude Code.');
421
435
  }
422
- catch {
423
- // Non-fatal โ€” the user can restart Claude Code manually if this fails
436
+ else {
437
+ console.log('\nโœ“ Already up to date.');
424
438
  }
425
- // Detect stale project-local installs that would shadow the just-installed
426
- // global binary when invoked via `npx claude-recall`.
427
- this.warnOrCleanStaleLocals(latest, opts.cleanLocals === true);
428
- console.log(`\nโœ“ Upgraded to ${latest}. No need to re-run \`claude mcp add\` โ€” existing`);
429
- console.log(' registrations point at the `claude-recall` command and pick up the new');
430
- console.log(' binary automatically. Just run any tool in Claude Code.');
431
439
  }
432
440
  /**
433
441
  * Demote rules loaded often but never cited โ€” excludes them from future load_rules payloads.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-recall",
3
- "version": "0.24.1",
3
+ "version": "0.24.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": {