Skip to content

Instantly share code, notes, and snippets.

@dg
Created April 6, 2026 11:53
Show Gist options
  • Select an option

  • Save dg/ea44243f8396315cdfb9064a27f60497 to your computer and use it in GitHub Desktop.

Select an option

Save dg/ea44243f8396315cdfb9064a27f60497 to your computer and use it in GitHub Desktop.
Workaround for Claude Code LSP plugins failing on Windows (without WSL)

Claude Code: LSP Plugins Fix for Windows (without WSL)

The Problem

On Windows (without WSL), Claude Code's built-in LSP plugins fail to start because they invoke commands like intelephense or typescript-language-server directly -- but on Windows, globally installed npm packages require the .cmd extension (e.g., intelephense.cmd).

Claude Code stores plugin definitions in:

%USERPROFILE%\.claude\plugins\marketplaces\claude-plugins-official\.claude-plugin\marketplace.json

You could manually fix the command fields, but Claude Code re-downloads and overwrites this file on every launch, so the fix doesn't stick.

The Workaround

A PHP script (claude-lsp-fix.php) patches marketplace.json right before Claude Code starts. It appends .cmd to every command value that doesn't already have it.

A batch launcher (claude.bat) runs the fix and then starts Claude Code. Place both files in the same directory and use claude.bat instead of launching claude.exe directly.

Notes

  • This is a hack -- Claude Code re-syncs plugins frequently, so the patch must run every time before launch.
  • Adjust the $path variable in claude-lsp-fix.php if your Windows username differs.
  • Tested with globally installed intelephense and typescript-language-server via npm.
  • If Anthropic adds native .cmd resolution for Windows, this workaround becomes unnecessary.
<?php
// Path to Claude Code's official plugin marketplace definition
$path = 'C:\Users\David\.claude\plugins\marketplaces\claude-plugins-official\.claude-plugin\marketplace.json';
$data = json_decode(file_get_contents($path), true);
// Append .cmd to all "command" values (npm global packages need it on Windows)
array_walk_recursive($data, function (&$value, $key) {
if ($key === 'command' && !str_ends_with($value, '.cmd')) {
$value .= '.cmd';
}
});
file_put_contents(
$path,
json_encode($data, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES),
);
@echo off
rem Fix LSP commands before Claude overwrites them back on next update check
@call php claude-lsp-fix.php
rem Launch Claude Code in Windows Terminal with a custom tab title
wt --title "Claude Code" C:\Users\David\.local\bin\claude.exe %*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment