Claude · Coding

Multi-file workflows

Approve the file list before edits, let the type checker drive wide changes, and split big diffs into commits you can review.

Claude multi-file workflows

One session, a plan, then evidence

A multi-file change has three stages. Before you edit, tell Claude what the repo can't show, then get a file list you can approve. During the edit, change shared definitions first and let the type checker find the callers. Afterward, split the result into commits with one job each, and compare it with the list using git diff --stat. Anthropic's large-codebase guide suggests keeping one cross-package change in a single session, so the decisions behind each edit stay consistent.

When one session isn't the right size

For one mechanical change across many files, Claude Code's /batch splits the work into 5 to 30 independent units, each with its own worktree, tests and pull request, after you approve its plan. It only suits units that can pass on their own, so make a breaking change backward compatible before you batch it. For separate pieces of work, run parallel sessions with claude --worktree <name>. Worktrees are fresh checkouts that branch from your default branch by default, so unpushed work and .env files aren't there unless you set them up. In the Claude app, you can add several files with Add from GitHub, but it can't edit them, and you'd apply the changes yourself.

Frequently asked
Can Claude edit multiple files at once?

Claude Code can. It finds the files, edits them and runs your checks. The Claude app can suggest changes across files you add, but its GitHub integration is read-only, so you apply those changes yourself.

How do I stop Claude changing too many files?

Use plan mode and ask for a table of every file it will change. Delete rows you don't want with Ctrl+G, tell it to ask before touching anything else, then compare the result with git diff --stat.

Do I need to explain my project structure to Claude Code?

Usually not. Anthropic's docs list describing your architecture and file layout in CLAUDE.md as advice you can stop following, because Claude reads the repo itself. Tell it what isn't in the code, such as constraints and what must not change.

What is the /batch command in Claude Code?

It handles large changes in parallel. Claude researches the code, splits the work into 5 to 30 independent units and shows you a plan. After you approve, a background subagent handles each unit in its own worktree, runs tests and opens a pull request or reports back.

How do I work on several things at once with Claude Code?

Run claude --worktree with a different name in each terminal. Each session gets its own checkout and branch, so edits don't collide. Each one spends from the same usage limit, so as a rule of thumb, try two before starting five.