-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Description
Bug Description
CC-Mem plugin fails to save memory on Windows when using /compact command due to two issues:
- Missing
SessionEndhook - The hooks.json only hasStophook, notSessionEndhook bun-runner.jscannot find npm-installed Bun - Only checks~/.bun/bin/bun.exe, but npm installs to%APPDATA%\npm\node_modules\bun\bin\bun.exe
Steps to Reproduce
- Install Bun via npm:
npm install -g bun - Install CC-Mem plugin
- Use Claude Code and run
/compactcommand - Check database timestamp:
ls -la ~/.claude-mem/claude-mem.db* - Database is not updated
Expected Behavior
After running /compact, the memory should be saved to database and timestamps should be updated.
Environment
- Claude-mem version: 10.3.1
- Claude Code version: 2.1.50
- OS: Windows 11
- Platform: win32
Root Cause
Issue 1: Missing SessionEnd Hook
File: ~/.claude/plugins/cache/thedotmack/claude-mem/10.3.1/hooks/hooks.json
The SessionEnd hook is missing, which is triggered by /compact command. Only Stop hook exists.
Issue 2: bun-runner.js Path Detection
File: ~/.claude/plugins/cache/thedotmack/claude-mem/10.3.1/scripts/bun-runner.js
The findBun() function only checks:
~/.bun/bin/bun.exe(official installer)- PATH (returns shell script on Windows via npm)
But npm installs Bun to: %USERPROFILE%\AppData\Roaming\npm\node_modules\bun\bin\bun.exe
Proposed Fix
1. Add SessionEnd hook to hooks.json
"SessionEnd": [
{
"hooks": [
{
"type": "command",
"command": "node \"\/scripts/bun-runner.js\" \"\/scripts/worker-service.cjs\" start",
"timeout": 60
},
{
"type": "command",
"command": "node \"\/scripts/bun-runner.js\" \"\/scripts/worker-service.cjs\" hook claude-code summarize",
"timeout": 120
},
{
"type": "command",
"command": "node \"\/scripts/bun-runner.js\" \"\/scripts/worker-service.cjs\" hook claude-code session-complete",
"timeout": 30
}
]
}
]2. Update bun-runner.js findBun() function
const bunPaths = IS_WINDOWS
? [
join(homedir(), '.bun', 'bin', 'bun.exe'),
join(homedir(), 'AppData', 'Roaming', 'npm', 'node_modules', 'bun', 'bin', 'bun.exe') // Add this line
]
: [...]Also modify to check known paths first on Windows (not PATH which contains shell scripts).
Workaround
Manually edit the files mentioned above in ~/.claude/plugins/cache/thedotmack/claude-mem/10.3.1/ and restart Claude Code.