From b87654d452af1301a93a8d6c8e50c6a044bbecd6 Mon Sep 17 00:00:00 2001 From: Alex Newman Date: Sat, 25 Oct 2025 14:56:30 -0400 Subject: [PATCH] Release v4.2.11: Cross-platform Claude path detection MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- .claude-plugin/marketplace.json | 2 +- CLAUDE.md | 48 ++++++++++++++++++++++++--------- package.json | 2 +- 3 files changed, 37 insertions(+), 15 deletions(-) diff --git a/.claude-plugin/marketplace.json b/.claude-plugin/marketplace.json index 8e831ba3..0f228b9c 100644 --- a/.claude-plugin/marketplace.json +++ b/.claude-plugin/marketplace.json @@ -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" } diff --git a/CLAUDE.md b/CLAUDE.md index 0f71d3a6..3e832b08 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -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` diff --git a/package.json b/package.json index 25e35d26..e37f8203 100644 --- a/package.json +++ b/package.json @@ -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",