[BUG] VSCode plugin does not detect LSP in git worktree
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?
I have my project open in vscode. I am using the claude vscode plugin, not the terminal. I have the astral-sh plugin for claude active. It provides a LSP. It works fine if I open my project normally, claude can detect the LSP not problem and is using it all the time to follow code definitions.
<img width="690" height="415" alt="Image" src="https://github.com/user-attachments/assets/1963fcda-928a-4351-9100-c9aed11fca42" />
If I open the same project in a git worktree, the LSP is not detected, and claude falls back to using grep for searching through my codebase (which feels a lot less efficient).
It also says itself that it does not have a configured LSP:
<img width="610" height="446" alt="Image" src="https://github.com/user-attachments/assets/d15484e1-c117-4eae-a0fc-ce635765bad2" />
The language server is actually running, I can see it log stuff in the vscode outputs tab.
The following is an analysis of claude of the problem, I am not sure whether it is correct, but it seems somewhat plausible:
<img width="718" height="390" alt="Image" src="https://github.com/user-attachments/assets/3ffc271a-871e-410e-a08e-683f9565a064" />
I am not sure whether this is an issue in claude or the astral LSP, I've opened a related ticket there as well
What Should Happen?
Claude should use the LSP, no matter how I open the project.
Error Messages/Logs
Steps to Reproduce
- Install the astral-sh plugin and configure it for vscode (this disables pyright as LSP!)
- Open a python project normally
- Ask claude whether it has access to a LSP (or observe it not grepping to search)
- Open the same project as a git worktree
- Ask claude whether it has access to a LSP (or observe it grepping to search)
Claude Model
Sonnet (default)
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.69
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
VS Code integrated terminal
Additional Information
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗