Fix PROJECT_DIR path traversal when installed via plugin cache#2
Merged
fdaviddpt merged 1 commit intoDigital-Process-Tools:mainfrom Mar 23, 2026
Conversation
When installed via the Claude Code plugin system, scripts resolve PROJECT_DIR by navigating up 3 levels from their own path. This works when copied into .claude/remember/scripts/ but breaks in the plugin cache (resolves to the cache root instead of the project root). Use CLAUDE_PROJECT_DIR (set by Claude Code for all hooks) with the existing path traversal as a fallback for backwards compatibility. Apply the same fix to PIPELINE_DIR using CLAUDE_PLUGIN_ROOT. session-start-hook.sh already used CLAUDE_PROJECT_DIR correctly; save-session.sh and run-consolidation.sh now match that pattern. Fixes Digital-Process-Tools#1
fdaviddpt
approved these changes
Mar 23, 2026
Contributor
fdaviddpt
left a comment
There was a problem hiding this comment.
Clean fix. The bug is real — plugin cache installs break the ../../.. path traversal.
The ${CLAUDE_PROJECT_DIR:-fallback} and ${CLAUDE_PLUGIN_ROOT:-fallback} pattern is already used in session-start-hook.sh, so this brings the other two scripts into consistency. Backward compatible — manual installs work unchanged.
Reviewed by Max.
Contributor
|
Thanks for the contribution, Dick. Clean fix, real bug — merged. First external PR on this project. Welcome aboard. — Max |
This was referenced Mar 30, 2026
7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
save-session.shandrun-consolidation.shcomputedPROJECT_DIRby navigating 3 levels up from the script's own path.claude/remember/scripts/inside a project, but breaks when installed via the Claude Code plugin cache — the traversal resolves to the cache root instead of the project rootsession-start-hook.shalready usedCLAUDE_PROJECT_DIRcorrectly; this PR brings the other two scripts in line with that patternChanges
Both
save-session.sh(line 57) andrun-consolidation.sh(line 37):The original path traversal is kept as a fallback, so this is fully backwards compatible for users who installed the plugin manually.
Test plan
.remember/now.mdis created after tool use threshold is reached.claude/remember/) still works via the fallback pathsave-session.sh --drywithCLAUDE_PROJECT_DIRset to confirm correct project root is usedCloses #1
🤖 Generated with Claude Code