LSP: hint-severity (tagged unnecessary) diagnostics are pushed into model context as new-diagnostics — token waste, no way to filter
Summary
Edit: an earlier version of this issue claimedpyright.disableTaggedHintsis a client-only (VS Code extension) setting. That was wrong — I had grepped the thinpyright-langserver.jsloader instead of thepyright-internalbundle. The setting is implemented server-side (it filters tagged diagnostics out ofpublishDiagnosticsand is re-read onworkspace/didChangeConfiguration). The remaining gap is that Claude Code exposes no configuration surface to set it; issue retargeted accordingly.
With an LSP plugin enabled (official pyright-lsp), every Edit/Write of a Python file pushes hint-severity diagnostics into the model context as <new-diagnostics> system reminders. Pyright emits hints for intentionally-unused parameters (the standard underscore convention in test stubs), so ordinary test-driven work produces a steady drip of ★-marked lines like:
⎿ ★ [Line 161:19] "_a" is not accessed (Pyright)
⎿ ★ [Line 161:25] "_kw" is not accessed (Pyright)
⎿ ★ [Line 286:41] "_p" is not accessed (Pyright)
⎿ ★ [Line 593:44] "capsys" is not accessed (Pyright)
⎿ ★ [Line 954:31] "_kwargs" is not accessed (Pyright)
⎿ ★ [Line 1010:18] "_prompt" is not accessed (Pyright)
These are pushed as part of the conversation context, so every one of them is paid for on every subsequent turn — pure token waste with no actionable content for the model.
Why this is noise, not signal
- Running the same files through the pyright CLI (
pyright file.py, defaults) reports 0 errors, 0 warnings, 0 informations — these unused-parameter findings don't even exist in CLI output. They are a language-server-only hint layer. - In VS Code the same diagnostics render as faded text (tag
Unnecessary), not as problems. They are editor affordances, not defects. - The underscore convention (
lambda _items, **_kw: "0"to stubselect_from_menu) is standard Python style for "intentionally unused", and the hint layer flags those names anyway.
Why there is no durable workaround today
- The server-side fix exists:
pyright.disableTaggedHints: true(in thepyrightsettings section, honored viainitializationOptions/didChangeConfiguration). If it could be set, pyright would simply stop publishing the tagged hints. - But Claude Code provides no way to set it: the
settings/initializationOptionsfields oflspServers.*can only be declared in the plugin's manifest / marketplace entry — there is no user-level LSP key insettings.json(settings docs expose none; in the 2.1.278 binarylspServersappears only as plugin-manifest schema and plumbing). Hand-editing the marketplace snapshot (~/.claude/plugins/marketplaces/claude-plugins-official/.claude-plugin/marketplace.json) works until the marketplace refreshes and overwrites the edit. - The plugin manifest's
lspServers.*.diagnosticsoption is all-or-nothing (true/false): turning it off also silences real errors and warnings.
Requested fix
Any one of these would solve it:
- A user-level way to configure LSP server settings for enabled plugins — e.g. a
settings.jsonkey that merges into / overrides a plugin'slspServers.*config (settings/initializationOptions), sopyright.disableTaggedHints: truecan be set durably. - Default change (preferred where applicable): don't push hint-severity diagnostics into context — push
error/warning/informationonly. Hints exist for human editors. - Extend the plugin manifest's
lspServers.*.diagnosticsbeyond a boolean (e.g.diagnostics: { minSeverity: "warning", taggedHints: false }).
(Also worth considering on the content side: an upstream PR to anthropics/claude-plugins-official adding settings: { pyright: { disableTaggedHints: true } } to the pyright-lsp entry would fix this plugin for everyone.)
Environment
- Claude Code 2.1.278 (native install), macOS (Darwin 25.6.0)
- Plugin:
pyright-lsp@claude-plugins-official1.0.0 - Language server: pyright 1.1.410 (npm global)
Reproduction: enable pyright-lsp, open a session in any Python repo, write/edit a file containing a test stub such as monkeypatch.setattr("mod.fn", lambda _items, **_kw: "0") — observe the ★ hint lines arrive in context as <new-diagnostics>.
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗