typescript-lsp plugin reports diagnostics for files that no longer exist after branch switch

Resolved 💬 3 comments Opened Apr 14, 2026 by HendrikThePendric Closed Apr 18, 2026

Description

The typescript-lsp plugin (from claude-plugins-official) reports diagnostics for files that no longer exist on disk after switching git branches. This creates noisy diagnostic notifications (e.g., "Found 24 new diagnostic issues in 9 files") for non-existent files, and Claude wastes context commenting on them.

Steps to reproduce

  1. Install the typescript-lsp plugin
  2. Work on a branch that has certain TypeScript files (e.g., build-default.ts, project-to-current-vis-shape.ts)
  3. Switch to a different branch where those files don't exist
  4. Edit any TypeScript file

Expected behavior

Diagnostics should only be reported for files that exist on disk. The LSP should re-index or invalidate its cache when the workspace files change (e.g., after a git branch switch).

Actual behavior

The LSP continues reporting diagnostics (e.g., TS2307 "Cannot find module") for files from the previous branch that no longer exist. These show up as <new-diagnostics> after every edit, creating noise.

Environment

  • typescript-language-server v5.1.3 (globally installed)
  • Claude Code with typescript-lsp@claude-plugins-official enabled
  • macOS (Darwin 25.3.0)

Possible fix

The plugin could:

  • Clear diagnostics for files that no longer exist on disk before reporting
  • Re-index the workspace when it detects file tree changes (e.g., via workspace/didChangeWatchedFiles)
  • Invalidate cached diagnostics on branch switch

View original on GitHub ↗

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