python-uv

python-uv is a skill for Claude Code from w2ur/claude-code-setup. It costs 58 tokens per session (1,448 once invoked), scanned A, original, MIT.

A reference guide for using uv, a Python tool that manages Python versions and project environments, on this machine. It explains why system Python and other managers are not allowed and where that rule is enforced.

In plain words
What is it for?
Use it before writing Python, changing hooks or scheduled jobs that run Python, or investigating interpreter and environment problems.
Why use it?
It prevents scripts, hooks, and scheduled tasks from silently running with the wrong Python interpreter.

Skill for Claude Code

Written for Claude Code: user-invocable in frontmatter. Also seen: reads .claude/ paths; mentions CLAUDE.md.

Good fit Use it before writing Python, changing hooks or scheduled jobs that run Python, or investigating interpreter and environment problems.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/w2ur/claude-code-setup/python-uv
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add w2ur/claude-code-setup --skill python-uv
Clone the repo
git clone --depth 1 https://github.com/w2ur/claude-code-setup

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for python-uv

README.md
[![agentmods](https://agentmods.dev/badge/skills/w2ur/claude-code-setup/python-uv/github.svg)](https://agentmods.dev/skills/w2ur/claude-code-setup/python-uv)
Your own site
<a href="https://agentmods.dev/skills/w2ur/claude-code-setup/python-uv"><img src="https://agentmods.dev/badge/skills/w2ur/claude-code-setup/python-uv/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for python-uv

Your own site · 80×15
<a href="https://agentmods.dev/skills/w2ur/claude-code-setup/python-uv"><img src="https://agentmods.dev/badge/skills/w2ur/claude-code-setup/python-uv.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 58 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,448 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00058 $0.01448
Opus 5.5 $0.00023 $0.00579
Sonnet 5.5 $0.00012 $0.00290
Haiku 4.5 $0.00006 $0.00145

Measured 21d ago against content hash ea47507f4f28, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

python-uv scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 21d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/python-uv/SKILL.md · 113 lines

How it starts

The opening of the file, as written. The whole thing — 113 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Python on this machine — the reasons

The hard rules live in ~/.claude/CLAUDE.md. This skill holds the measurements behind them, so that a future session does not re-derive the wrong belief from the same evidence and "fix" something that is already correct.

Decided 2026-08-17.

No pyenv — ~/.pyenv does not exist and must not come back. No development Python from Homebrew. No pip install into a system interpreter.

The enforcement lives in uv.toml, and that is the whole point

~/.config/uv/uv.toml sets python-preference = "only-managed". That is what actually enforces uv-only Python: uv then refuses a system interpreter outright.

It is deliberately not in ~/.zshrc. A shell export reaches interactive shells only — a LaunchAgent and a cron entry never source .zshrc — so setting it there leaves it unset in exactly the place a wrong interpreter would be invisible.

uv's default without the setting is "prefer managed, but fall back to a system Python if no managed one is installed", so the gap is real rather than theoretical. env-drift-check.py's uv run --script shebang runs under the vigie LaunchAgent and picks correctly today only because managed 3.11/3.12/3.13 happen to be installed.

The falsifying control that was actually run. uv discovers ~/.config/uv/uv.toml on every invocation regardless of shell. Verified with a probe file set to only-system: that flipped uv python find to Homebrew's 3.14 with no env var set, and the same run without the file did not. The check was made to produce the opposite answer before its silence was trusted.

Note UV_PYTHON_PREFERENCE is absent from uv 0.12.5's --help, which documents UV_MANAGED_PYTHON instead. The old var is still parsed, but the config key is the stable form — write the config key.

Homebrew's [email protected] stays installed, and that is not a loophole

It is installed_on_request=false — its dependents are whatever brew uses --installed [email protected] prints. brew uninstall [email protected] takes those with it.

Read the full file on GitHub · 113 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 21d ago Changed · +1 lines ea47507f4f28
  2. 1mo ago First seen · 112 lines · 58 tokens per session scan A 23fbcd4eb85b

Subscribe to this mod's changes

python-uv is a skill published in the GitHub repository w2ur/claude-code-setup (2 stars, last pushed 3d ago), licensed MIT. It adds 58 tokens to every session and 1,448 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.