Release v4.2.11: Cross-platform Claude path detection

Critical Bugfix:
- Fixed SDK auto-detection failure by implementing explicit which/where commands
- Unix/macOS: Uses 'which claude' command
- Windows: Uses 'where claude' command (CMD and PowerShell compatible)
- Fallback to CLAUDE_CODE_PATH environment variable
- Handles Windows multiple results (takes first match)

Impact:
- Before: Worker failed with "path must be string, received undefined"
- After: Worker correctly finds Claude executable on all platforms

Technical changes:
- Added findClaudePath() helper using child_process.execSync
- Platform detection via process.platform === 'win32'
- Updated src/sdk/worker.ts with explicit path detection
- Updated src/services/worker-service.ts with explicit path detection
- Bumped version to 4.2.11 in all metadata files
- Updated CLAUDE.md with v4.2.11 release notes

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Alex Newman
2025-10-25 14:56:30 -04:00
parent a3b0b70a98
commit b87654d452
3 changed files with 37 additions and 15 deletions
+1 -1
View File
@@ -10,7 +10,7 @@
"plugins": [
{
"name": "claude-mem",
"version": "4.2.10",
"version": "4.2.11",
"source": "./plugin",
"description": "Persistent memory system for Claude Code - context compression across sessions"
}
+35 -13
View File
@@ -4,7 +4,7 @@
Claude-mem is a persistent memory compression system that preserves context across Claude Code sessions. It automatically captures tool usage observations, processes them through the Claude Agent SDK, and makes summaries available to future sessions.
**Current Version**: 4.2.10
**Current Version**: 4.2.11
**License**: AGPL-3.0
**Author**: Alex Newman (@thedotmack)
@@ -210,25 +210,47 @@ npm run build && git commit -a -m "Build and update" && git push && cd ~/.claude
## Version History
### v4.2.10 (Current)
### v4.2.11 (Current)
**Breaking Changes**: None (patch version)
**Critical Bugfix**:
- Fixed Windows compatibility issue caused by hardcoded macOS-specific Claude executable path
- Removed hardcoded path: `/Users/alexnewman/.nvm/versions/node/v24.5.0/bin/claude`
- Removed `pathToClaudeCodeExecutable` parameter from SDK query() calls
- SDK now automatically detects Claude Code executable path on all platforms
- Improves cross-platform compatibility (Windows, macOS, Linux)
- Fixed SDK auto-detection failure by implementing explicit `which`/`where` command execution
- SDK's automatic Claude path detection was not working (returned undefined)
- Implemented cross-platform executable finder using `child_process.execSync`
- Unix/macOS: Uses `which claude` command
- Windows: Uses `where claude` command (works in both CMD and PowerShell)
- Fallback to `CLAUDE_CODE_PATH` environment variable if set
- Handles Windows multiple results (takes first match)
**Impact**:
- Before: Worker service failed on Windows due to hardcoded macOS path
- After: Worker service works correctly on all platforms
- Before: Worker service failed with "path argument must be of type string. Received undefined"
- After: Worker service correctly finds Claude executable on all platforms
**Technical Details**:
- Updated `src/sdk/worker.ts` to remove hardcoded Claude path and `pathToClaudeCodeExecutable` parameter
- Updated `src/services/worker-service.ts` to remove hardcoded Claude path and parameter
- Built `plugin/scripts/worker-service.cjs` reflects changes
- Affects all SDK agent initialization in worker service
- Added `findClaudePath()` helper function to both worker files
- Uses `process.platform === 'win32'` to detect Windows and choose appropriate command
- Logs the discovered path for debugging: "Found Claude executable: /path/to/claude"
- Updated `src/sdk/worker.ts` with explicit path detection
- Updated `src/services/worker-service.ts` with explicit path detection
- Both files now pass `pathToClaudeCodeExecutable: claudePath` to SDK
**Files Changed**:
- `src/sdk/worker.ts`
- `src/services/worker-service.ts`
- `plugin/scripts/worker-service.cjs` (rebuilt)
### v4.2.10
**Breaking Changes**: None (patch version)
**Critical Bugfix**:
- Attempted to fix Windows compatibility by removing hardcoded macOS path
- Removed hardcoded path: `/Users/alexnewman/.nvm/versions/node/v24.5.0/bin/claude`
- Removed `pathToClaudeCodeExecutable` parameter to rely on SDK auto-detection
- **Note**: This approach failed; SDK auto-detection did not work (fixed in v4.2.11)
**Impact**:
- Partial fix: Removed hardcoded macOS path
- Issue: SDK auto-detection returned undefined, causing worker failures
**Files Changed**:
- `src/sdk/worker.ts`
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "claude-mem",
"version": "4.2.10",
"version": "4.2.11",
"description": "Memory compression system for Claude Code - persist context across sessions",
"keywords": [
"claude",