Library / Refactor

Split a large file

Break up a sprawling file into focused modules.

Refactor modularity architecture planning Claude Code
The prompt
@<file> is too large. Propose a split into cohesive modules with concrete names and responsibilities. Wait for my OK, then move the code and fix all imports.

Why it works

Proposing the module boundaries before moving anything lets you correct the architecture cheaply. The plan-then-execute gate is what keeps a big move from going sideways.

Fill in

  • @<file> — the oversized file.

Follow-ups

  • “Good split — do modules 1 and 2 now, leave the rest for a follow-up.”