$ recombobulate _
home / tips / ask-claude-to-hunt-down-dead-code
169

Ask Claude to Hunt Down Dead Code

recombobulate @recombobulate · Mar 25, 2026 · Workflows
ask-claude-to-hunt-down-dead-code

Codebases accumulate dead weight silently — functions nobody calls, exports nobody imports, CSS classes that exist in stylesheets but never appear in templates. Claude can track them down before they become a maintenance burden.

@src/ @resources/

Search for functions, classes, and components that are defined but never 
imported or referenced anywhere in the codebase. List each one with the 
file path and line number, and explain why you think it's unused.

Claude will scan for defined-but-never-called functions, unused exports, and unreferenced route handlers. It works across languages — JavaScript, TypeScript, PHP, Python, Ruby — and is equally effective at spotting CSS classes that exist in your stylesheet but don't appear in any template.

Dead code found:

- src/utils/formatCurrency.js:12 — formatCurrencyLegacy() defined but never imported
- src/components/OldModal.jsx — entire file never referenced in any route or layout
- resources/css/app.css:204 — .btn-ghost class not found in any Blade/JSX template
- app/Services/LegacyPaymentService.php:34 — class never instantiated

For larger codebases, scope it to one module at a time to stay within context limits — or combine it with your IDE's "find usages" output and paste the results to give Claude a head start.

Ask Claude to double-check each finding before deleting anything, since some code may be called dynamically (via call_user_func, require(), string-based dispatch, or reflection).

Dead code isn't harmless — it confuses contributors and hides real logic. Let Claude clean house.

~/recombobulate $ tip --comments --count=0

Log in to leave a comment.

~/recombobulate $ tip --related --limit=3
0
Run Claude Code in GitHub Actions to Automatically Review Every Pull Request

Set up Claude Code as an automated reviewer in your CI pipeline — on every pull request, it reads the diff, checks for bugs, security issues, missing tests, and convention violations, then posts its findings as a PR comment. Your human reviewers get a head start because the obvious issues are already flagged before they look.

recombobulate @recombobulate · 1 month ago
0
Ask Claude to Build a Deployment Checklist from Your Actual Infrastructure

Before deploying, tell Claude to read your project — migrations, environment variables, queue workers, scheduled tasks, caching, third-party integrations — and generate a deployment checklist that's specific to your app. Not a generic "did you run migrations?" list, but one that knows YOUR infrastructure and catches the things YOUR deploy can break.

recombobulate @recombobulate · 1 month ago
0
Ask Claude to Generate a README from Your Actual Codebase — Not a Template

Instead of writing a README from memory or copying a template, tell Claude to read your project and generate one that's actually accurate — real setup instructions from your config, real architecture from your directory structure, real API examples from your routes, and real prerequisites from your dependency files.

recombobulate @recombobulate · 1 month ago