You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
hooks.json: stderr redirect fails in fresh worktrees because .remember/logs/ does not exist yet #23
In hooks/hooks.json (v0.5.0), both the SessionStart and PostToolUse commands redirect stderr to ${CLAUDE_PROJECT_DIR:-.}/.remember/logs/hook-errors.logbefore the hook script runs. The shell opens the redirect target first, so if .remember/logs/ does not exist yet, /bin/sh emits:
/bin/sh: /path/to/project/.remember/logs/hook-errors.log: No such file or directory
on every hook invocation until something else creates the directory. The script own mkdir -p in scripts/log.sh runs too late — the redirect has already failed.
This reliably reproduces in every fresh git worktree: the worktree has no .remember/ tree yet, so the very first SessionStart and every PostToolUse spam the UI with PostToolUse:Bash hook error banners.
Reproduction
git worktree add ../myrepo-feature feature/x
Open Claude Code in ../myrepo-feature
Every tool call shows Failed with non-blocking status code: /bin/sh: .../.remember/logs/hook-errors.log: No such file or directory
Confirming this also reproduces outside of git worktree — any project directory without a pre-existing .remember/logs/ tree hits it on the first tool call, not just worktrees.
Repro (no worktree involved):
cd into a directory with no prior .remember/ (e.g. a fresh project root, or just ~/Desktop/Projects as a working dir)
+1 — reproduces identically on Windows 11 + Git Bash + Claude Code 2.1.116 in a fresh clone of the project (not a worktree). No .remember/ tree existed, so every PostToolUse tool call printed:
/usr/bin/bash: line 1: /d/projects/ren/.remember/logs/hook-errors.log: No such file or directory
Confirmed mkdir -p /d/projects/ren/.remember/logs immediately silences it. The proposed fix (prepending mkdir -p to the hook command in hooks/hooks.json) would resolve this cleanly on Windows too — nothing Windows-specific about the shell redirect behavior.
Confirming this bug on plugin 0.5.0 with a slightly different repro worth flagging: Claude Code auto-creates worktrees for skills and parallel-agent invocations, so end users hit this without ever running git worktree add themselves. Every time Claude Code spawns a new worktree (e.g., .claude/worktrees/<adjective>-<verb>-<noun>/), the first SessionStart and all subsequent PostToolUse hooks in that worktree emit the non-blocking error because .remember/logs/ doesn't exist yet there.
The suggested mkdir -p fix would also resolve this auto-worktree variant.
Env:
Claude Code on macOS (Darwin 25.4.0)
Plugin: remember@claude-plugins-official v0.5.0
Reproduces on every auto-generated worktree directory
Also hitting this — confirming on Claude Code 2.1.118 / macOS Darwin 25.2. A few extra data points and a standalone workaround for anyone landing here looking to silence it before the fix ships:
Also reproduces when .remember/ exists but .remember/logs/ was cleaned. Not just fresh worktrees — any time someone wipes the directory (e.g. rm -rf .remember) the next session starts spamming again until the inner script's mkdir -p runs.
Workaround without patching the plugin — user-level SessionStart hook in ~/.claude/settings.json that creates the directories before any plugin hook fires:
SessionStart always runs before the first tool call, so by the time any PostToolUse hook fires, the redirect target exists. Idempotent, fast, applies to every project/worktree without per-repo setup.
The in-hook mkdir -p && bash ... change proposed above is still the right fix — this only helps users who can't wait.
Reproduced on Claude Code 2.1.x, macOS (Darwin 25.4.0), plugin remember@claude-plugins-official v0.5.0.
Same signature (PostToolUse:Bash hook error Failed with non-blocking status code: /bin/sh: .../.remember/logs/hook-errors.log: No such file or directory) fires on every tool call in a fresh project directory until something else creates .remember/logs/. Confirms this is not worktree-specific — any new clone or greenfield folder reproduces it.
The one-line mkdir -p ... && bash ... prepend in hooks/hooks.json suggested above would fix it without behavior change for existing projects. Happy to open a PR if a maintainer wants one.
Fixed in #33 — bootstrap-dirs.sh now creates the .remember/logs/ directory before any stderr redirect. hooks.json no longer contains inline 2>> redirects.
Thank you @rmcarv for being the first to report this! Your detailed reproduction steps and root cause analysis (bash opens the 2>> target before the script runs) directly shaped the fix. With 20k installs, every fresh-project bug report helps us catch what our own testing missed.
Activity
Atreyu4EVR commentedon Apr 23, 2026
Confirming this also reproduces outside of
git worktree— any project directory without a pre-existing.remember/logs/tree hits it on the first tool call, not just worktrees.Repro (no worktree involved):
cdinto a directory with no prior.remember/(e.g. a fresh project root, or just~/Desktop/Projectsas a working dir)Bashtool call produces:Environment:
[email protected], Claude Code on Ubuntu 24.04 (arm64), no worktree.The proposed fix in the issue description (
mkdir -p ... && bash ...) resolves it cleanly.mcmanusj-reninc commentedon Apr 23, 2026
+1 — reproduces identically on Windows 11 + Git Bash + Claude Code 2.1.116 in a fresh clone of the project (not a worktree). No
.remember/tree existed, so everyPostToolUsetool call printed:Confirmed
mkdir -p /d/projects/ren/.remember/logsimmediately silences it. The proposed fix (prependingmkdir -pto the hook command inhooks/hooks.json) would resolve this cleanly on Windows too — nothing Windows-specific about the shell redirect behavior.clearly commentedon Apr 23, 2026
Confirming this bug on plugin 0.5.0 with a slightly different repro worth flagging: Claude Code auto-creates worktrees for skills and parallel-agent invocations, so end users hit this without ever running
git worktree addthemselves. Every time Claude Code spawns a new worktree (e.g.,.claude/worktrees/<adjective>-<verb>-<noun>/), the firstSessionStartand all subsequentPostToolUsehooks in that worktree emit the non-blocking error because.remember/logs/doesn't exist yet there.The suggested
mkdir -pfix would also resolve this auto-worktree variant.Env:
leo-artuai commentedon Apr 23, 2026
Also hitting this — confirming on Claude Code 2.1.118 / macOS Darwin 25.2. A few extra data points and a standalone workaround for anyone landing here looking to silence it before the fix ships:
Also reproduces when
.remember/exists but.remember/logs/was cleaned. Not just fresh worktrees — any time someone wipes the directory (e.g.rm -rf .remember) the next session starts spamming again until the inner script'smkdir -pruns.Workaround without patching the plugin — user-level
SessionStarthook in~/.claude/settings.jsonthat creates the directories before any plugin hook fires:SessionStart always runs before the first tool call, so by the time any
PostToolUsehook fires, the redirect target exists. Idempotent, fast, applies to every project/worktree without per-repo setup.The in-hook
mkdir -p && bash ...change proposed above is still the right fix — this only helps users who can't wait.gfreschi commentedon Apr 24, 2026
Reproduced on Claude Code 2.1.x, macOS (Darwin 25.4.0), plugin
remember@claude-plugins-officialv0.5.0.Same signature (
PostToolUse:Bash hook error Failed with non-blocking status code: /bin/sh: .../.remember/logs/hook-errors.log: No such file or directory) fires on every tool call in a fresh project directory until something else creates.remember/logs/. Confirms this is not worktree-specific — any new clone or greenfield folder reproduces it.The one-line
mkdir -p ... && bash ...prepend inhooks/hooks.jsonsuggested above would fix it without behavior change for existing projects. Happy to open a PR if a maintainer wants one.fix: centralize .remember/ bootstrap + portability fixes (#23, #27, #31…
fdaviddpt commentedon Apr 25, 2026
Fixed in #33 —
bootstrap-dirs.shnow creates the.remember/logs/directory before any stderr redirect. hooks.json no longer contains inline2>>redirects.Thank you @rmcarv for being the first to report this! Your detailed reproduction steps and root cause analysis (bash opens the 2>> target before the script runs) directly shaped the fix. With 20k installs, every fresh-project bug report helps us catch what our own testing missed.
fix: centralize .remember/ directory bootstrap, remove hooks.json 2>>…