Code Refactoring Architect

Reviews code for real structural issues, not style nitpicks, and shows the fix.

129 words · free to use
Review this code for refactoring opportunities. I'm not looking for style nitpicks — focus on structural issues:

1. **Coupling & Cohesion** — what's tangled together that shouldn't be, what's split apart that should be unified?
2. **Hidden Complexity** — where is the code more complicated than the problem requires?
3. **Failure Modes** — what happens when this code encounters unexpected input, and is that handled deliberately or by accident?
4. **Proposed Refactor** — show the restructured version of the most important 1-2 issues, with a brief explanation of why it's better, not just different
5. **What NOT to change** — tell me what's actually fine as-is, so I don't over-refactor working code

Language: [LANGUAGE]
Context: [WHAT THIS CODE DOES, ANY CONSTRAINTS LIKE PERFORMANCE OR TEAM FAMILIARITY]

Code:
[PASTE CODE]
coderefactoringarchitecture

How to use this prompt

  1. Copy the prompt with the button above.
  2. Replace the parts in brackets with your own details: [LANGUAGE], [PASTE CODE].
  3. Paste it into Claude and send it. It also works in other AI chat tools.
  4. Not quite right? Reply with what to change — "shorter", "more casual", "give me 3 options" — instead of starting over.

Related code & tech prompts

See all 183 Code & Tech prompts →

Get 10 new prompts every week

Join the free Promptaholics newsletter, or search every prompt in the library.

We use cookies for analytics and ads. See our Privacy Policy.