DEV Community

Cover image for I rewrote killpy — it now detects 11 Python environment types and I found 7.9 GB on my own machine
Tlaloc-Es
Tlaloc-Es

Posted on

I rewrote killpy — it now detects 11 Python environment types and I found 7.9 GB on my own machine

A few months ago I posted here about killpy, a small CLI tool to delete unused Python environments. The feedback was great, so I rewrote it almost from scratch.
I ran it on my own machine and found 7.9 GB across 54 forgotten environments — most of them from projects I hadn't touched in years.

The problem is real: every project leaves a .venv, every tutorial leaves a Conda environment, every poetry install creates a hidden virtualenv in ~/.cache, tox creates a .tox in every repo you ever tested... none of it gets cleaned up automatically.
What killpy now detects:

.venv and any folder with pyvenv.cfg
Poetry, Conda, pipenv, pipx, pyenv, hatch, uv, tox
pycache, .mypy_cache, .pytest_cache, .ruff_cache
dist/, build/, .egg-info, .dist-info

Try it in one line, no install needed:

uvx killpy --path ~
Enter fullscreen mode Exit fullscreen mode

Or to see how much space you'd recover before deleting anything:

killpy stats --path ~
Enter fullscreen mode Exit fullscreen mode

It never deletes anything without confirmation — you can also use --dry-run to preview everything safely.
GitHub: https://github.com/Tlaloc-Es/killpy

⭐ Found it useful?
If killpy saved you some disk space, consider giving it a star on GitHub — it helps other developers find it when they search for Python cleanup tools.

⭐ Star killpy on GitHub
It takes 2 seconds and makes a real difference for discoverability.

Top comments (0)