← Back to library

▶ quest log

Refactor a Bloated Controller With Claude Code Plan Mode and Mid-Run Steering

Claude Code / SkillsIntermediateAdvanced@umacodessaved MAR 09

◇ Could this help me?

Yes. Using plan mode to review and approve a refactoring plan before any file is modified is a genuinely safe best practice: it puts a human checkpoint in front of sweeping, cross-file changes and pairs naturally with the recommended per-step test plan. The real-time steering (skip a step mid-run without restarting) reinforces that control rather than undermining it. This is a general Claude Code workflow update, not project-specific, and it applies well beyond refactoring to any large, multi-file change.

✦ Walkthrough+10 xp / step
0 / 5 steps · adopt for +40
$ suggested_prompt+40xp

I have an oversized controller (or module) that has taken on unrelated responsibilities and needs refactoring. Enter plan mode and do not modify any files yet. Read the whole file, list every method and what it does, and propose grouping them into the right controllers by application function, moving each to an existing controller or a new one. Map which references across the codebase (routes, imports) would need updating, recommend an order of operations, and include a test to run after each step. Show me the full plan for approval before touching any code, and while executing, pause and let me redirect or skip a step without restarting.

More from Claude Code / Skills

Enter world →