deadcode gives AI coding agents a disciplined, evidence first auditing engine. Instead of guessing or making reckless deletions, it maps uncalled functions, unused imports, dead CSS selectors, and abandoned code blocks across your entire repository, presenting a structured report for approval before any changes are made.
Compatible with Antigravity, Claude Code, and other AI coding agents.
deadcode is a lightweight audit skill for AI coding agents across any programming language. It scans repositories for uncalled functions, unused imports, dead CSS selectors, unreachable branches, and abandoned code blocks, delivering a structured report with line numbers before touching any file.
Standard coding agents often delete or refactor code too aggressively. deadcode follows an audit first philosophy, proving zero call sites with static analysis and waiting for explicit user approval before performing surgical removals.
- Uncalled Definitions: Scans for declared functions, classes, methods, and structs that have zero references across the codebase.
- Unreachable Logic: Flags dead statements positioned after returns, throws, breaks, continues, or hardcoded false conditions.
- Unused Imports and Dependencies: Detects imported packages, modules, and header references never used in file bodies.
- Duplicate Rules and Declarations: Identifies duplicate CSS media queries, repeated class definitions, and overwritten function declarations.
- Abandoned Commented Code: Surfaces large blocks of stale commented code that add noise to active files.
When invoked, deadcode detects your project stack and uses native linters if present, falling back to static AST and symbol reference queries if no linter is installed:
| Language / Stack | Native Tools (If Available) | Fallback Static Analysis |
|---|---|---|
| JavaScript / TypeScript | eslint, ts-prune, knip, depcheck |
Cross repo declaration to call site search |
| Python | vulture, flake8, ruff, autoflake |
Unreferenced definitions and import search |
| HTML / CSS | purgecss, stylelint |
Selector to DOM matching, duplicate media query checks |
| Rust | cargo check, cargo-udeps |
Unused compiler warning audit |
| Go | go vet, deadcode, golangci-lint |
Compiler reference analysis |
| Java / Kotlin | spotbugs, pmd |
Static symbol reference check |
| C / C++ | cppcheck, clang-tidy |
Header and translation unit reference analysis |
| PHP / Ruby | phpstan, rubocop |
Method symbol lookup |
- Reconnaissance: Detects project languages, active package managers, configuration files, and main entry points.
- Static Analysis: Maps symbol references and scans for the five categories of dead code.
- Structured Audit Report: Displays exact file paths, line ranges, code signatures, and safety risk levels.
- Approval and Verification: Applies minimal deletions only for approved items, followed by a compiler or syntax check to guarantee zero regressions.
Clone this repository into your local Antigravity skills directory:
git clone https://github.com/seanpaulforonda/deadcode.git C:\Users\<Username>\.gemini\config\skills\deadcodeClone into your global or project skills folder:
git clone https://github.com/seanpaulforonda/deadcode.git ~/.claude/skills/deadcodePaste this prompt directly into your agent chat session:
Read https://github.com/seanpaulforonda/deadcode and install the deadcode skill into my agent skills directory so I can run /deadcode.
Trigger the scan at any time by typing the slash command in chat:
/deadcode
Or ask naturally:
Scan and audit this project for unused code and leftover declarations.
### Project Stack Detected
* **Environment:** TypeScript / Next.js / Tailwind CSS
* **Files scanned:** 42 files
### Audit Report: 3 Items Found
#### 1. Uncalled Function
* **File:** `src/utils/formatting.ts` (Lines 48 to 62)
* **Code:** `export function formatLegacyDate(val: string)`
* **Finding:** Zero references found across the repository.
* **Risk level:** Zero risk
#### 2. Unused Import
* **File:** `src/components/Navigation.tsx` (Line 3)
* **Code:** `import { useMemo } from 'react';`
* **Finding:** `useMemo` is imported but never called.
* **Risk level:** Zero risk
#### 3. Duplicate CSS Media Query
* **File:** `src/styles/globals.css` (Lines 112 to 125)
* **Code:** `@media (max-width: 768px) { ... }`
* **Finding:** Redundant duplicate query identical to rules at line 74.
* **Risk level:** Zero risk
### Summary of Impact
* **Total dead lines identified:** 31 lines
### Next Step
Would you like me to remove all 3 items, or would you like to keep specific ones?Every flagged item in the audit report provides four data points so you can evaluate each finding quickly:
- File: The exact repository file path and line number range where the dead code lives.
- Code: A concise snippet or function signature representing the target declaration or statement.
- Finding: The concrete static analysis evidence explaining why the item was flagged (for example, zero call sites across the codebase, unreferenced import, or statement placed after return).
- Risk level: The safety tier determining how safe the item is to remove:
- Zero risk: Completely safe to delete immediately. Includes uncalled local functions, unused imports, redundant CSS media queries, and unreachable logic with zero references across the repository.
- Low risk: Code has zero static references, but may be invoked via string lookups or event emitters. A quick developer check is recommended before removal.
- Verification recommended: Publicly exported package methods, library APIs, or dynamic reflection targets. The agent flags them for manual confirmation rather than automated removal.
- Evidence before accusation: Never flag code as dead without concrete proof of zero references across the repository.
- Audit first, ask always: Never delete or rewrite code during the scan. Always present findings and wait for user confirmation.
- Verify after cleanup: Always run syntax checks (
node --check,python -m py_compile,cargo check) after deletions.
MIT. Copyright (c) 2026 seanpaulforonda.