Description
The SessionStart and PostToolUse hooks both redirect stderr to .remember/logs/hook-errors.log:
bash "${CLAUDE_PLUGIN_ROOT}/scripts/session-start-hook.sh" 2>> "${CLAUDE_PROJECT_DIR:-.}/.remember/logs/hook-errors.log"
bash "${CLAUDE_PLUGIN_ROOT}/scripts/post-tool-hook.sh" 2>> "${CLAUDE_PROJECT_DIR:-.}/.remember/logs/hook-errors.log"
If the .remember/logs/ directory doesn't exist (e.g. in a fresh project that has never used the plugin), the >> redirect fails with:
/path/to/project/.remember/logs/hook-errors.log: No such file or directory
PostToolUse hook error
Expected behaviour
The hooks should work on first use in any project directory without requiring manual setup.
Suggested fix
Add a mkdir -p before (or inline with) the redirect:
mkdir -p "${CLAUDE_PROJECT_DIR:-.}/.remember/logs" && bash "${CLAUDE_PLUGIN_ROOT}/scripts/session-start-hook.sh" 2>> "${CLAUDE_PROJECT_DIR:-.}/.remember/logs/hook-errors.log"
Or handle directory creation in the plugin's install/activation step.
Environment
- Plugin version: 0.5.0
- Triggered on: first use in a project directory that had never previously used the plugin
Description
The
SessionStartandPostToolUsehooks both redirect stderr to.remember/logs/hook-errors.log:If the
.remember/logs/directory doesn't exist (e.g. in a fresh project that has never used the plugin), the>>redirect fails with:Expected behaviour
The hooks should work on first use in any project directory without requiring manual setup.
Suggested fix
Add a
mkdir -pbefore (or inline with) the redirect:Or handle directory creation in the plugin's install/activation step.
Environment