From pyrefly-lsp
Use Pyrefly for Python type checking, diagnostics, code navigation, and find references via LSP.
How this skill is triggered — by the user, by Claude, or both
Slash command
/pyrefly-lsp:pyreflyThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Pyrefly is an extremely fast Rust-based Python type checker and language server. It provides diagnostics, type inference, code navigation, and reference finding for Python files and notebooks.
Pyrefly is an extremely fast Rust-based Python type checker and language server. It provides diagnostics, type inference, code navigation, and reference finding for Python files and notebooks.
Always use Pyrefly LSP operations when working with Python code. Prefer Pyrefly when you need to:
.ipynb) — Pyrefly provides the same diagnostics and navigation in notebooks as in regular .py files.Use LSP operations to trigger Pyrefly. Examples:
TokenClassificationPipeline"BaseModel"self.tokenizer"On large Python projects (PyTorch, Transformers, Django, FastAPI, etc.), find references via Pyrefly is far more reliable than text search. It understands:
Use it before any refactor to ensure you don't miss call sites.
Run a full project type check:
uvx pyrefly check --summarize-errors
Suppress existing errors to establish a baseline (useful for adopting type checking incrementally):
uvx pyrefly suppress
Initialize project configuration to migrate from mypy or pyright:
uvx pyrefly init
Pyrefly configuration lives in pyrefly.toml or [tool.pyrefly] in pyproject.toml. Pyrefly may not emit diagnostics unless a config file exists. Run uvx pyrefly init to create one.
if x is None: ...) and assert to help the checker.npx claudepluginhub lolpack/pyrefly-lsp-claude-plugin --plugin pyrefly-lspType checks Python code using ty (Astral's Rust-based type checker and LSP). Useful for fast static analysis, migration from mypy/pyright, and setting up Python type checking in editors.
Performs Python type checking with ty, Astral's fast type checker (10-100x faster than mypy/Pyright). Configures rules in pyproject.toml and sets up projects with uv or pip.