claude-recall 0.8.7 → 0.8.9

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.
@@ -41,14 +41,14 @@ def should_require_search(tool_name: str, tool_input: Dict[str, Any]) -> bool:
41
41
  if any(keyword in command.lower() for keyword in CRITICAL_BASH_KEYWORDS):
42
42
  return True
43
43
 
44
- return False
44
+ return True # Allow on failure
45
45
 
46
46
 
47
47
  def check_recent_search(session_id: str) -> bool:
48
48
  """Check if memory search was performed recently in this session."""
49
49
  if not session_id:
50
50
  # No session ID - strict mode: block execution
51
- return False
51
+ return True # Allow on failure
52
52
 
53
53
  try:
54
54
  # Call claude-recall CLI to check recent tool usage
@@ -61,14 +61,14 @@ def check_recent_search(session_id: str) -> bool:
61
61
 
62
62
  if result.returncode != 0:
63
63
  # Command failed - strict mode: block execution
64
- return False
64
+ return True # Allow on failure
65
65
 
66
66
  # Check if mcp__claude-recall__search was called recently
67
67
  return 'mcp__claude-recall__search' in result.stdout
68
68
 
69
69
  except (subprocess.TimeoutExpired, FileNotFoundError, Exception):
70
- # Check failed - strict mode: block execution
71
- return False
70
+ # Check failed - be permissive (CLI may hang)
71
+ return True # Allow on failure
72
72
 
73
73
 
74
74
  def generate_search_query(tool_name: str, tool_input: Dict[str, Any]) -> str:
@@ -4,10 +4,6 @@
4
4
  {
5
5
  "matcher": "Write|Edit",
6
6
  "hooks": [
7
- {
8
- "type": "command",
9
- "command": "python3 .claude/hooks/pre_tool_search_enforcer.py"
10
- },
11
7
  {
12
8
  "type": "command",
13
9
  "command": "python3 .claude/hooks/pubnub_pre_tool_hook.py"
@@ -6,7 +6,8 @@
6
6
  "Bash(npm run build:*)",
7
7
  "Bash(git add:*)",
8
8
  "Bash(git commit:*)",
9
- "Bash(claude-recall --version)"
9
+ "Bash(claude-recall --version)",
10
+ "Bash(npx claude-recall:*)"
10
11
  ],
11
12
  "deny": [],
12
13
  "ask": []
package/README.md CHANGED
@@ -170,7 +170,20 @@ cd your-project
170
170
  npm install claude-recall
171
171
  ```
172
172
 
173
- Restart **Claude Code**.
173
+ ---
174
+
175
+ ### Activate
176
+
177
+ ```bash
178
+ # Add to your MCP config (if not already):
179
+ claude mcp add claude-recall -- npx -y claude-recall@latest
180
+
181
+ # Or restart Claude Code if it's already configured:
182
+ # Exit and restart the claude session
183
+
184
+ # Verify it's in your config:
185
+ cat ~/.claude/settings.json | grep -A 5 claude-recall
186
+ ```
174
187
 
175
188
  ---
176
189
 
@@ -32,6 +32,7 @@ class MCPCommands {
32
32
  .description('Show MCP server status for current project')
33
33
  .action(async () => {
34
34
  await commands.showStatus();
35
+ process.exit(0);
35
36
  });
36
37
  // mcp ps - List all running MCP servers
37
38
  mcpCmd
@@ -39,6 +40,7 @@ class MCPCommands {
39
40
  .description('List all running MCP servers across all projects')
40
41
  .action(async () => {
41
42
  await commands.listServers();
43
+ process.exit(0);
42
44
  });
43
45
  // mcp stop - Stop MCP server
44
46
  mcpCmd
@@ -48,6 +50,7 @@ class MCPCommands {
48
50
  .option('--force', 'Force kill (SIGKILL) instead of graceful shutdown (SIGTERM)')
49
51
  .action(async (options) => {
50
52
  await commands.stopServer(options);
53
+ process.exit(0);
51
54
  });
52
55
  // mcp restart - Restart MCP server
53
56
  mcpCmd
@@ -56,6 +59,7 @@ class MCPCommands {
56
59
  .option('--force', 'Force kill before restart')
57
60
  .action(async (options) => {
58
61
  await commands.restartServer(options);
62
+ process.exit(0);
59
63
  });
60
64
  // mcp cleanup - Clean up stale processes and PID files
61
65
  mcpCmd
@@ -66,6 +70,7 @@ class MCPCommands {
66
70
  .option('--force', 'Force kill processes')
67
71
  .action(async (options) => {
68
72
  await commands.cleanup(options);
73
+ process.exit(0);
69
74
  });
70
75
  }
71
76
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-recall",
3
- "version": "0.8.7",
3
+ "version": "0.8.9",
4
4
  "description": "Persistent memory for Claude Code with fire-and-forget PubNub architecture, automatic capture, failure learning, and project scoping via MCP server",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
@@ -6,50 +6,39 @@ const os = require('os');
6
6
 
7
7
  console.log('\nšŸš€ Setting up Claude Recall...\n');
8
8
 
9
- try {
10
- // Configure MCP server in ~/.claude.json
11
- const claudeConfigPath = path.join(os.homedir(), '.claude.json');
12
-
13
- // Read or create claude config
14
- let config = { mcpServers: {} };
15
- if (fs.existsSync(claudeConfigPath)) {
16
- const configContent = fs.readFileSync(claudeConfigPath, 'utf8');
17
- config = JSON.parse(configContent);
18
- if (!config.mcpServers) {
19
- config.mcpServers = {};
20
- }
21
- }
22
-
23
- // Check if claude-recall is already configured
24
- if (config.mcpServers['claude-recall']) {
25
- console.log('āš ļø Claude Recall is already configured in ~/.claude.json');
26
- console.log(' Updating configuration...');
27
- }
9
+ const { execSync } = require('child_process');
28
10
 
11
+ try {
29
12
  // Set up database location in user's home directory
30
13
  const dbDir = path.join(os.homedir(), '.claude-recall');
31
-
14
+
32
15
  // Create directory if it doesn't exist
33
16
  if (!fs.existsSync(dbDir)) {
34
17
  fs.mkdirSync(dbDir, { recursive: true });
35
18
  console.log(`šŸ“ Created database directory: ${dbDir}`);
36
19
  }
37
20
 
38
- // Add or update claude-recall configuration
39
- // Remove env variables since we're hardcoding the path to ~/.claude-recall/claude-recall.db
40
- config.mcpServers['claude-recall'] = {
41
- type: 'stdio',
42
- command: 'npx',
43
- args: ['claude-recall', 'mcp', 'start']
44
- };
45
-
46
- // Write back the config with proper formatting
47
- fs.writeFileSync(claudeConfigPath, JSON.stringify(config, null, 2));
21
+ // Register MCP server using official Claude CLI
22
+ try {
23
+ // Remove existing registration first (in case of update)
24
+ try {
25
+ execSync('claude mcp remove claude-recall', { stdio: 'ignore' });
26
+ } catch (e) {
27
+ // Ignore if not registered
28
+ }
48
29
 
49
- console.log('āœ… Successfully configured Claude Recall in ~/.claude.json');
30
+ // Register using official CLI
31
+ execSync('claude mcp add claude-recall -- npx claude-recall mcp start', {
32
+ stdio: 'inherit'
33
+ });
34
+ console.log('āœ… Registered Claude Recall MCP server');
35
+ } catch (mcpError) {
36
+ console.log('āš ļø Could not auto-register MCP server.');
37
+ console.log(' Please run manually:');
38
+ console.log(' claude mcp add claude-recall -- npx claude-recall mcp start');
39
+ }
50
40
 
51
41
  // Update project CLAUDE.md with minimal instructions
52
- const { execSync } = require('child_process');
53
42
  try {
54
43
  execSync('node ' + path.join(__dirname, 'postinstall-claude-md.js'), { stdio: 'inherit' });
55
44
  } catch (error) {