Skip to content

Conversation

@Kuroakira
Copy link

Problem

When users set CLAUDE_CONFIG_DIR to a custom location (e.g., ~/.claude-work), multiple claude-mem features fail because paths were hardcoded to ~/.claude.

The most visible failure is in HealthMonitor.ts (reported in #626):

ENOENT: no such file or directory, open '/Users/$USER/.claude/plugins/marketplaces/thedotmack/package.json'

Root Cause

Several files independently calculated the plugin path using path.join(homedir(), '.claude', ...) instead of respecting CLAUDE_CONFIG_DIR. This is a long-standing issue - PR #226 attempted a partial fix but was deferred, and it didn't include HealthMonitor.ts.

Solution

  1. Added MARKETPLACE_ROOT constant to src/shared/paths.ts that respects CLAUDE_CONFIG_DIR
  2. Updated all files with hardcoded paths to use centralized constants from paths.ts

Files Changed

File Change
src/shared/paths.ts Added MARKETPLACE_ROOT constant
src/services/infrastructure/HealthMonitor.ts Use MARKETPLACE_ROOT for version check
src/shared/worker-utils.ts Import MARKETPLACE_ROOT instead of local definition
src/services/worker/BranchManager.ts Import MARKETPLACE_ROOT instead of local definition
src/services/integrations/CursorHooksInstaller.ts Use MARKETPLACE_ROOT and CLAUDE_CONFIG_DIR
src/services/context/ObservationCompiler.ts Use CLAUDE_CONFIG_DIR for transcript path

Testing

  • Build passes
  • All hardcoded ~/.claude references replaced with environment-aware constants
  • Backwards compatible: defaults to ~/.claude when CLAUDE_CONFIG_DIR is not set

Fixes #626

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: HealthMonitor hardcodes ~/.claude path, fails with custom config directories

1 participant