[BUG]: VS Code Extension: Windows-styled paths in command in hooks

Resolved 💬 4 comments Opened Feb 26, 2026 by martinsafsten-codescene 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_

View original on GitHub ↗

This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗