Skip to content

fix(aiagents): write Windows hook command with forward-slash path#77

Merged
ashishkurmi merged 2 commits into
step-security:mainfrom
raysubham:fix/windows-hook-bash-path
May 15, 2026
Merged

fix(aiagents): write Windows hook command with forward-slash path#77
ashishkurmi merged 2 commits into
step-security:mainfrom
raysubham:fix/windows-hook-bash-path

Conversation

@raysubham
Copy link
Copy Markdown
Contributor

Claude Code and Codex execute hook commands through bash on Windows (Git Bash on windows-latest runners). Bash interprets backslashes in unquoted tokens as escape sequences, so the previously written path C:\Users\...\stepsecurity-dev-machine-guard.exe collapsed to C:Users...stepsecurity-dev-machine-guard.exe and failed to resolve.

Forward-slash the binary path on Windows in both adapters' commandFor so bash sees C:/Users/.../stepsecurity-dev-machine-guard.exe. The existing managedCmdRE uninstall matcher already accepts / as the separator, so uninstall continues to recognize installed entries.

What does this PR do?

Type of change

  • Bug fix
  • Enhancement
  • Documentation

Testing

  • Tested on macOS (version: ___)
  • Binary runs without errors: ./stepsecurity-dev-machine-guard --verbose
  • JSON output is valid: ./stepsecurity-dev-machine-guard --json | python3 -m json.tool
  • No secrets or credentials included
  • Lint passes: make lint
  • Tests pass: make test

Related Issues

Claude Code and Codex execute hook commands through bash on Windows
(Git Bash on windows-latest runners). Bash interprets backslashes in
unquoted tokens as escape sequences, so the previously written path
`C:\Users\...\stepsecurity-dev-machine-guard.exe` collapsed to
`C:Users...stepsecurity-dev-machine-guard.exe` and failed to resolve.

Forward-slash the binary path on Windows in both adapters' commandFor
so bash sees `C:/Users/.../stepsecurity-dev-machine-guard.exe`. The
existing managedCmdRE uninstall matcher already accepts `/` as the
separator, so uninstall continues to recognize installed entries.
@ashishkurmi ashishkurmi self-requested a review May 15, 2026 06:16
@ashishkurmi ashishkurmi merged commit f60b436 into step-security:main May 15, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants