Find and auto-delete dead code across 9 languages — with git intelligence and auto PR
Project description
☠ Archaeologist
Codebase intelligence toolkit. Five tools to understand, clean, and improve your codebase — all from one install.
pip3 install archaeologist
Five Tools
☠ Unused Code Finder
Find functions nobody calls. Combines static analysis with git history into a confidence score. Auto-deletes on an isolated branch, runs your tests, and opens a GitHub PR.
deadcode ./my-project --explain
deadcode-report ./my-project --output report.html
deadcode-clean ./my-project --dry-run --min-confidence 85
deadcode-clean ./my-project --min-confidence 85
⬡ Codebase Graph
Interactive browser-based map of your architecture. Files grouped by folder, colored by health. See which files are clean, which have dead code, and which are completely unused.
archaeologist-graph ./my-project
archaeologist-graph ./my-project --output graph.html
◎ Change Impact Analyzer
Before changing any file, see what could break — every caller, every importer, test coverage, and a 0–100 blast radius score.
archaeologist-impact ./my-project user_service.dart
archaeologist-impact ./my-project user_service.dart --html
◈ Complexity Scorer
Scores every function on cyclomatic complexity — decision branches, nesting depth, and length. Ranks worst-first so you know what to refactor.
archaeologist-complexity ./my-project
archaeologist-complexity ./my-project --html --min-score 15
⧉ Duplicate Detector
Finds copy-paste code and near-identical functions. Detects same names in different files, exact body copies, and high-similarity implementations.
archaeologist-dupes ./my-project
archaeologist-dupes ./my-project --html
Languages
Production tested: Python, Dart/Flutter, JavaScript, TypeScript
Beta (may have false positives): Go, Java, Kotlin, Ruby, Rust, Swift
How the Unused Code Finder Works
- Parse — Tree-sitter builds an AST for every file, extracting all function definitions and calls
- Git analysis — Last commit date, author count, and commit frequency per file
- Score — Five signals combine into a 0–100 confidence score
- Delete — Functions removed by precise AST byte ranges — no broken syntax
- Test — Your test suite runs automatically. If tests fail, everything rolls back
- PR — A GitHub PR opens with full documentation of every change
Confidence Score Signals
| Signal | Points | How it works |
|---|---|---|
| Call graph | 45 | Zero callers = full 45pts |
| Git age | 20 | 2+ years untouched = 20pts |
| Author count | 15 | Single author = 15pts |
| Recursive dead | 10 | All callers are also dead = 10pts |
| Commit count | 10 | Only 1–2 commits ever = 10pts |
Verdicts
- 80–100: Safe to remove — Multiple signals agree. Auto-clean targets these by default.
- 50–79: Review first — Likely unused. Verify manually before removing.
- 40–49: Needs runtime data — Static analysis uncertain. May be called via reflection.
Git Flow (Auto-clean)
Your main branch is never touched. Everything happens on an isolated branch:
- New branch created — e.g.
cleanup-2026-05-28 - Functions removed surgically by AST byte ranges
- Your test suite runs automatically
- If tests pass — branch committed
- GitHub PR opened with full documentation
- If tests fail — branch deleted, nothing changes
To review and merge:
git checkout cleanup-2026-05-28
git diff main cleanup-2026-05-28
git checkout main && git merge cleanup-2026-05-28
To roll back:
git branch -D cleanup-2026-05-28
Requirements
- Python 3.11+
- Git (for git history analysis)
- GitHub token (optional, for auto-PR feature)
License
MIT — free to use, modify, and distribute.
Project details
Release history Release notifications | RSS feed
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 archaeologist-0.8.4.tar.gz.
File metadata
- Download URL: archaeologist-0.8.4.tar.gz
- Upload date:
- Size: 56.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
342f036f2e0851c2a96e23c833b44f31cc70a97cc5b5f6f25f315e4d02d09676
|
|
| MD5 |
2735b50adcf16311a4d855257d2c8efe
|
|
| BLAKE2b-256 |
1e7af5320b3ab6581048a25cc1020171abbce282a15a265691a50d77fed5b4fe
|
File details
Details for the file archaeologist-0.8.4-py3-none-any.whl.
File metadata
- Download URL: archaeologist-0.8.4-py3-none-any.whl
- Upload date:
- Size: 61.6 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 |
20f09ed5fc18b24b33dcef3c1ae854db7464fb3db555c21cf6f9dc15f19c7d27
|
|
| MD5 |
bd481d23fe855d9d567ddbb369f6ae21
|
|
| BLAKE2b-256 |
4993895e977f9645272cb7ed9306a1ae0680f8eb3df9ecbde09237d2f9acbf79
|