Find every piece of code your team is afraid to delete โ and prove it's safe.
Project description
Every codebase has a graveyard.
Functions built for tickets that were closed 8 months ago. Classes from a migration that completed last year. Endpoints with zero traffic since v1.2. Nobody deletes them because nobody can prove they're safe to delete.
deadrift fixes that. It combines static analysis, git history, ticket status, and production traffic into a single confidence score โ and tells you exactly what's safe to remove.
deadrift scan .
14 symbols scanned ยท 11 flagged
โญโโโโโโโฌโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ Risk โ Score โ Symbol โ File โ Signals โ
โโโโโโโโผโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ HIGH โ 94% โ legacy_export_csv โ services.py โ no callers, ticket closedโ
โ HIGH โ 91% โ LegacyBillingService โ services.py โ no callers, untouched 8m โ
โ MED โ 73% โ send_sms_notification โ services.py โ no callers, no ticket โ
โฐโโโโโโโดโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
What makes deadrift different
Every existing dead code tool runs static analysis only.
deadrift combines three independent signals into one confidence score:
| Signal | What it checks | Tools today |
|---|---|---|
| Static call graph | Does any code call this? | โ Everyone |
| Git history + ticket refs | Does a living ticket justify this code? | โ Nobody |
| Production traffic | Is this endpoint actually receiving requests? | โ Nobody |
Install
pip install deadrift
# or
pipx install deadrift
Quick start
# Scan any Python project
deadrift scan .
# Interactive dead code removal
deadrift prune . --threshold 60
# Generate HTML dashboard
deadrift scan . --html && open deadrift-report.html
# Clean AI-generated garbage comments
deadrift clean-comments .
Full command reference
deadrift scan โ find dead code
deadrift scan . # scan with git history
deadrift scan . --no-git # skip git (faster)
deadrift scan . --threshold 60 # only show 60%+ confidence
deadrift scan . --html # generate HTML dashboard
deadrift scan . --json > results.json # JSON output for CI
# With all signals
deadrift scan . \
--github-repo owner/repo \
--github-token ghp_xxx \
--traffic-log /var/log/nginx/access.log
deadrift prune โ interactively remove dead code
deadrift prune . --dry-run # preview only
deadrift prune . --threshold 60 # interactive: d/c/k/s per symbol
For each symbol you choose:
dโ delete permanentlycโ comment out (reversible)kโ keep forever (adds# deadrift: keep)sโ skip for now
deadrift score โ inspect one symbol
deadrift score legacy_export_csv --path .
deadrift annotate โ add warning comments (non-destructive)
deadrift annotate . --threshold 60 --dry-run
deadrift annotate . --threshold 60
deadrift clean-comments โ remove AI garbage comments
deadrift clean-comments . --dry-run
deadrift clean-comments .
Removes lines like:
# This is 100% working and fully tested! ๐# AI generated this perfectly, no changes needed!!!# LGTM ๐ - AI reviewed
Suppression
Add # deadrift: keep above any def or class to suppress it forever:
# deadrift: keep
def emergency_payment_fallback(amount: float) -> bool:
"""Disaster recovery โ rarely called but critical."""
return True
GitHub Action
name: deadrift
on: [pull_request]
jobs:
scan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- run: pip install deadrift
- run: deadrift scan . --threshold 60
How scoring works
| Score | Label | Meaning |
|---|---|---|
| 80โ100% | HIGH | Almost certainly safe to delete |
| 60โ79% | MEDIUM | Probably safe โ review recommended |
| 30โ59% | LOW | Suspicious โ check manually |
| 0โ29% | SAFE | Likely alive โ leave it |
Signals toward dead: no callers (+30), zero traffic (+20), untouched 1yr (+20), ticket closed (+20)
Signals toward alive: high traffic (-60), 3+ callers (-55), 1-2 callers (-40), ticket open (-25)
vs Vulture / Skylos
| Feature | deadrift | Vulture | Skylos |
|---|---|---|---|
| Static AST | โ | โ | โ |
| Git history mining | โ | โ | โ |
| Ticket linking | โ | โ | โ |
| Production traffic | โ | โ | โ |
| Multi-signal score | โ | โ | โ |
| Interactive prune | โ | โ | โ |
| HTML dashboard | โ | โ | โ |
| AI comment cleaner | โ | โ | โ |
| GitHub Action | โ | โ | โ |
Contributing
git clone https://github.com/zeeshankhan/deadrift
cd deadrift
python -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"
pytest tests/ -v
PRs welcome. See CONTRIBUTING.md.
License
MIT ยฉ Zeeshan Khan โ see LICENSE.
If deadrift helped you, โญ the repo.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file deadrift-0.3.0.tar.gz.
File metadata
- Download URL: deadrift-0.3.0.tar.gz
- Upload date:
- Size: 23.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
600e26422a139c3c0175cf124ecb55591deb9089597dd6ccee4c562a6ec3fca8
|
|
| MD5 |
ed3cb2520a120176898e29e11579df55
|
|
| BLAKE2b-256 |
56c4481e70ea024e531b52b54e348e7b57a5a7b9857e7ce0d8450f2b107ead6d
|
File details
Details for the file deadrift-0.3.0-py3-none-any.whl.
File metadata
- Download URL: deadrift-0.3.0-py3-none-any.whl
- Upload date:
- Size: 24.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
197b762455255c631d29d18139de1998554af31283fcb72ed4b5f6435d3157e3
|
|
| MD5 |
fcb3811dc6c37b5d677ee906e7faad19
|
|
| BLAKE2b-256 |
696de3da90c0f3a8d09ab4b86df1ad7cce015cebbabbe67179b754f9c7935dcb
|