Skip to content

Fan Out Across a Migration, Safely

2026-07-26claude-code, practice

For a change that touches two hundred files, don't run one enormous session. Generate the task list to a file, then loop the agent over it one file at a time in headless mode.

The part that makes it safer is the scoping: --allowedTools "Edit,Bash(git commit *)" restricts each run to editing and committing, nothing else. It scopes what a run can touch, not whether the edit is correct. Reviewing the diff is still on you.

Test on two or three files first. Refine the prompt against what actually goes wrong. Then run the set.

Ask each run to return OK or FAIL and you get a results file you can act on rather than a transcript you have to read.