[BUG]: VS Code Extension: Windows-styled paths in command in hooks
Status Fixed / completed
Reported on v2.1.59
Maintainer reply None cached
Activity 4 comments · opened Feb 26, 2026 · closed Feb 27, 2026
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
Hooks with commands, that uses a windows-style path to a executable, is unable to run in the VS Code Extension. They do work in the CLI.
Its probably similar to https://github.com/anthropics/claude-code/issues/25711, but slightly different.
Example of a generated PostToolUse hook from Git AI:
"hooks": [
{
"command": "C:\\Users\\marti\\.git-ai\\bin\\git-ai.exe checkpoint claude --hook-input stdin"
"type": "command"
}
],
Changing to this, made it work in the Extension, but not in the CLI:
"command": "/c/Users/marti/.git-ai/bin/git-ai.exe checkpoint claude --hook-input stdin"
What Should Happen?
Both VS Code Extension and CLI should be able to handle either windows or linux based paths in hook commands on Windows.
Error Messages/Logs
2026-02-26 11:40:33.194 [info] From claude: 2026-02-26T10:40:33.194Z [DEBUG] Getting matching hook commands for PreToolUse with query: Write
2026-02-26T10:40:37.156Z [DEBUG] Getting matching hook commands for PostToolUse with query: Write
2026-02-26T10:40:37.267Z [DEBUG] "Hook PostToolUse:Write (PostToolUse) error:\nbash: C:Usersmarti.git-aibinverify-hook.sh: No such file or directory\n"
Steps to Reproduce
Add a Claude Hook command, that calls a executable with a absolute, windows-style path.
When hook is triggered, the command fails.
Claude Model
None
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
Extension: 2.1.59, CLI 2.1.6
Platform
AWS Bedrock
Operating System
Windows
Terminal/Shell
Other
Additional Information
_No response_
4 Comments
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
The duplicates is definitively related, but I believe this is specifically a bug in the VS Code Extension, and its path resolving. So I'd say, not duplicates 👎
After updating git-ai to 1.1.6, updating Claude Code to 2.1.62, and Claude Code for VS Code to 2.1.61, hooks seems to work as expected.
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.