claude-recall 0.8.6 → 0.8.7

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.
@@ -47,8 +47,8 @@ def should_require_search(tool_name: str, tool_input: Dict[str, Any]) -> bool:
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
- # No session ID, be permissive
51
- return True
50
+ # No session ID - strict mode: block execution
51
+ return False
52
52
 
53
53
  try:
54
54
  # Call claude-recall CLI to check recent tool usage
@@ -60,15 +60,15 @@ def check_recent_search(session_id: str) -> bool:
60
60
  )
61
61
 
62
62
  if result.returncode != 0:
63
- # Command failed, be permissive (don't block)
64
- return True
63
+ # Command failed - strict mode: block execution
64
+ return False
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
- # If check fails, be permissive (don't block)
71
- return True
70
+ # Check failed - strict mode: block execution
71
+ return False
72
72
 
73
73
 
74
74
  def generate_search_query(tool_name: str, tool_input: Dict[str, Any]) -> str:
@@ -4,6 +4,10 @@
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
+ },
7
11
  {
8
12
  "type": "command",
9
13
  "command": "python3 .claude/hooks/pubnub_pre_tool_hook.py"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-recall",
3
- "version": "0.8.6",
3
+ "version": "0.8.7",
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": {
@@ -121,6 +121,7 @@ try {
121
121
  // Copy hook scripts from package
122
122
  const packageHooksDir = path.join(__dirname, '../.claude/hooks');
123
123
  const hookScripts = [
124
+ 'pre_tool_search_enforcer.py',
124
125
  'pubnub_pre_tool_hook.py',
125
126
  'pubnub_prompt_hook.py'
126
127
  ];
@@ -152,8 +153,12 @@ try {
152
153
  settings.hooks = {
153
154
  PreToolUse: [
154
155
  {
155
- matcher: "Write|Edit|Bash",
156
+ matcher: "Write|Edit",
156
157
  hooks: [
158
+ {
159
+ type: "command",
160
+ command: "python3 .claude/hooks/pre_tool_search_enforcer.py"
161
+ },
157
162
  {
158
163
  type: "command",
159
164
  command: "python3 .claude/hooks/pubnub_pre_tool_hook.py"
@@ -174,9 +179,9 @@ try {
174
179
  };
175
180
 
176
181
  fs.writeFileSync(settingsPath, JSON.stringify(settings, null, 2));
177
- console.log('✅ Configured PubNub hooks in .claude/settings.json');
178
- console.log(' → PreToolUse: Publishes tool events to memory agent');
179
- console.log(' → UserPromptSubmit: Publishes prompts for preference extraction');
182
+ console.log('✅ Configured hooks in .claude/settings.json');
183
+ console.log(' → PreToolUse: Enforces memory search before Write/Edit');
184
+ console.log(' → UserPromptSubmit: Captures prompts for preference extraction');
180
185
  }
181
186
  }
182
187
  } catch (error) {