Summary
The SessionStart and PostToolUse hook commands in hooks/hooks.json redirect stderr to ${CLAUDE_PROJECT_DIR:-.}/.remember/logs/hook-errors.log using 2>>. On the first session in a fresh checkout (or any time .remember/ has been cleaned up), that path does not exist yet — the script that creates it (session-start-hook.sh, lines 57–59) hasn't run. The shell opens redirection before invoking the command, so it fails with:
/bin/sh: <project>/.remember/logs/hook-errors.log: No such file or directory
Claude Code surfaces this as a hook_non_blocking_error on SessionStart:startup and every PostToolUse firing until the directory finally exists. The inner script still runs and eventually creates the directory, so it's cosmetic — but it spams the user with repeated hook errors on first use.
Repro
- Fresh project dir with no
.remember/.
- Open Claude Code session in that dir with the plugin enabled.
- Observe
hook_non_blocking_error entries in the transcript for SessionStart:startup, PostToolUse:Read, PostToolUse:Bash, etc.
Suggested fix
Pre-create the log dir in the hook command itself so the redirect target is guaranteed to exist before `2>>` evaluates, e.g.:
```
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"
```
Same treatment on the PostToolUse entry.
Env
- Claude Code 2.1.118
- macOS (Darwin 25.4.0), zsh/bash
- Plugin: remember@claude-plugins-official v0.5.0
Summary
The SessionStart and PostToolUse hook commands in
hooks/hooks.jsonredirect stderr to${CLAUDE_PROJECT_DIR:-.}/.remember/logs/hook-errors.logusing2>>. On the first session in a fresh checkout (or any time.remember/has been cleaned up), that path does not exist yet — the script that creates it (session-start-hook.sh, lines 57–59) hasn't run. The shell opens redirection before invoking the command, so it fails with:Claude Code surfaces this as a
hook_non_blocking_erroronSessionStart:startupand everyPostToolUsefiring until the directory finally exists. The inner script still runs and eventually creates the directory, so it's cosmetic — but it spams the user with repeated hook errors on first use.Repro
.remember/.hook_non_blocking_errorentries in the transcript forSessionStart:startup,PostToolUse:Read,PostToolUse:Bash, etc.Suggested fix
Pre-create the log dir in the hook command itself so the redirect target is guaranteed to exist before `2>>` evaluates, e.g.:
```
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"
```
Same treatment on the PostToolUse entry.
Env