astral-sh / astral-sh/claude-code-plugins

LSP not used in git worktrees

Open
#18 0 comments 2 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
309
Forks
13
PR merge metrics
No merged PRs in 30d

Description

I have installed the astral plugin and am using the claude vscode plugin.
If I open my project normally, the language server gets picked up fine, and it uses e.g. go to definition all the time.
It also says itself that it has access:

Image

If I open the same project in a git worktree, the language server does not get used anymore. The model only uses `grep` to search for stuff, and can't detect it.

Image

The server is actually running in the git worktree version, and there are some errors like this:
```
[Error - 2:50:21 PM] Request textDocument/documentSymbol failed.
Error: name must not be falsy
at Dp.validate (file:///private/var/folders/gc/1f1f66w90_xbhwl_b78g_lw40000gn/T/AppTranslocation/F28D3371-9020-4E5A-8C91-F40CEF50B99E/d/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:112:26946)
at new Dp (file:///private/var/folders/gc/1f1f66w90_xbhwl_b78g_lw40000gn/T/AppTranslocation/F28D3371-9020-4E5A-8C91-F40CEF50B99E/d/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:112:27235)
at V (/Users/veith/.vscode/extensions/astral-sh.ty-2026.18.0-darwin-arm64/dist/extension.js:1:257136)
at c (/Users/veith/.vscode/extensions/astral-sh.ty-2026.18.0-darwin-arm64/dist/extension.js:1:295557)
at t.map (/Users/veith/.vscode/extensions/astral-sh.ty-2026.18.0-darwin-arm64/dist/extension.js:1:295643)
at Object.asDocumentSymbols (/Users/veith/.vscode/extensions/astral-sh.ty-2026.18.0-darwin-arm64/dist/extension.js:1:265192)
at i (/Users/veith/.vscode/extensions/astral-sh.ty-2026.18.0-darwin-arm64/dist/extension.js:1:201478)
at async XM.provideDocumentSymbols (file:///private/var/folders/gc/1f1f66w90_xbhwl_b78g_lw40000gn/T/AppTranslocation/F28D3371-9020-4E5A-8C91-F40CEF50B99E/d/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:144:140349)
```

But it does not seem to even register in the first place.
Here is an analysis of claude itself of the issue, which seems like a reasonable assumption:
```
What's different between the two projects
Both have .vscode/settings.json — only the Peacock color differs (blue vs orange). Neither configures ty or any LSP settings. So VSCode plugin settings are fine.

Both have .claude/ directories with commands, skills, and settings.local.json. Neither has a project-level enabledPlugins override.

The astral@astral-sh plugin is enabled globally in ~/.claude/settings.json, which configures ty as an LSP server via uvx ty@latest server. This should apply to both workspaces equally.

Most likely root cause
The worktree's .git is a file, not a directory:

gitdir: /Users/veith/projects/ama-core/.git/worktrees/ai1
The Claude Code VSCode extension (or the Astral plugin's LSP integration) likely checks for the presence of a .git directory to identify a git project root and decide whether to start LSP servers. In a git worktree, .git is a plain file, which can cause this detection to fail.

This is a common issue with tools that don't fully support git worktrees.
```

I am not sure whether this issue is inside the astral plugin or the claude code plugin - I'll open an issue there as well and link it.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.