- Updated multiple hooks (context-hook, new-hook, save-hook, summary-hook, user-message-hook) to throw errors using `getWorkerRestartInstructions` for improved user guidance on worker connection issues.
- Enhanced `handleWorkerError` function to utilize the new error message generator for consistent error reporting.
- Modified `ensureWorkerRunning` function to provide detailed instructions based on the worker's state, including port information.
- Introduced `getWorkerRestartInstructions` utility in `error-messages.ts` to generate platform-aware error messages for worker failures.
On Windows systems, `localhost` resolves to IPv6 (::1) while the worker
binds to IPv4 (127.0.0.1), causing MCP tool connections to fail.
This change uses the existing getWorkerHost() function which correctly
returns the configured host address (defaulting to 127.0.0.1).
Fixes connection failures on Windows where localhost prefers IPv6.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
* fix: add npm fallback when bun install fails with alias packages
Bun has issues resolving npm alias packages (e.g., string-width-cjs,
strip-ansi-cjs, wrap-ansi-cjs) that are defined in package-lock.json.
When bun fails with 404 errors for these packages, we now fall back
to npm which handles aliases correctly.
This fixes the installation failure that many users are experiencing
where bun install fails with:
error: GET https://registry.npmjs.org/string-width-cjs/-/string-width-cjs-4.2.3.tgz - 404
The fallback is transparent to users - they will see a warning message
and the installation will continue with npm.
Fixes#262
Related: #261, #253🤖 Generated with Claude Code (https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix: preserve original code style (single quotes)
---------
Co-authored-by: Jonas Hanisch <jhanisch@matero.de>
Co-authored-by: Claude <noreply@anthropic.com>
Updated built plugin files with latest changes including localhost
binding security improvements and enhanced runtime detection.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
🐛 Bug Fixes
**Windows Installation**
- Fixed Bun PATH detection on Windows after fresh install
- Added fallback to check common install paths before PATH reload
- Improved smart-install.js to use full Bun path when not in PATH
- Added proper path quoting for Windows usernames with spaces
**Worker Startup**
- Fixed worker connection failures in Stop hook
- Added health check retry loop (5 attempts, 500ms intervals)
- Worker now waits up to 2.5s for responsiveness before returning
- Improved error detection for Bun's ConnectionRefused error format
🎯 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Updated all version files
- Updated CHANGELOG with v7.1.1 release notes
- Critical fixes: Windows Bun auto-install, path quoting
- New feature: Automatic worker restart on version updates
Critical improvement for seamless upgrades across all versions.
Changes:
1. Added /api/version endpoint to worker service
- Returns current worker version from package.json
2. Added version checking in worker-utils.ts
- getPluginVersion() - reads plugin's package.json version
- getWorkerVersion() - fetches version from worker API
- ensureWorkerVersionMatches() - compares and restarts if needed
3. Modified ensureWorkerRunning()
- Now calls ensureWorkerVersionMatches() after health check
- Automatically restarts worker when version mismatch detected
- Logs version mismatch for debugging
Impact:
- Users no longer need to manually restart worker after upgrades
- Eliminates connection errors from running old worker code
- Critical for v7.1.1 (Bun auto-install) and all future releases
- Fixes the issue where PR #236 changes weren't applied until manual restart
Testing:
- Version endpoint working: returns {"version":"7.1.0"}
- Worker health check: passing
- Auto-restart logic: triggers on version mismatch
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
CRITICAL FIX: v7.1.0 Bun auto-install broken on Windows 11
Problem:
- hooks.json calls `bun smart-install.js` but if Bun isn't installed,
command fails immediately with "bun is not recognized"
- smart-install.js never runs, so Bun never gets installed
- Chicken-and-egg problem
Root Cause:
- v7.1.0 removed Bun/uv auto-installation logic from smart-install.js
- Assumed Bun would already be available
- Breaks fresh installations on all platforms
Solution:
1. Changed SessionStart hook to use `node` for smart-install.js
(Node.js always available in Claude Code)
2. Restored Bun auto-installation logic:
- isBunInstalled() - check if Bun is in PATH
- installBun() - auto-install via PowerShell (Windows) or curl (Unix/macOS)
- Also restored uv auto-installation for Chroma
After Fix:
- smart-install.js runs with node (always available)
- Detects if Bun is missing and auto-installs it
- Subsequent hooks use bun successfully
- Works on fresh Windows installations
Fixes: User report from Discord - Windows 11 'bun' is not recognized
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Wraps all ${CLAUDE_PLUGIN_ROOT} variable expansions with quotes to handle
Windows paths containing spaces (e.g., C:\Users\John Doe\.claude\...).
Without quotes, the shell splits the path at spaces, causing Node.js to
interpret the first segment as JavaScript and throw SyntaxError: Unexpected
token ':'.
This fix updates the Bun migration (v7.1.0) to include proper quoting,
superseding PR #212 which was based on pre-migration code.
Fixes#212🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
BREAKING CHANGE: Worker now binds to 127.0.0.1 by default instead of 0.0.0.0
This fixes a critical security issue where the worker service was exposing
all API endpoints to the network without authentication.
Changes:
- Default worker binding changed from 0.0.0.0 to 127.0.0.1 (localhost-only)
- Added CLAUDE_MEM_WORKER_HOST configuration setting
- Added host validation in settings API
- Updated UI to allow configuring bind address
- Updated documentation in README.md and CLAUDE.md
For users who need remote access (e.g., server deployments),
set CLAUDE_MEM_WORKER_HOST=0.0.0.0 in ~/.claude-mem/settings.json
All 42 tests pass. Build successful.
Co-authored-by: 7Sageer <12210216@mail.sustech.edu.cn>
Add comprehensive technical documentation explaining the v7.1.0 migration from PM2 to Bun-based process management and better-sqlite3 to bun:sqlite database driver.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Major architectural migration from PM2 to native Bun process management,
and better-sqlite3 to bun:sqlite database driver.
Key changes:
- Replace PM2 with custom Bun-based ProcessManager
- Migrate from better-sqlite3 npm to bun:sqlite runtime
- Auto-install Bun and uv (Python) on first run
- Automatic legacy PM2 process cleanup on all platforms
- Complete documentation in docs/PM2-TO-BUN-MIGRATION.md
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Previously skipped Windows PM2 cleanup based on assumption that PM2
wasn't used on Windows. However, this left potential orphaned processes.
Changes:
- Remove platform check (process.platform !== 'win32')
- Run PM2 cleanup on Mac/Linux/Windows consistently
- Create .pm2-migrated marker on all platforms
- Update documentation to reflect cross-platform behavior
Rationale:
- Quality migration should clean up ALL orphaned processes
- Error handling (try/catch) already makes this safe
- Even if PM2 had Windows issues, cleanup won't hurt
- Consistent behavior across platforms is better UX
Impact:
- Windows users will get PM2 cleanup on first hook trigger
- Marker file now created on Windows (prevents repeated attempts)
- No breaking changes (errors caught and ignored)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Implemented a method to check if Bun is available in the system PATH.
- Updated the startWithBun method to return an error if Bun is not found.
- Enhanced PID file parsing to validate required fields and their types.
- Cleaned up stale PID files if the process is no longer alive.
fix(SettingsRoutes): clear port cache after updating settings
- Added a call to clearPortCache after writing updated settings to ensure the application uses the latest configuration.
- Updated README.md to include responsive badges that adapt to the user's color scheme preference.
- Added new SVG files for dark and light theme badges to enhance visual consistency.
- Created README.zh.md for Chinese localization of the project.
- Developed a README translation script to support multiple languages using Claude Agent SDK.
- Implemented CLI and programmatic usage for the translation tool.
- Added examples for integrating the translation tool into build scripts and CI/CD pipelines.
- Enhanced error handling and logging for translation processes.
- Included support for various languages and output customization options.
Add feature/bun-executable to the allowed branches list in the Version Channel selector, enabling users to switch to this branch from the settings UI.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Alex Newman <thedotmack@users.noreply.github.com>
- Delete BinaryManager.ts - no longer needed
- Simplify ProcessManager.ts - single Bun spawn path for all platforms
- Update smart-install.js - auto-install Bun if missing (Windows/Unix)
- Update documentation to reflect Bun requirement
This simplifies the codebase by:
- Using Bun consistently across all platforms (hooks + worker)
- Eliminating binary download/hosting complexity
- Zero native dependencies with bun:sqlite
- Auto-installing Bun on first run if not present
Co-authored-by: Claude <noreply@anthropic.com>
- Updated shebangs in user-message-hook.js, worker-cli.js, and worker-service.cjs to use Bun instead of Node.
- Modified build-hooks.js to generate Bun-compatible shebangs in built scripts.
- Enhanced sync-marketplace.cjs to trigger a worker restart after syncing files via an HTTP request.
- Improved worker-cli.ts to exit with appropriate status codes after executing commands.
- Added build-worker-binary.js to create a Windows executable for the worker service using Bun's compile feature.