basedpyright-type-checking — Claude Code skill: how to install
Sets up strict Python type checking using basedpyright, compares it against mypy, and guides configuration in pyproject.toml.
npx skills add laurigates/claude-plugins --skill basedpyright-type-checking -a claude-codeWhat basedpyright-type-checking does
This skill teaches your agent how to set up basedpyright, a fast Pyright fork designed around strict default typing rules. It covers generating [tool.basedpyright] configurations in pyproject.toml, switching modes from basic to strict, and suppressing errors with # basedpyright: ignore.
The guidance includes CLI commands for uv and pipx, background execution with --watch, and JSON diagnostic outputs. It also breaks down differences between basedpyright, standard Pyright, and mypy.
Formatting and linting should stay in Ruff rather than the type checker. Because basedpyright has limited plugin support, codebases dependent on tools like pydantic-mypy cannot migrate cleanly.
What it helps with
- configure strict type checking in pyproject.toml
- evaluate trade-offs between basedpyright and mypy
- adopt progressive type checking from basic to strict mode
- suppress specific type errors using inline comments
Example prompts for the agent
- Configure basedpyright for our Python 3.12 project in strict mode
- Compare mypy and basedpyright trade-offs for this repository
- Run basedpyright with uv in watch mode targeting the src directory
How to install basedpyright-type-checking
1Skills CLI (Vercel)
npx skills add laurigates/claude-plugins --skill basedpyright-type-checking -a claude-code2Manually: put the files in place
~/.claude/skills/basedpyright-type-checking/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/basedpyright-type-checking/
1Skills CLI (Vercel)
npx skills add laurigates/claude-plugins --skill basedpyright-type-checking -a codex2Manually: put the files in place
.agents/skills/basedpyright-type-checking/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add laurigates/claude-plugins --skill basedpyright-type-checking -a cursor2Manually: put the files in place
.cursor/skills/basedpyright-type-checking/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install laurigates/claude-plugins basedpyright-type-checking2Manually: put the files in place
.github/skills/basedpyright-type-checking/SKILL.md1Skills CLI (Vercel)
npx skills add laurigates/claude-plugins --skill basedpyright-type-checking -a gemini-cli2Platform CLI
gemini skills install https://github.com/laurigates/claude-plugins --path python-plugin/skills/basedpyright-type-checkingManually: put the files in place
.devin/skills/basedpyright-type-checking/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add laurigates/claude-plugins --skill basedpyright-type-checking -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about basedpyright-type-checking
How to install basedpyright-type-checking in Claude Code?
Run npx skills add laurigates/claude-plugins --skill basedpyright-type-checking -a claude-code. The file will be placed in ~/.claude/skills/basedpyright-type-checking/SKILL.md.
What does basedpyright-type-checking do?
It guides coding agents through setting up basedpyright, configuring strict safety flags, and integrating the checker into project workflows.
How does basedpyright differ from mypy?
Basedpyright offers faster performance and stricter defaults, whereas mypy provides a much larger third-party plugin ecosystem.
Source text
SKILL.md · MIT
---
created: 2025-12-16
modified: 2026-05-09
reviewed: 2025-12-16
name: basedpyright-type-checking
description: Basedpyright static type checker for Python. Use when setting up type checking, configuring LSP, or comparing type checkers (basedpyright, pyright, mypy alternative).
user-invocable: false
allowed-tools: Bash, Read, Grep, Glob
---
# Basedpyright Type Checking
Basedpyright is a fork of Pyright with additional features and stricter defaults, designed for maximum type safety and performance.
## When to Use This Skill
| Use this skill when... | Use another tool instead when... |
|------------------------|----------------------------------|
| Setting up type checking for Python | Formatting code (use ruff format) |
| Configuring strict type validation | Linting for style issues (use ruff check) |
| Comparing type checkers (basedpyright vs mypy) | Detecting unused code (use vulture/deadcode) |
| Setting up LSP for type-aware editor support | Running tests (use pytest) |
## Installation
### Via uv (Recommended)
```bash
# Install globally
uv tool install basedpyright
# Install as dev dependency
uv add --dev basedpyright
# Run with uv
uv run basedpyright
```
### Via pipx
```bash
pipx install basedpyright
```
## Basic Usage
```bash
# Check entire project
basedpyright
# Check specific files/directories
basedpyright src/ tests/
# Watch mode for development
basedpyright --watch
# Output JSON for tooling integration
basedpyright --outputjson
# Verbose diagnostics
basedpyright --verbose
```
## Configuration
### Minimal Strict Configuration (pyproject.toml)
```toml
[tool.basedpyright]
typeCheckingMode = "strict"
pythonVersion = "3.12"
include = ["src"]
exclude = ["**/__pycache__", "**/.venv"]
# Basedpyright-specific strict rules
reportUnusedCallResult = "error"
reportImplicitStringConcatenation = "error"
reportMissingSuperCall = "error"
reportUninitializedInstanceVariable = "error"
```
## Type Checking Modes
| Mode | Description | Use Case |
|------|-------------|----------|
| `off` | No type checking | Legacy code, migration start |
| `basic` | Basic type checking | Gradual typing adoption |
| `standard` | Standard strictness | Most projects (default Pyright) |
| `strict` | Strict type checking | Type-safe codebases |
| `all` | Maximum strictness | High-assurance systems |
### Progressive Type Checking
```toml
# Start with basic mode
[tool.basedpyright]
typeCheckingMode = "basic"
include = ["src/new_module"] # Type check new code only
# Gradually expand
include = ["src/new_module", "src/api"]
# Eventually enable strict mode
typeCheckingMode = "strict"
include = ["src"]
```
## Choosing a Type Checker
| Factor | Basedpyright | Pyright | mypy |
|--------|-------------|---------|------|
| **Speed** | Fastest | Fastest | Slower |
| **Strictness** | Strictest defaults | Configurable | Configurable |
| **LSP Support** | Built-in | Built-in | Via dmypy |
| **Plugin System** | Limited | Limited | Extensive |
**Choose Basedpyright** for maximum type safety with stricter defaults and fastest speed.
**Choose Pyright** for Microsoft's official support and VS Code Pylance compatibility.
**Choose mypy** for extensive plugin ecosystem (django-stubs, pydantic-mypy).
## Inline Error Suppression
```python
# Inline type ignore
result = unsafe_operation() # type: ignore[reportUnknownVariableType]
# Function-level ignore
def legacy_function(): # basedpyright: ignore
pass
```
## Agentic Optimizations
| Context | Command |
|---------|---------|
| Quick check | `basedpyright` |
| JSON output | `basedpyright --outputjson` |
| Watch mode | `basedpyright --watch` |
| CI check | `uv run basedpyright` |
| Verbose | `basedpyright --verbose` |
## Quick Reference
| Flag | Description |
|------|-------------|
| `--watch` | Watch mode for development |
| `--outputjson` | JSON output for tooling |
| `--verbose` | Verbose diagnostics |
| `--pythonversion X.Y` | Override Python version |
| `--level <mode>` | Override type checking mode |
For detailed configuration options, LSP integration, migration guides, CI setup, and best practices, see [REFERENCE.md](REFERENCE.md).
© laurigates · MIT · laurigates/claude-plugins