claude-mem 3.3.12 → 3.4.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.
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -37,17 +37,18 @@ process.stdin.on('end', async () => {
37
37
  const validation = validateHookPayload(payload, 'PreCompact');
38
38
  if (!validation.valid) {
39
39
  const response = createHookResponse('PreCompact', false, { reason: validation.error });
40
- console.log(JSON.stringify(response));
40
+ debugLog('Validation failed', { response });
41
+ // Exit silently - validation failure is expected flow control
41
42
  process.exit(0);
42
43
  }
43
44
 
44
45
  // Check for environment-based blocking conditions
45
46
  if (payload.trigger === 'auto' && process.env.DISABLE_AUTO_COMPRESSION === 'true') {
46
- debugLog('Auto-compression disabled by configuration');
47
47
  const response = createHookResponse('PreCompact', false, {
48
48
  reason: 'Auto-compression disabled by configuration'
49
49
  });
50
- console.log(JSON.stringify(response));
50
+ debugLog('Auto-compression disabled', { response });
51
+ // Exit silently - disabled compression is expected flow control
51
52
  process.exit(0);
52
53
  }
53
54
 
@@ -60,26 +61,24 @@ process.stdin.on('end', async () => {
60
61
  const result = await executeCliCommand(cliCommand, ['compress', payload.transcript_path]);
61
62
 
62
63
  if (!result.success) {
63
- debugLog('Compression command failed', { stderr: result.stderr });
64
64
  const response = createHookResponse('PreCompact', false, {
65
65
  reason: `Compression failed: ${result.stderr || 'Unknown error'}`
66
66
  });
67
- console.log(JSON.stringify(response));
67
+ debugLog('Compression command failed', { stderr: result.stderr, response });
68
+ console.log(`claude-mem error: compression failed, see logs at ~/.claude-mem/logs/`);
68
69
  process.exit(0);
69
70
  }
70
71
 
71
- // Success - create standardized approval response using HookTemplates
72
+ // Success - exit silently (suppressOutput is true)
72
73
  debugLog('Compression completed successfully');
73
- const response = createHookResponse('PreCompact', true);
74
- console.log(JSON.stringify(response));
75
74
  process.exit(0);
76
75
 
77
76
  } catch (error) {
78
- debugLog('Pre-compact hook error', { error: error.message });
79
77
  const response = createHookResponse('PreCompact', false, {
80
78
  reason: `Hook execution error: ${error.message}`
81
79
  });
82
- console.log(JSON.stringify(response));
80
+ debugLog('Pre-compact hook error', { error: error.message, response });
81
+ console.log(`claude-mem error: hook failed, see logs at ~/.claude-mem/logs/`);
83
82
  process.exit(1);
84
83
  }
85
84
  });
@@ -55,10 +55,8 @@ process.stdin.on('end', async () => {
55
55
  process.exit(0);
56
56
  }
57
57
 
58
- // Extract project name from current working directory and sanitize
59
- const rawProjectName = path.basename(process.cwd());
60
- const projectName = rawProjectName.replace(/-/g, '_');
61
- debugLog('Extracted project name', { rawProjectName, projectName });
58
+ // Extract project name from current working directory
59
+ const projectName = path.basename(process.cwd());
62
60
 
63
61
  // Load context using standardized CLI execution helper
64
62
  const contextResult = await executeCliCommand(cliCommand, [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-mem",
3
- "version": "3.3.12",
3
+ "version": "3.4.2",
4
4
  "description": "Memory compression system for Claude Code - persist context across sessions",
5
5
  "keywords": [
6
6
  "claude",