remember plugin: save-session.sh path resolution broken in marketplace install

Resolved 💬 3 comments Opened Apr 10, 2026 by adirksen Closed Jun 1, 2026

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.

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗