GROK BUILD

Several workers, one owner each

A subagent works in its own context and reports a summary. Parallel edits belong in separate git worktrees. Two writers in the same files will overwrite each other.

Figure 1: Two tasks sit in two worktrees. The work comes back only when you decide to bring it back, after you have read it.

1. A helper with its own desk

A subagent is a child session, and Grok can start one without any setup. It has its own conversation, so a long research pass does not fill your chat. When it finishes, you get a summary, not a dump of every file it opened. What it does not get is its own copy of the files. If it edits, it edits the folder you are already in.

That boundary is the conversation, not the folder. The parent session stays about the decision. The child session spends its window on the digging. You do not have to learn a type system to use this. Ask in plain language. Parallel edits belong in worktrees, which are the next section.

2. Give each helper one job

Good splits are easy to say out loud. “Look through the invoice code and summarize how a refund is saved. Do not edit.” “In a separate pass, list the tests that cover that path.” Each child has a job and a limit.

A bad split is two writers on the same feature with a vague “you take the backend.” They will invent two designs. If the tasks share an unstated decision, make the decision yourself first, write it in the plan, and only then split the labor.

Layman rule: One owner per set of files. A summary can be merged. Two edits of the same function cannot, not safely.

3. A worktree is a separate copy of the project

Git worktrees let two sessions edit without sharing a folder. Grok can start in a new one. The name after --worktree is optional, so without the equals sign the prompt that follows would be read as the name:

grok --worktree=invoice-export "Add the invoice CSV download described in docs/invoice-plan.md"

grok worktree create invoice-export creates the copy and prints its directory, without starting a session. By default that copy includes your uncommitted work, so a plan you saved in the repository and have not committed yet still comes along. Pass --ref when you want a clean start from a branch or a commit, with none of those uncommitted files. The command’s help is the current list of flags.

For the invoice button, one copy can own the page and another can own the test, and only after the columns are written down. The test copy is told not to edit the page. The page copy is told not to edit the test. If both copies edit the page, the time you saved comes back as a merge.

Files changed in that copy stay there. Your main folder is not updated as a side effect of the other session.

4. Bring the work back on purpose

When the side copy is done, read the diff before you bring it into the main folder. “The summary said it passed” is the summary’s claim. The diff is the work. Apply or merge with git, in the way your team already reviews a change. Then remove the worktree if you are finished with it, so you do not accumulate forgotten copies.

If you cannot explain the change, it does not come back. That rule is stricter when a second agent wrote it, because you did not watch every step.

5. More workers are not more progress

Two workers on two areas can be faster. Five workers on one design is a meeting you now have to referee. Start with one extra session the first time, on a low-stakes change, and see whether you can review what came back.

The first time, use the invoice page in one worktree and its test in the other. Read both diffs before either copy lands in the main folder.

Parallel work also means more tools may be in play. The next page is the permission question those tools raise: a connected tool is real access.