gstack icon indicating copy to clipboard operation
gstack copied to clipboard

Windows: careful/guard only watch the Bash tool, and freeze's boundary check can't match C:/ paths

Open jtheyse opened this issue 1 month ago • 0 comments

Found while auditing gstack 1.91.6.0 (65bfb0c, 2026-09-28) on Windows 11 with Git Bash.

1. careful and guard only match the Bash tool

Claude Code on Windows also has a PowerShell tool. Destructive commands sent through it (Remove-Item -Recurse, rmdir /s, git push --force, Invoke-Sqlcmd ... DROP TABLE) are never checked, because the PreToolUse matcher in careful/SKILL.md and guard/SKILL.md is "Bash" only.

Suggested fix: matcher Bash|PowerShell, plus PowerShell/cmd patterns (Remove-Item -Recurse, rd /s, del /s, Format-Volume) in check-careful.sh.

2. freeze's boundary check likely never matches on Windows

freeze/bin/check-freeze.sh (~lines 125-131) treats any file_path not starting with / as relative and prefixes $(pwd). The Edit/Write tools pass C:/Users/... paths on Windows, while freeze-state.sh stores the boundary as /c/Users/... (from pwd -P), so the two can never be equal. NotebookEdit is also not in the matcher.

Suggested fix: normalise both paths with cygpath -u when it is available, add NotebookEdit to the matcher, and add a Windows test.

(Point 2 comes from reading the scripts, not from running the hook.)

jtheyse avatar Oct 07 '26 19:10 jtheyse