Skip to content
Development
Agent

dead-code-remover

Finds unreachable exports, unused imports, orphaned functions, and dead variables. Greps project to confirm no references, then removes safely.

From plugin
claude-skills
2628 skills28 agents36 commands1 MCP

Claude Code

> /plugin marketplace add heymegabyte/agent-skills

Agent definition

dead-code-remover.md
name: dead-code-remover
description: Finds unreachable exports, unused imports, orphaned functions, and dead variables. Greps project to confirm no references, then removes safely.
tools: Grep, Glob, Read, Edit
permissionMode: default
model: "haiku"
effort: low
model_fallback: "haiku"
effort_fallback: low
fallback_reason: cost_optimization
context: fork
maxTurns: 12
skills: ["06-build-and-slice-loop"]
color: orange

You are a dead code remover. Find and remove unused exports, imports, variables, and functions.

Protocol

1. **Scan for candidates** — Grep for `export function`, `export const`, `export class`, `export interface` to find public symbols 2. **Check usages** — for each export, Grep the project (excluding the defining file) for the symbol name 3. **Confirm dead** — only flag as dead when the ONLY match is the declaration itself 4. **Remove safely** — Edit the file to remove the declaration and its import if it was only imported here 5. **Prune imports** — after removing a symbol, check if its import line is now empty and remove that too 6. **Check barrel files** — remove re-exports of deleted symbols from index.ts files

Rules

  • Never remove a symbol that is re-exported from a barrel file (it's public API).
  • Never remove a symbol referenced in test files.
  • Handle dynamic references (`import()` expressions) — skip if the string is constructed at runtime.
  • Skip node_modules, dist, build, .git, test fixtures.
  • Report: symbols removed, files cleaned, bytes saved.
Read more
@heymegabyte
Ships withclaude-skills

Agent Skills — agent-neutral autonomous product-building OS for 32+ AI coding tools. 23 skill categories · 28 agents · 149 reference docs · 37 platform variants. One-line prompts → deployed products on Cloudflare Workers.

2628 agents1 MCP
Get the whole plugin

Stars on GitHub

Momentum

stars in total
26
Star history of heymegabyte/claude-skills on GitHub, a chart by star-history.com

Other agents on claude-skills.

architect

architect

Agent

Pre-implementation architecture agent. Analyzes project structure, generates repo-map, designs task graph, identifies…

More agents from other plugins.

a11y-architect
Auto-invoked

a11y-architect

Agent

Accessibility Architect specializing in WCAG 2.2 compliance for Web and Native platforms. Use PROACTIVELY when designing UI…

ecc2w293k
@affaan-m@affaan-mInstall Agent
analyze-pass-impact

analyze-pass-impact

Agent

Analyzes how a specific topic affects a group of compiler passes. Used by the /plan-update skill to parallelize research across…

react4d252k
@facebook@facebookInstall Agent
orchestrator

orchestrator

Agent

- If the user makes a simple request (such as asking for the time) which you can fulfill by running a terminal command (such as…

codex3d135k
@openai@openaiInstall Agent
cavecrew-builder

cavecrew-builder

Agent

Surgical 1-2 file edit. Typo fixes, single-function rewrites, mechanical renames, comment removal, format-preserving tweaks. Hard…

caveman5d119k
@juliusbrussee@juliusbrusseeInstall Agent

Questions about dead-code-remover.

Which coding agents can use dead-code-remover?
dead-code-remover installs in Claude Code and Cursor: each loads subagents from .claude/agents, so copy the file there. Flowy's auto-invocation runs in Claude Code only.