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
post-tool-hook.sh and user-prompt-hook.sh consult REMEMBER_HOOK_CWD without ever setting, clearing or validating it #417
On a host that reuses one process environment across hook invocations, PostToolUse and UserPromptSubmit can resolve the project root from a REMEMBER_HOOK_CWD exported by a different session's SessionStart -- writing memory into the wrong project's store, with no diagnostic. Reachability is not established: whether any supported host reuses an environment that way is unknown, which is why this is filed rather than fixed.
Location
scripts/resolve-paths.sh:150 consults the variable:
Only two of the hooks that source it manage the variable -- scripts/session-start-hook.sh:136-140 and scripts/session-end-hook.sh:167-171, each extracting cwd from its own stdin payload, rejecting embedded newlines, then exporting. scripts/post-tool-hook.sh and scripts/user-prompt-hook.sh source resolve-paths.sh and set nothing: they inherit whatever the environment already holds.
Mechanism
resolve-paths.sh's precedence is CLAUDE_PROJECT_DIR, then REMEMBER_HOOK_CWD, then the local-install derivation. On Claude Code the first arm always wins, so the second is unreachable there. On a host that sets neither -- the case #411 exists for -- the second arm is load-bearing, and for PostToolUse/UserPromptSubmit its value came from outside that hook's own invocation. A per-invocation process (the normal case) inherits nothing and correctly falls through to the local-install derivation; a reused one inherits a value nobody re-validated for this session.
Same shape as #407's REMEMBER_TRANSCRIPT_PATH: a variable trusted by any caller that happens to have it set.
What would settle it
Either observing a host that reuses a hook process environment across invocations -- which makes this reachable and worth a fix, each hook clearing or re-deriving the variable itself -- or establishing that no supported host does, which makes it a comment on resolve-paths.sh:150 naming the assumption.
Found by the self-review on #411's lane (PR #414), out of that lane's scope.
Activity
Clear a leaked REMEMBER_TRANSCRIPT_PATH in post-tool/user-prompt hook…
fix: #417/#424 hook-leak security tests no longer skip the whole Wind…
fix: give user-prompt-hook.sh and post-tool-hook.sh the #411 stdin cw…
fix: pure-ASCII printed output across scripts/ and pipeline/, and a l…
test(#900): run the #417/#424 preamble from a file, not bash -c
test(#900): run the #417/#424 preamble from a file, not bash -c
test(#900): run the #417/#424 preamble from a file, not bash -c
test(#900): run the #417/#424 preamble from a file, not bash -c