Skip to content
Agentmart
Submit a tool

deadcode

Find and remove dead, unused, or unreachable code in a codebase.

Skill by maggit

IndexedMIT
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/maggit-deadcode

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Find and remove dead, unused, or unreachable code in a codebase. Use when the user says /deadcode, asks to find unused code, dead code, unreachable code, orphaned files, unused imports, unused variables, or wants to clean up a codebase. Triggers: dead code, unused, unreachable, orphan, cleanup, prune.

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/deadcode

What's inside

Skill name
deadcode
Description
Find and remove dead, unused, or unreachable code in a codebase. Use when the user says /deadcode, asks to find unused code, dead code, unreachable code, orphaned files, unused imports, unused variables, or wants to clean up a codebase. Triggers: dead code, unused, unreachable, orphan, cleanup, prune.
License
MIT
Instructions
53 lines in SKILL.md · view on GitHub

Files (1)

  • SKILL.md

SKILL.md (first lines)

# Dead Code Detector

Find and safely remove dead, unused, or unreachable code.

## Workflow

1. Determine scope:
   - Specific file/directory or entire project.
   - Specific language(s) to focus on.
2. Identify the project type and entry points:
   - Check for `package.json`, `pyproject.toml`, `Cargo.toml`, `go.mod`, etc.
   - Identify entry points (main files, exported modules, route handlers).
3. Scan for dead code by category:

### Categories to Check

**Unused Imports/Requires**
- Scan each file for imported symbols not referenced in the file body.

**Unused Exports**
- Find exported functions/classes/constants and search the codebase for their usage.
- Use `grep -r` or equivalent to verify each export is imported elsewhere.

**Unused Variables & Parameters**
- Identify declared variables never read.
- Find function parameters never referenced in the function body.
- Respect `_` prefix convention for intentionally unused params.

**Unreachable Code**
- Code after unconditional `return`, `throw`, `break`, `continue`.
- Conditions that are always true/false (e.g., `if (false)`).

**Unused Files**
- Files not imported/required by any other file.
- Test files and config files should be excluded from this check.

**Commented-Out Code**
- Large blocks of commented code (>5 lines) that are likely stale.

4. Present findings grouped by category with file paths and line numbers.
5. For each finding, assess confidence (high/medium/low) based on static analysis limitations.
6. Remove only with user approval, starting with high-confidence items.

## Guidelines

- Never auto-delete — always present findings and ask for confirmation.
- Respect dynamic usage patterns: `getattr()`, `eval()`, reflection, decorators, dependency injection.
- Check for framework conventions (e.g., Django views referenced in urls.py, React components used in JSX).
- Exclude test files, config files, and type definition files from "unused" reports.
- For libraries/packages, exported public API should not be flagged as dead code.
- Note limitations: static analysis cannot catch all dynamic references.

From maggit/claude-workspace, MIT.

Signals

Stars
0
Forks
0
Open issues
0
Last commit (this folder)
Feb 8, 2026 (8 months ago)
Last release
Feb 8, 2026 (8 months ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from maggit

Cite this page

deadcode skill. Agent Mart. https://agentmart.dev/skills/maggit-deadcode (last updated 2026-10-24)