Commit 42003b4
docs(claude): document cross-worktree LSP bleed + workaround
During the session that landed #696 / #700 / #698, the pyright LSP daemon
repeatedly surfaced ``<new-diagnostics>`` reminders complaining about
fields and params that existed on a sub-agent's branch but not on this
worktree's branch — and vice versa. ``uv run pyright`` from the
worktree was clean throughout. Cost roughly an hour of context cycles
spent verifying that the warnings were phantom.
Root cause is well-documented upstream:
- pyright-lsp can't accept a per-call ``projectRoot``
(anthropics/claude-code#32230, closed as not planned)
- LSP plugins don't receive ``rootUri`` during init
(#27220)
- Subagents resolve to main repo root rather than their worktree
(#31546)
- Session worktrees go inside the repo root by default
(#49986)
All four upstream issues are closed without a fix path. The local
``pyrightconfig.json`` already excludes ``.claude/worktrees`` from
indexing — that prevents the LSP from reaching INTO sibling worktrees
but doesn't help when the daemon is rooted at the wrong worktree to
begin with.
Add a new entry under "Stale-LSP common triggers" in CLAUDE.md
explaining the symptom, the workaround (trust pyright CLI; don't try
to fix phantom diagnostics), and links to the upstream issues so the
next contributor doesn't waste cycles re-deriving the trail.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 8a1cd56 commit 42003b4
2 files changed
Lines changed: 30 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
254 | 254 | | |
255 | 255 | | |
256 | 256 | | |
| 257 | + | |
257 | 258 | | |
258 | 259 | | |
| 260 | + | |
259 | 261 | | |
260 | 262 | | |
261 | 263 | | |
262 | 264 | | |
| 265 | + | |
263 | 266 | | |
264 | 267 | | |
265 | 268 | | |
266 | 269 | | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
267 | 296 | | |
268 | 297 | | |
269 | 298 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments