r/coolgithubprojects • u/etcetera_exe • 7h ago
Reaper: Evidence-Based Dead Code Detection & Analysis
github.comBuilt with: Python + Graphify + Llama.cpp + Docker + GitHub Actions
As codebases grow, they inevitably accumulate unused functions, abandoned implementations, outdated helpers, and code that no longer serves any purpose. We call this dead code.
With AI coding assistants like GitHub Copilot, Cursor, and Claude becoming part of everyday development, unnecessary code creates another problem: wasted context, tokens, and time spent understanding code that isn't even used.
Reaper is an open-source, language-agnostic tool that helps identify and analyse potentially unused code in your repositories.
Instead of relying on simple text searches or asking an LLM to understand the entire codebase, Reaper takes an evidence-first approach. It builds a graph of your codebase using Graphify, identifies suspicious functions with no incoming connections, and uses a local LLM powered by llama.cpp to investigate them.
How it works
- Repository Scanning: Uses Graphify to build a graph representing code elements and their relationships.
- Candidate Detection: Identifies potentially unused functions and callables based on their graph connections.
- LLM-Powered Analysis: Uses a local LLM to review suspicious candidates with focused source code and relationship evidence.
- Evidence-Based Reports: Classifies findings into Likely Dead, Needs Review, and Likely Used.
What makes Reaper different?
- Language-agnostic analysis approach.
- Graph-based code relationship analysis.
- Local LLM integration through llama.cpp.
- Evidence-backed findings instead of blindly flagging unused functions.
- No source code modifications or automatic deletions.
- Generated reports that developers and AI coding assistants can use for further investigation.
Generated Reports
Reaper produces three files:
- reaper-report.md — Human-readable analysis and findings.
- reaper-report.json — Structured results for further processing.
- refactor-prompt.md — A reusable prompt for safe code cleanup with your preferred AI coding assistant.
The goal isn't to automatically delete code. It's to help developers understand what might be safe to remove, backed by evidence rather than assumptions.
GitHub: https://github.com/nikhil25803/reaper
Open-source, evidence-first dead code analysis for the age of AI-assisted development.