# Clean up a codebase that grew by accident

> Months of AI-written code: dead files, the same logic three times, packages nobody uses.

Web page: https://buildladder.com/resources/prompts/clean-up

What you get: The safe removals done and tested, and the uncertain ones listed for you.

Paste it into: Your AI tool, in your project

## Prompt to copy

```text
This project has grown messy. Clean it up without changing what it does.

Find: files, components, routes and functions nothing uses, the same logic written more than once, packages that are installed and never imported, leftover test and debug code, and commented-out blocks.

Show me the list with evidence before removing anything. Prefer deleting to rewriting. Remove only what you're sure about, in small groups, and run the build and tests after each. For duplicates, keep one copy and point the others at it. Give me a separate list of things that looked unused and you weren't sure about, with the reason.
```
