In the pack: ChatGPT, Claude & Gemini Prompts for Coding and Developers
Remove Dead Code and Stale Feature Flags Safely
Prompt
Language / framework: {{FRAMEWORK}}
The code, flags or endpoints I suspect are dead: {{SUSPECTS}}
Evidence I have (search results for callers, logs, metrics, flag rollout state, git history): {{EVIDENCE}}
Do this:
1. For each suspect, list every way it could still be reached that a plain text search would miss: reflection or dynamic dispatch, string-built names, config files, templates, scheduled jobs, external callers of public APIs, database-stored references, tests.
2. Rate each suspect: Safe to delete / Probably dead, verify first / Still live, with the evidence.
3. For "verify first" items, the cheapest check (a log line or metric for two weeks, a search in other repos, asking a named team role).
4. For feature flags that are fully rolled out, the clean-up: which branch of each conditional to keep, and the flag configuration to remove afterwards.
5. A deletion order with small separate PRs, and what to monitor after each one ships.
Never recommend deleting something because it "looks unused". Tie each verdict to evidence from what I pasted.
Customize this prompt
Fill in the variables below to personalize this prompt:
Model Settings
Recommended Models
Temperature
Max Tokens
Additional Notes
About this prompt
“Remove Dead Code and Stale Feature Flags Safely” is a free prompt for ChatGPT in the Coding & Software category, 196 words long, added to The Prompt Index on October 28, 2026 by The Prompt Index. Copy it with the button above, paste it into ChatGPT or any other AI chat assistant, and send it.
It has 3 placeholders to fill in first:
{{FRAMEWORK}}, {{SUSPECTS}}, {{EVIDENCE}}.
Use the “Customize this prompt” fields to personalise it before you copy.
Recommended models: ChatGPT, Claude, Gemini.
0 upvotes, sent to an AI tool 0 times, viewed 8 times.
Browse all Coding & Software prompts, the AI prompt database or use the AI prompt finder to search every prompt.