claude-code - 💡(How to fix) Fix remember plugin: save-session.sh path resolution broken in marketplace install [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#46448Fetched 2026-04-11 06:20:00
View on GitHub
Comments
0
Participants
1
Timeline
4
Reactions
0
Author
Participants
Timeline (top)
labeled ×4

The remember plugin (remember@claude-plugins-official) fails silently on every auto-save attempt when installed via the plugin marketplace. The PostToolUse hook fires correctly but save-session.sh computes a wrong PIPELINE_DIR, causing all saves to fail with a cd error.

Error Message

The remember plugin (remember@claude-plugins-official) fails silently on every auto-save attempt when installed via the plugin marketplace. The PostToolUse hook fires correctly but save-session.sh computes a wrong PIPELINE_DIR, causing all saves to fail with a cd error.

Error (from .remember/logs/autonomous/save-*.log)

Every user who installs remember via the marketplace gets a plugin that appears to work (hooks fire, log files are created) but never actually saves any session memory. The only indication of failure is the error messages inside the log files themselves.

Root Cause

save-session.sh computes PROJECT_DIR and PIPELINE_DIR by walking up the directory tree from its own location:

# save-session.sh (lines 57-58)
PROJECT_DIR="$(cd "$(dirname "$0")/../../.." && pwd)"
PIPELINE_DIR="${PROJECT_DIR}/.claude/remember"

This was written for self-installation at project/.claude/remember/scripts/ — where "3 directories up" from scripts/ correctly resolves to the project root.

In the marketplace install, the script lives at:

~/.claude/plugins/cache/claude-plugins-official/remember/0.1.0/scripts/

"3 directories up" now resolves to ~/.claude/plugins/cache/claude-plugins-official/ — not the project root. PIPELINE_DIR becomes a non-existent path and every save fails.

post-tool-hook.sh was correctly updated to use ${CLAUDE_PLUGIN_ROOT} in its command string, but save-session.sh was not updated to read the CLAUDE_PLUGIN_ROOT and CLAUDE_PROJECT_DIR env vars.

Code Example

/home/.../.claude/plugins/cache/claude-plugins-official/remember/0.1.0/scripts/save-session.sh: line 135: cd: /home/.../.claude/plugins/cache/claude-plugins-official/.claude/remember: No such file or directory

---

# save-session.sh (lines 57-58)
PROJECT_DIR="$(cd "$(dirname "$0")/../../.." && pwd)"
PIPELINE_DIR="${PROJECT_DIR}/.claude/remember"

---

~/.claude/plugins/cache/claude-plugins-official/remember/0.1.0/scripts/

---

# Before
PROJECT_DIR="$(cd "$(dirname "$0")/../../.." && pwd)"
PIPELINE_DIR="${PROJECT_DIR}/.claude/remember"

# After
PLUGIN_ROOT="${CLAUDE_PLUGIN_ROOT:-$(cd "$(dirname "$0")/.." && pwd)}"
PROJECT_DIR="${CLAUDE_PROJECT_DIR:-$(cd "$(dirname "$0")/../../.." && pwd)}"
PIPELINE_DIR="${PLUGIN_ROOT}"

---

# Before
nohup "$SAVE_SCRIPT" "$SESSION_ID" > "...log" 2>&1 &

# After
PROJECT_ABS="$(cd "$PROJECT" 2>/dev/null && pwd || echo "$PROJECT")"
nohup env CLAUDE_PLUGIN_ROOT="$PLUGIN_ROOT" CLAUDE_PROJECT_DIR="$PROJECT_ABS" \
    "$SAVE_SCRIPT" "$SESSION_ID" > "...log" 2>&1 &
RAW_BUFFERClick to expand / collapse

Summary

The remember plugin (remember@claude-plugins-official) fails silently on every auto-save attempt when installed via the plugin marketplace. The PostToolUse hook fires correctly but save-session.sh computes a wrong PIPELINE_DIR, causing all saves to fail with a cd error.

Environment

  • Claude Code with remember@claude-plugins-official installed
  • Plugin cache path: ~/.claude/plugins/cache/claude-plugins-official/remember/0.1.0/

Error (from .remember/logs/autonomous/save-*.log)

/home/.../.claude/plugins/cache/claude-plugins-official/remember/0.1.0/scripts/save-session.sh: line 135: cd: /home/.../.claude/plugins/cache/claude-plugins-official/.claude/remember: No such file or directory

Root Cause

save-session.sh computes PROJECT_DIR and PIPELINE_DIR by walking up the directory tree from its own location:

# save-session.sh (lines 57-58)
PROJECT_DIR="$(cd "$(dirname "$0")/../../.." && pwd)"
PIPELINE_DIR="${PROJECT_DIR}/.claude/remember"

This was written for self-installation at project/.claude/remember/scripts/ — where "3 directories up" from scripts/ correctly resolves to the project root.

In the marketplace install, the script lives at:

~/.claude/plugins/cache/claude-plugins-official/remember/0.1.0/scripts/

"3 directories up" now resolves to ~/.claude/plugins/cache/claude-plugins-official/ — not the project root. PIPELINE_DIR becomes a non-existent path and every save fails.

post-tool-hook.sh was correctly updated to use ${CLAUDE_PLUGIN_ROOT} in its command string, but save-session.sh was not updated to read the CLAUDE_PLUGIN_ROOT and CLAUDE_PROJECT_DIR env vars.

Proposed Fix

In save-session.sh, replace lines 57-58:

# Before
PROJECT_DIR="$(cd "$(dirname "$0")/../../.." && pwd)"
PIPELINE_DIR="${PROJECT_DIR}/.claude/remember"

# After
PLUGIN_ROOT="${CLAUDE_PLUGIN_ROOT:-$(cd "$(dirname "$0")/.." && pwd)}"
PROJECT_DIR="${CLAUDE_PROJECT_DIR:-$(cd "$(dirname "$0")/../../.." && pwd)}"
PIPELINE_DIR="${PLUGIN_ROOT}"

The fallbacks preserve backward compatibility with self-hosted installations.

In post-tool-hook.sh, explicitly pass env vars when launching save-session.sh via nohup (currently they are not forwarded to the background process):

# Before
nohup "$SAVE_SCRIPT" "$SESSION_ID" > "...log" 2>&1 &

# After
PROJECT_ABS="$(cd "$PROJECT" 2>/dev/null && pwd || echo "$PROJECT")"
nohup env CLAUDE_PLUGIN_ROOT="$PLUGIN_ROOT" CLAUDE_PROJECT_DIR="$PROJECT_ABS" \
    "$SAVE_SCRIPT" "$SESSION_ID" > "...log" 2>&1 &

Impact

Every user who installs remember via the marketplace gets a plugin that appears to work (hooks fire, log files are created) but never actually saves any session memory. The only indication of failure is the error messages inside the log files themselves.

extent analysis

TL;DR

Update save-session.sh to use environment variables CLAUDE_PLUGIN_ROOT and CLAUDE_PROJECT_DIR to correctly determine PIPELINE_DIR for marketplace installations.

Guidance

  • Verify the issue by checking the .remember/logs/autonomous/save-*.log files for cd errors indicating a wrong PIPELINE_DIR.
  • Update save-session.sh as proposed in the issue to use CLAUDE_PLUGIN_ROOT and CLAUDE_PROJECT_DIR environment variables.
  • Modify post-tool-hook.sh to pass CLAUDE_PLUGIN_ROOT and CLAUDE_PROJECT_DIR environment variables when launching save-session.sh via nohup.
  • Test the updated plugin by installing it via the marketplace and checking for successful auto-saves.

Example

# Updated save-session.sh
PLUGIN_ROOT="${CLAUDE_PLUGIN_ROOT:-$(cd "$(dirname "$0")/.." && pwd)}"
PROJECT_DIR="${CLAUDE_PROJECT_DIR:-$(cd "$(dirname "$0")/../../.." && pwd)}"
PIPELINE_DIR="${PLUGIN_ROOT}"

Notes

The proposed fix preserves backward compatibility with self-hosted installations by using fallbacks for CLAUDE_PLUGIN_ROOT and CLAUDE_PROJECT_DIR.

Recommendation

Apply the proposed workaround by updating save-session.sh and post-tool-hook.sh as described, to ensure correct functionality of the remember plugin installed via the marketplace.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING