The most repetitive agentic task is also the easiest to parallelize: same task spec, different scope. "Update all logger calls to use the new structured logger" applied across packages A through E is five identical jobs with five independent codebases. Five panes, five agents, one-fifth the wall time.
each package is independent
When the refactor scope is one package at a time, each agent operates in total isolation. No shared state in-flight. No risk of agents writing to the same file. The only coordination happens at merge — and by then each package is already clean.
the spec is already written
A refactor has a clear definition of done: before-and-after patterns the agent can verify. Write the spec once in a markdown file. Copy it to every pane. The agents do the mechanical work. You review diffs.
refactor.md at the repo root. Include the before-and-after pattern, the files or directories to touch, and any patterns to avoid. The more precise the spec, the less the agent improvises.refactor/pkg-auth, refactor/pkg-billing).refactor.md. The spec is the same; the working directory is different.If you are uncertain about the right approach for a refactor, spawn three agents on the same package from the same base branch — three worktrees, same spec. Review all three diffs and pick the result you like best. Discard the other two worktrees. This costs three times the API tokens but produces a better outcome when the task is ambiguous. Emdash makes best-of-N first-class; in Pane you do it manually by creating three worktrees from the same base branch.
Parallel refactoring breaks when packages share interfaces that the refactor changes:
See also: Pane vs Emdash for a comparison of the best-of-N pattern across tools.