fix: respect CLAUDE_CONFIG_DIR for plugin paths (#626) #634
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
When users set
CLAUDE_CONFIG_DIRto 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 respectingCLAUDE_CONFIG_DIR. This is a long-standing issue - PR #226 attempted a partial fix but was deferred, and it didn't includeHealthMonitor.ts.Solution
MARKETPLACE_ROOTconstant tosrc/shared/paths.tsthat respectsCLAUDE_CONFIG_DIRpaths.tsFiles Changed
src/shared/paths.tsMARKETPLACE_ROOTconstantsrc/services/infrastructure/HealthMonitor.tsMARKETPLACE_ROOTfor version checksrc/shared/worker-utils.tsMARKETPLACE_ROOTinstead of local definitionsrc/services/worker/BranchManager.tsMARKETPLACE_ROOTinstead of local definitionsrc/services/integrations/CursorHooksInstaller.tsMARKETPLACE_ROOTandCLAUDE_CONFIG_DIRsrc/services/context/ObservationCompiler.tsCLAUDE_CONFIG_DIRfor transcript pathTesting
~/.claudereferences replaced with environment-aware constants~/.claudewhenCLAUDE_CONFIG_DIRis not setFixes #626