Confirmed workaround for Windows (no reinstall needed)

Resolved 💬 3 comments Opened Feb 25, 2026 by 12TribesofIsrael Closed Feb 25, 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?

Confirmed workaround for Windows (no reinstall needed):

The root cause is that extension.js calls Module.createRequire() with a hardcoded Linux CI build path:
file:///home/runner/work/claude-cli-internal/claude-cli-internal/build-agent-sdk/sdk.mjs
This path is invalid on Windows, causing the extension to crash on activation before any commands are registered.

Fix: Run this in a terminal to patch the file in-place (creates a backup first):

python3 -c "
import shutil
path = r'C:/Users/<YOUR_USERNAME>/.vscode/extensions/anthropic.claude-code-2.1.55-win32-x64/extension.js'
backup = path + '.bak'
shutil.copy2(path, backup)
with open(path, 'r', encoding='utf-8', errors='replace') as f:
content = f.read()
old = 'file:///home/runner/work/claude-cli-internal/claude-cli-internal/build-agent-sdk/sdk.mjs'
new = 'file:///c:/Users/<YOUR_USERNAME>/.vscode/extensions/anthropic.claude-code-2.1.55-win32-x64/extension.js'
with open(path, 'w', encoding='utf-8') as f:
f.write(content.replace(old, new))
print('Done - restart VS Code')
"

Replace <YOUR_USERNAME> with your Windows username. Then fully restart VS Code.

What Should Happen?

Confirmed workaround for Windows (no reinstall needed):

Error Messages/Logs

Confirmed workaround for Windows (no reinstall needed):

Steps to Reproduce

Confirmed workaround for Windows (no reinstall needed):

The root cause is that extension.js calls Module.createRequire() with a hardcoded Linux CI build path:
file:///home/runner/work/claude-cli-internal/claude-cli-internal/build-agent-sdk/sdk.mjs
This path is invalid on Windows, causing the extension to crash on activation before any commands are registered.

Fix: Run this in a terminal to patch the file in-place (creates a backup first):

python3 -c "
import shutil
path = r'C:/Users/<YOUR_USERNAME>/.vscode/extensions/anthropic.claude-code-2.1.55-win32-x64/extension.js'
backup = path + '.bak'
shutil.copy2(path, backup)
with open(path, 'r', encoding='utf-8', errors='replace') as f:
content = f.read()
old = 'file:///home/runner/work/claude-cli-internal/claude-cli-internal/build-agent-sdk/sdk.mjs'
new = 'file:///c:/Users/<YOUR_USERNAME>/.vscode/extensions/anthropic.claude-code-2.1.55-win32-x64/extension.js'
with open(path, 'w', encoding='utf-8') as f:
f.write(content.replace(old, new))
print('Done - restart VS Code')
"

Replace <YOUR_USERNAME> with your Windows username. Then fully restart VS Code.

Claude Model

None

Is this a regression?

Yes, this worked in a previous version

Last Working Version

_No response_

Claude Code Version

Claude Code v2.1.55

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

Confirmed workaround for Windows (no reinstall needed):

The root cause is that extension.js calls Module.createRequire() with a hardcoded Linux CI build path:
file:///home/runner/work/claude-cli-internal/claude-cli-internal/build-agent-sdk/sdk.mjs
This path is invalid on Windows, causing the extension to crash on activation before any commands are registered.

Fix: Run this in a terminal to patch the file in-place (creates a backup first):

python3 -c "
import shutil
path = r'C:/Users/<YOUR_USERNAME>/.vscode/extensions/anthropic.claude-code-2.1.55-win32-x64/extension.js'
backup = path + '.bak'
shutil.copy2(path, backup)
with open(path, 'r', encoding='utf-8', errors='replace') as f:
content = f.read()
old = 'file:///home/runner/work/claude-cli-internal/claude-cli-internal/build-agent-sdk/sdk.mjs'
new = 'file:///c:/Users/<YOUR_USERNAME>/.vscode/extensions/anthropic.claude-code-2.1.55-win32-x64/extension.js'
with open(path, 'w', encoding='utf-8') as f:
f.write(content.replace(old, new))
print('Done - restart VS Code')
"

Replace <YOUR_USERNAME> with your Windows username. Then fully restart VS Code.

View original on GitHub ↗

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