Windows bootstrap fix + TMPDIR portability + README prereqs#28
Closed
evikzub wants to merge 3 commits intoDigital-Process-Tools:mainfrom
Closed
Windows bootstrap fix + TMPDIR portability + README prereqs#28evikzub wants to merge 3 commits intoDigital-Process-Tools:mainfrom
evikzub wants to merge 3 commits intoDigital-Process-Tools:mainfrom
Conversation
The SessionStart and PostToolUse hook commands redirect stderr to
.remember/logs/hook-errors.log via bash's 2>> operator. Bash opens
the redirect target before running the command, so on the first
invocation in a fresh project the redirect fails ("No such file or
directory") and the hook script never runs. That same script would
have created the directory via mkdir -p in its own body — classic
chicken-and-egg.
Prefix both hook commands with mkdir -p of the parent directory so
the redirect target is guaranteed to exist. The && gate also keeps
the original behavior: if mkdir somehow fails, the hook script does
not run.
user-prompt-hook.sh read /tmp/claude-ctx-pct directly, which works
on macOS/Linux but is not portable. Windows Git Bash / MSYS2 users
may have /tmp mapped to a different path than the producer of the
file expects.
Switch to ${TMPDIR:-/tmp}/claude-ctx-pct so the path honors the
standard POSIX TMPDIR env var, falling back to /tmp when unset.
No behavior change on macOS/Linux with default TMPDIR.
The Requirements section listed Python, Claude CLI, and bash, but not jq — which session-start-hook.sh and log.sh call for config reading. Also, Windows support landed in v0.2.0 but the README did not describe the supported Windows setup paths (Git Bash / MSYS2 / WSL) or note that jq and python3 must be on PATH separately from Git for Windows. Add jq and coreutils to the requirements list and a short Windows subsection documenting the two supported POSIX environments.
2 tasks
Contributor
|
Closing — the three fixes in this PR have been addressed in #33:
Thank you @evikzub for the excellent Windows work! You were the first to surface the TMPDIR issue and document the Windows prerequisites clearly. Your contributions are credited in the commit messages. We also approved your PR #29 (Python detection + slug fix) separately — that one stands on its own and is ready to merge. Looking forward to more contributions! |
Bunshin-v2
pushed a commit
to Bunshin-v2/claude-remember
that referenced
this pull request
Apr 26, 2026
Hardcoded /tmp/ paths fail on Windows where /tmp doesn't exist but
$TMPDIR does (set by Git Bash/MSYS2). Centralize the fix:
- bootstrap-dirs.sh: export SYS_TMPDIR="${TMPDIR:-/tmp}" so every
script that sources bootstrap gets it for free
- user-prompt-hook.sh: use $SYS_TMPDIR for claude-ctx-pct file,
also source bootstrap-dirs.sh for consistent setup
- run-tests.sh: replace 7 hardcoded mktemp /tmp/ calls with $SYS_TMPDIR
- New test: guard against hardcoded /tmp/ in all production scripts
Inspired by evikzub's PR Digital-Process-Tools#28 (Windows bootstrap fix).
Co-Authored-By: Max <noreply>
Bunshin-v2
pushed a commit
to Bunshin-v2/claude-remember
that referenced
this pull request
Apr 26, 2026
Windows users need Git Bash/MSYS2 or WSL for bash scripts. Also documents jq and coreutils dependencies that were implicit. Based on evikzub's contribution in PR Digital-Process-Tools#28. Co-Authored-By: Max <noreply>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Three small fixes surfaced while installing the plugin on Windows (Git Bash / MSYS2). Each commit is independent — feel free to cherry-pick.
fix(hooks) — the
SessionStartandPostToolUsehook commands inhooks/hooks.jsonredirect stderr to.remember/logs/hook-errors.logvia2>>. Bash opens the redirect target before running the script, so on the first invocation in a fresh project (when the.remember/logs/directory does not yet exist) the redirect fails and the hook script never runs — even though the script itself containsmkdir -p .remember/logsnear the top. Classic chicken-and-egg. Prefix both commands withmkdir -p ... &&so the redirect target is guaranteed to exist.fix(user-prompt-hook) —
user-prompt-hook.shreads/tmp/claude-ctx-pct. Works on macOS/Linux, but on Windows Git Bash the/tmpmapping may differ from what other processes that write the file expect. Honor\$TMPDIRwith a/tmpfallback. No behavior change on default macOS/Linux.docs(readme) — the Requirements section listed Python / bash / Claude CLI but not
jq(whichlog.shandsession-start-hook.shrely on). Addjq+ coreutils, and a short Windows subsection documenting the supported POSIX environments (Git Bash/MSYS2, WSL) and the need to installjq/python3alongside Git for Windows.Reproduction
On a fresh project (Windows or Unix):
.remember/logs/hook-errors.log. Subsequent invocations succeed (the hook script's ownmkdir -peventually runs once something else creates the directory), but the first session's SessionStart memory injection is lost.Test plan
~/.claude/plugins/cache/claude-plugins-official/remember/0.5.0/on Windows 11 with Git Bash + MSYS2 + jq + Python 3.11. Warning disappears on new-project startup; memory pipeline runs normally.scripts/run-tests.sh— not run (Windows MSYS2 test env not set up by this contributor). Upstream test run would be appreciated.Not changed
nohupusage insession-start-hook.sh/post-tool-hook.sh— on Windows MSYS2 this doesn't truly detach, but fixing it properly likely requires a platform-specific backgrounding strategy. Out of scope for this PR.