Example result: Find dead code and safe things to delete
AI-generated example · Cleanup
Prompt at a glance
Category
Text & chat
Works with
Claude · ChatGPT · Claude Code
Length
77 words
Fields to fill
PASTE THE FILES OR MODULE
Last updated

Find dead code and safe things to delete

This prompt finds code nobody uses anymore and tells you how confident it is that each piece is safe to remove. It also warns about hidden users, such as dynamic imports or templates, before you delete anything.

text-code-dead-code-cleanup — claude — 77 words

Act as a senior engineer tidying up a codebase.

Language and framework: [e.g. TypeScript, Next.js]
Code:
[PASTE THE FILES OR MODULE]

Find unused functions, variables, imports, exports, feature flags that are always on or off, commented-out blocks and duplicate logic. For each, say how confident you are that it is safe to remove and what could still use it (dynamic imports, reflection, other services, templates). Group the result into safe to delete now, check first, and keep.

Remove things in small commits and run the tests after each one, so a mistake is easy to undo.

How to use this prompt

From copy to answer in four steps

  1. 1

    Open Claude and start a new chat.

  2. 2

    Paste the prompt.

  3. 3

    Replace each [BRACKETED] field with your real details and paste in your own text where asked.

  4. 4

    Reply with follow-ups such as "make it shorter" or "make it sound more like me".

FAQ

About this prompt

Which AI tools work with this prompt?

It is written for Claude, ChatGPT and Claude Code. Paste it into your preferred tool and adjust the wording if the result is off.

What do I need to fill in?

Replace the field before you send it: PASTE THE FILES OR MODULE. Each field shows an example in the prompt.

Should I paste private information into the prompt?

Only what the task needs. Remove names, contact details and other sensitive data before pasting a resume or document into any AI tool.

Keep exploring

More chat & writing prompts

See all 424 chat & writing prompts →