[BUG] --project-config-root makes plugin LSP servers run in the config root instead of the session cwd (desktop worktree sessions)

Status Closed — not planned
Reported on v2.1.286
Maintainer reply None cached
Activity 0 comments · opened Sep 30, 2026 · closed Sep 30, 2026

What's wrong

When a session is started with --project-config-root <dir>, plugin LSP servers run with their working directory (and CLAUDE_PROJECT_DIR) set to <dir>. The LSP initialize request still gives the session's own directory as the root. The server therefore runs in one project while analysing another.

The Claude desktop app has passed --project-config-root <main checkout> to worktree sessions since today's update. So every desktop worktree session now starts its LSP servers in the main checkout.

Why it matters

Servers resolve relative paths against their working directory. clojure-lsp hands clj-kondo an empty lint path in some configurations, and clj-kondo lints "" as the working directory. In the main checkout that is every worktree plus their build outputs. Three servers ran at about 85% CPU for hours and never answered a request. Worktree sessions started without the flag ran their servers in the worktree, and those servers answered.

Reproduction (Claude Code 2.1.286, macOS, clojure-lsp@claude-code-lsps plugin)

  1. Create two directories, main and wt, each a git repo with deps.edn ({:paths ["src"]}) and src/demo/core.clj containing a defn.
  2. In wt, run claude -p --project-config-root <path>/main --allowedTools LSP,Bash with this prompt: use the LSP tool (findReferences on the defn), then run lsof -a -p <clojure-lsp pid> -d cwd.
  3. The clojure-lsp process's cwd is <path>/main.
  4. Run the same in wt without --project-config-root. The cwd is <path>/wt.

Expected

Plugin LSP servers run in the session's working directory, the same directory sent as the LSP root. --project-config-root should only change where project config is read from.

_Written by Opus 5.5_

View original on GitHub ↗