LSP plugins can't spawn npm-installed binaries on Windows (POSIX shell shims)

Resolved 💬 3 comments Opened Feb 21, 2026 by SSyl Closed Feb 24, 2026

Problem

When an LSP plugin's .lsp.json specifies a command that was installed via npm install -g (e.g., intelephense), Claude Code fails to launch the language server on Windows.

The root cause: npm global installs on Windows create three files per binary:

  • intelephense - a POSIX shell script (#!/bin/sh)
  • intelephense.cmd - a Windows batch wrapper
  • intelephense.ps1 - a PowerShell wrapper

Claude Code appears to resolve and spawn the POSIX shell script, which doesn't execute natively on Windows. The .cmd or .ps1 wrapper would work, but Claude Code doesn't try those.

This is related to #27220 (LSP plugins not receiving workspace root) - both are LSP plugin infrastructure issues. See also anthropics/claude-plugins-official#444 (php-lsp stub) and anthropics/claude-plugins-official#441 (lua-lsp stub).

Observed behavior

  1. .lsp.json specifies "command": "intelephense" with "args": ["--stdio"]
  2. intelephense is installed globally via npm and is in PATH
  3. Claude Code resolves it to the POSIX shell script shim
  4. The language server never starts, no diagnostics are produced

Expected behavior

Claude Code should either:

  1. Prefer .cmd extensions when resolving commands on Windows, or
  2. Use cmd /c or process.spawn with shell: true to let Windows resolve the correct wrapper, or
  3. Detect POSIX shims and invoke node with the target .js file directly

Workaround

In the plugin's .lsp.json, use intelephense.cmd instead of intelephense:

{
  "php": {
    "command": "intelephense.cmd",
    "args": ["--stdio"],
    "extensionToLanguage": {
      ".php": "php"
    }
  }
}

This works because the .cmd wrapper executes natively on Windows. A replacement plugin with this fix: https://github.com/SSyl/claude-win-lsps

Note: this affects any npm-installed LSP server, not just Intelephense. Any .lsp.json pointing at an npm binary will hit this on Windows.

Environment

  • Windows 11
  • Claude Code (latest)
  • Node.js via nvm4w
  • Intelephense 1.13.1 (npm global)

View original on GitHub ↗

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