Prompt: Have Claude Act as a Senior Engineer to Refactor an Unfamiliar Codebase

aitrendz_xyz · x · 2026-11-05

The tweet shares a reusable prompt that casts the model as a senior engineer joining a large, unfamiliar codebase: first map the architecture and data flow, then find structural problems, duplicated code, performance bottlenecks and maintenance risks, and finally output an architecture summary, a list of problem spots, a refactor plan and the improved code — with behavior kept identical.

It is part 2 of the author's "8 prompts" series; part 1 asks the model to build a production-ready full-stack MVP from scratch (architecture, file structure, DB schema, API endpoints, UI structure and full code).

Related event: Structured prompts beat vague asks for Claude coding, templates trend(3 posts)→

Original post →

More from coding & agent

coding & agent channel →