Skip to content

Bug: PROJECT_DIR resolves to plugin cache directory instead of actual project #4

Closed as duplicate

Description

@davionyang

Description

save-session.sh fails because PROJECT_DIR (line 57) resolves to the plugin cache directory instead of the user's actual project directory.

Root Cause

Line 57 computes PROJECT_DIR by walking up 3 levels from the script's location:

PROJECT_DIR="$(cd "$(dirname "$0")/../../.." && pwd)"

The script lives at:

~/.claude/plugins/cache/claude-plugins-official/remember/0.1.0/scripts/save-session.sh

So ../../.. resolves to:

/Users/<user>/.claude/plugins/cache/claude-plugins-official

Then line 58 sets:

PIPELINE_DIR="${PROJECT_DIR}/.claude/remember"

Which becomes /Users/<user>/.claude/plugins/cache/claude-plugins-official/.claude/remember — a path that doesn't exist.

Error Log

save-session.sh: line 135: cd: /Users/<user>/.claude/plugins/cache/claude-plugins-official/.claude/remember: No such file or directory
save-session.sh: line 140: [: : integer expression expected
save-session.sh: line 142: [: : integer expression expected
save-session.sh: line 164: cd: /Users/<user>/.claude/plugins/cache/claude-plugins-official/.claude/remember: No such file or directory

Cascading Failures

  1. cd "$PIPELINE_DIR" fails on line 135, so the extract python command never runs
  2. EXCHANGE_COUNT and HUMAN_COUNT are never set (empty strings)
  3. Lines 140/142 fail with integer expression expected when comparing empty strings

Environment

  • Plugin version: 0.1.0
  • Platform: macOS (Darwin 25.3.0)
  • Installed via: Claude Code plugins (claude-plugins-official)

Suggested Fix

PROJECT_DIR should be resolved from the user's current working directory or passed as an argument, not derived from the script's filesystem location within the plugin cache.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions