Appearance

Language

Mastering AI agents

Git Worktree and AI Subagents: How I Built 8 Tools in Parallel (2026)

I split eight calculator tools across several agents, used Git worktrees to keep their changes apart, and assigned one agent to integrate shared files. For the articles that followed, Claude Code and Codex handed off work through commit messages.

Kelvin Wang · · 3 min read

Key points

  1. Give each agent a worktree and branch, with one shared spec and acceptance criteria.
  2. Put one integrator in charge of the tool registry and shared styles, then check the combined result.
  3. When another tool takes over a draft, the commit message should explain what changed and what still needs review.

I give each agent its own Git worktree and branch, with one spec and the same acceptance checks for everyone. I put one integrator in charge of shared files when the tools come together.

I split the site’s calculators across several agents, and three versions of the shared styles showed up at merge time. The electricity tool had calc-result.css, the retirement tool had calc-view.css, and the dollar-cost averaging tool brought back older styles inside its component. Each tool had its own directory during development. The shared styles still had to be reconciled at merge time.

How did I divide eight tools among the agents?

The shared spec says what to read first, where files go, and how to check the work. It requires official sources for the numbers, with separate research notes for each tool. I keep the calculators’ logic separate and reuse the site’s existing forms, result cards and charts.

I list what can be finished independently and what the tools share. An individual calculator’s logic can be implemented and checked against a worked example in isolation. The tool registry, topic list and shared styles are affected by several branches. They have to be checked across the whole set of tools.

How did I merge the shared files?

I assigned one agent to integrate the branches. The merged code kept calc-form.css as the shared stylesheet. It already contained the rules the electricity tool had split out. The retirement tool’s chart styles went into that same file, along with the new styles from the dollar-cost averaging tool. Each calculator kept its own behavior, and the shared form and chart rules lived in one place.

For similar work, the spec can assign an owner for each shared file up front. For example, the agent on the electricity tool can hand back the component and tests, then list the registry entry in its commit message. The integrator can update the registry, topic list, sitemap and build checks together and verify each tool’s entry point.

What if the computer restarts while an agent is halfway through?

The files in each worktree are still on disk, and uncommitted changes don’t disappear; only the conversation needs to come back. Go back to that worktree’s folder and use the resume command to reopen the session:

cd <that agent's worktree folder>
claude --resume             # list earlier conversations in this folder and pick one
claude --continue           # or pick up the most recent one directly
codex resume                # the Codex version: list earlier sessions and pick one

Once it’s back, I ask it what it has finished and what’s left before letting it continue.

How do I hand the same draft from one AI tool to another?

I split up the work differently for this series. The remote access and Artifacts drafts started on separate branches. Once they were on content/ai-harness, I had Claude Code and Codex work in the same worktree and communicate through commit messages. I gave Codex my remote access setup to add to both languages and asked Claude Code to review the placement. We kept the cross-tool comparison at the start and put my phone setup after the Codex instructions.

I keep each commit focused on one decision to review. With edits to the draft and changes to the article plan in separate commits, I can see why each change was made and find questions that still need an answer before merging. I read the draft myself and decide when it’s ready to publish.

For the rules, tests and review steps around this workflow, see the AI harness overview.

About the author

Kelvin Wang

Electrical engineer building tools with AI agents, sharing hands-on notes on engineering and investing.

More about me