UV Priority
Always prioritize uv over pip for any Python command in Claude Code.
When to Use
Use when:
- Any task involving Python (scripts, libs, projects, dbt)
- Installing dependencies
- Creating/maintaining virtual environments
- Running Python commands
- Running tests
Do not use when:
- Tasks without Python
Command Substitutions
Always use uv instead of pip:
uv pip install→uv addpython -m venv→uv venvpip install -r requirements.txt→uv pip install -r requirements.txtor migrate topyproject.tomlpython script.py→uv run script.pypytest→uv run pytestdbt run→uv run dbt runpython -m pytest→uv run pytestpip list→uv pip listpip freeze→uv pip freeze
Priority
uv is ALWAYS the first option for any Python package management or execution.
Fallback
If uv is not available on the system:
- Suggest installing
uvfirst:curl -LsSf https://astral.sh/uv/install.sh | sh(Linux/macOS) orpowershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"(Windows) - If installation is not possible, suggest using
pipas fallback - Ask for user confirmation before proceeding with
pip
Flexibility
This is a flexible skill - adapt to context and use good judgment. The priority is uv, but use appropriate alternatives when genuinely necessary (e.g., system constraints, specific CI environments where uv cannot be installed).
Notes
- Models often already use
uv; this skill reinforcesuvas the priority - No instructions about
pyproject.tomlstructure included - Assume project already has
pyproject.tomlconfigured oruvwill manage it - Mention pytest should be run with
uv run pytestwhen applicable