/python-lsp:lsp-tracefrom python-lsp
Diagnose the python-lsp plugin when basedpyright resolves imports against the wrong interpreter or virtual environment, or when Python diagnostics differ between machines or platforms. Covers capturing a wire trace from the lsp_mux proxy and reading which interpreter basedpyright chose.
Ships in python-lsp. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
The plugin registers one language server, lsp_mux.py, which runs basedpyright and ruff as child processes and presents them to Claude Code as a single server. Interpreter selection happens inside basedpyright, so finding out why it picked the wrong venv means capturing what Claude Code sent and what basedpyright logged back.
The mux reads two environment variables, which it inherits from the shell that launches claude:
LSP_MUX_LOG — file path; the mux appends its own log lines and the child servers' stderr there.LSP_MUX_DEBUG — 1 traces routing; 2 also dumps every wire message, truncated per message.Level 2 is required, because basedpyright reports its environment through window/logMessage notifications, which only appear in the wire dump.
basedpyright's default log level hides the interpreter report. Set basedpyright.analysis.logLevel to Trace in the settings block of .lsp.json for the traced session, and remove it afterward.
Set the variables with the syntax of the shell in use: export in bash, $env: in PowerShell, set in cmd. Then start claude from that shell and open a Python file so the server starts.
rootUri and workspaceFolders are the root basedpyright uses as its project root.python means it found no venv and fell back to whatever python is on its PATH, which is the uvx tool environment basedpyright itself runs in.site-packages directory listed there should belong to the project's venv.In order of precedence:
python.pythonPath from settings, or pythonPath from a config file.venvPath joined with venv. venvPath may come from settings or a config file, but venv is read only from a config file (pyproject.toml or pyrightconfig.json); python.venv in language-server settings is ignored..venv in the project root, checked only when none of pythonPath, venvPath, or venv is set. The interpreter looked for is .venv/bin/python on POSIX and .venv\Scripts\python.exe on Windows.python on PATH.Consequences for this plugin:
${...} variables inside settings. basedpyright drops any path setting that still contains ${ after its own expansion, which only knows ${workspaceFolder} and a few ${env:...} names.venvPath that resolves to an existing path, set without a config-file venv, switches off step 3 and leaves basedpyright on step 4.initialize, or the directory of a pyproject.toml or pyrightconfig.json found there. A workspace root that is a parent of the project, such as a monorepo root, misses a .venv that sits in a subproject.What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub estasney/myclaudecode --plugin python-lsp