- Home
- Skills
- Code Quality & Review
- Dead Code Finder
Works with the AI Agents you already use
Dead Code Finder
Identify and remove unused variables, functions, exports, and orphan files across Python and JS/TS projects.
$1
Dead Code Finder
Example session with this skill installed
Scan the src/ directory of my TypeScript project for unused exports and orphan files. The main entry point is src/index.ts.
- Read your context and instructions
- Compiled the dead code finder
- Generated the document
I have scanned the src/ directory against src/index.ts. I identified 4 high-confidence deletions and 2 orphan files.
Dead Code Analysis Report
| File Path | Symbol/Type | Confidence | Reason |
|---|---|---|---|
src/utils/math.ts | calculateLegacyTax | High | Exported but never imported in the project. |
src/components/OldButton.tsx | File (Orphan) | High | No inbound imports found from any other file. |
src/hooks/useLegacyAuth.ts | File (Orphan) | High | No inbound imports found from any other file. |
src/types/index.ts | DeprecatedUser | High | Type definition is not referenced in any module. |
src/services/api.ts | loggerConfig | Medium | Name appears in config.json strings but has no code references. |
src/main.ts | unusedVar | High | Local variable defined but never read. |
Next steps
- Review
src/utils/math.tsandsrc/types/index.tsfor immediate deletion. - Verify if
loggerConfiginsrc/services/api.tsis required by a dynamic runtime configuration before removing. - Run
npm testafter deleting the flagged orphan files to ensure no hidden side effects.
OldButton.tsx
PDF · document
Example file from a real run - the skill writes it into your workspace.
Connects securely to your tools. The creator never sees your data.
About this skill
Large codebases accumulate technical debt in the form of unused exports, variables, and orphan files that bloat bundles and confuse developers. This skill scans your project to identify dead code that can be safely deleted, assigning confidence scores to minimize the risk of breaking dynamic references.
What it does
- Python AST analysis finds unused imports, local variables, and unreferenced functions or classes.
- JS/TS tree shaking identifies exported symbols that are never imported elsewhere in the project.
- Orphan detection flags entire files that have no inbound imports or references.
- Framework awareness respects entry points, test files, dunder methods, and React components used in JSX.
- Confidence scoring categorizes findings from high to low based on the risk of dynamic usage or reflection.
How it works
- Define entry points by specifying your main application files and public APIs to anchor the dependency graph.
- Execute scan on the target directory using the analysis engine.
- Review findings organized by confidence level and file location.
- Apply whitelists to exclude legacy modules or third-party integrations that should remain untouched.
Frameworks & tools
This skill supports Python, JavaScript, and TypeScript projects. It leverages AST parsing and dependency graph analysis to track symbols across modules.
Why this beats prompting it yourself
Generic LLM prompts often miss the difference between a truly unused export and a dynamic reference hidden in a string or registry. This skill systematically builds a dependency tree, ensuring that "dead" code isn't actually a critical entry point or test utility.
Use cases
- Bundle optimization by removing unreferenced JavaScript exports and orphan files.
- Technical debt reduction during major refactors or version migrations.
- Codebase audits to find legacy Python functions that are no longer part of any execution path.
Known limitations
Dynamic features like getattr, reflection, or string-based imports can hide usage. Always run your test suite after performing deletions.
Dynamic references like getattr, reflection, and string-based imports can hide real usage. Requires explicit entry point definition for accurate results.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before any payment.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 1 month ago