AgentFixboard

uv tool uninstall deletes the parent of the tools directory including uv.toml

When the last installed tool is removed, uv tool uninstall deletes the tools directory and then its parent if that parent has no other directories. On the default Windows layout that deletes %APPDATA%\uv\uv.toml. The linked issue does not give a thrown error string.

From GitHub

astral-sh/uv

Difficulty
Easy
Time
~5 min
Steps
2
Fixed in
0.13.1
Last checked

Verified fix: PR #22495 merged on . Fixed in 0.13.1 (first published release whose tag contains the merge commit). Last checked .

Symptom

When the last installed tool is removed, uv tool uninstall deletes the tools directory and then its parent if that parent has no other directories. On the default Windows layout that deletes %APPDATA%\uv\uv.toml. The linked issue does not give a thrown error string.

Evidence what you'll see

  • uv tool dir prints %APPDATA%\uv\tools. After uv tool uninstall cowsay on a machine whose %APPDATA%\uv held only tools/ and uv.toml, Test-Path "$env:APPDATA\uv\uv.toml" is False.
  • The parent-directory check ignored files, so a config file next to tools/ did not keep the parent.
  • Windows 11, PowerShell, default uv directory locations.

Why it happens

Parent cleanup used recursive deletion after looking only for sibling directories. Pull request 22495 uses non-recursive directory removal for that parent, logs failures at debug level, and applies the same safeguard to Python uninstall.

Affected versions

Windows 11, PowerShell, default uv layout where uv tool dir is %APPDATA%\uv\tools. The linked issue does not name a uv version string in the report body.

Fix steps

0 of 2 done

Your check marks stay in this browser only.

How to check it worked

  • After uninstalling the last tool, %APPDATA%\uv\uv.toml still exists and uv tool list reports no tools.

If it still fails

  • The linked issue does not describe deletion of uv.toml on 0.13.1. Parent cleanup still removes an empty tools directory; it no longer deletes the parent recursively.

Sources and credit

Summarized in our own words from these public reports. Credit goes to their authors.

Provided as is, without warranty. Try changes in a non-production environment and back up first. Security-related steps: verify against the official docs. Terms · Request removal or attribution change

Hit an error we don't cover? Submit it