Upload
Boopul
Claude ๐Ÿ’ป Coding May 22, 2026 ยท 1 min read ยท by Admin

Code Refactor Reviewer

Have Claude review a function for readability, bugs and performance, then return a refactored version with a diff-style explanation.

The Prompt
Act as a senior software engineer doing a careful code review. Here is a function:

```
[PASTE CODE]
```

1. List concrete issues grouped by Correctness, Readability, and Performance.
2. Provide a refactored version.
3. Explain each change in one line, referencing the original line it replaces.
Keep the public API identical unless a change is required for correctness.

How to use it

Paste your function where indicated. Mention the language and any constraints (e.g. "no new dependencies").

#code review #refactor #engineering

Related prompts

Prompt of the Day
๐Ÿ“ˆ
ChatGPT

Viral Hook Generator

Generate 10 scroll-stopping hooks for any topic, ranked by stopping power, with the psychological trigger behind each.

Prompt of the Day
๐ŸŽจ
Midjourney

Cinematic Portrait Photography

Direct Midjourney like a film DP โ€” dramatic lighting, shallow depth of field and a moody color grade for striking portraits.

โœ๏ธ
ChatGPT

SEO Blog Post Outliner

Turn a single keyword into a search-optimized outline with H2/H3s, search intent, and a suggested title and meta description.