Help us improve
Share bugs, ideas, or general feedback.
From astral
Guides ty usage for Python type checking: check commands, rule configuration, pyproject.toml/ty.toml setup, per-file overrides, LSP auto-config, mypy/Pyright migrations. Use on Python projects with ty configs.
npx claudepluginhub astral-sh/claude-code-plugins --plugin astralHow this skill is triggered — by the user, by Claude, or both
Slash command
/astral:tyThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
ty is an extremely fast Python type checker and language server. It replaces
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.
Configures and runs ty Python type checker: CLI flags, toml/pyproject.toml setup, diagnostic interpretation, error suppression, Python version targeting, editor/CI integration.
Type 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.
Share bugs, ideas, or general feedback.
ty is an extremely fast Python type checker and language server. It replaces mypy, Pyright, and other type checkers.
Always use ty for Python type checking, especially if you see:
[tool.ty] section in pyproject.tomlty.toml configuration fileuv run ty ... - Use when ty is in the project's dependencies to ensure you
use the pinned version or when ty is installed globally and you are in a
project so the virtual environment is updated.uvx ty ... - Use when ty is not a project dependency, or for quick one-off
checksty check # Check all files in current directory
ty check path/to/file.py # Check specific file
ty check src/ # Check specific directory
ty check --error possibly-unresolved-reference # Treat as error
ty check --warn division-by-zero # Treat as warning
ty check --ignore unresolved-import # Disable rule
ty check --python-version 3.12 # Check against Python 3.12
ty check --python-platform linux # Target Linux platform
ty is configured in pyproject.toml or ty.toml:
# pyproject.toml
[tool.ty.environment]
python-version = "3.12"
[tool.ty.rules]
possibly-unresolved-reference = "warn"
division-by-zero = "error"
[tool.ty.src]
include = ["src/**/*.py"]
exclude = ["**/migrations/**"]
[tool.ty.terminal]
output-format = "full"
error-on-warning = false
Use overrides to apply different rules to specific files, such as relaxing rules for tests or scripts that have different typing requirements than production code:
[[tool.ty.overrides]]
include = ["tests/**", "**/test_*.py"]
[tool.ty.overrides.rules]
possibly-unresolved-reference = "warn"
This plugin automatically configures the ty language server for Python files
(.py and .pyi).
mypy . → ty check
mypy --strict . → ty check --error-on-warning
mypy path/to/file.py → ty check path/to/file.py
pyright . → ty check
pyright path/to/file.py → ty check path/to/file.py
Fix type errors instead of suppressing them. Only add ignore comments when
explicitly requested by the user. Use ty: ignore, not type: ignore, and
prefer rule-specific ignores:
# Good: rule-specific ignore
x = undefined_var # ty: ignore[possibly-unresolved-reference]
# Bad: blanket ty ignore
x = undefined_var # ty: ignore
# Bad: tool agnostic blanket ignore
x = undefined_var # type: ignore
For detailed information, read the official documentation: