Dead code

From berkcangumusisik/claude-code-practices · View interactive version

Dead code is an AI agent skill from the GitHub repository berkcangumusisik/claude-code-practices. Finds unused functions, variables, exports, and dependencies across the codebase

How to use this skill

Skill file

Dead Code Analysis

  1. Find unused exports (TypeScript/JS):
npx ts-prune 2>/dev/null || npx unimported 2>/dev/null || echo "Running manual search"
  1. Manual search for likely dead code:
# Exported but never imported
grep -r "^export " src/ --include="*.ts" -l | head -20

# Functions defined but never called
grep -r "^function \|^const .* = (" src/ --include="*.ts" | head -30
  1. For each candidate, verify by searching for all usages across the codebase.
  1. Report categories:
  1. For safe-to-delete items: ask confirmation, then remove.

Never delete code you're not certain about - mark uncertain items with // TODO: verify unused.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.