Skip to content
ai tools

The Tiny CLI Taming AI Agent Chaos

More coding agents can mean more branch clutter, repeated installs, and risky merges—not just faster output. The catch: the tool promising to smooth it all out is still pre-1.0.

Theo Brandt
The Tiny CLI Taming AI Agent Chaos

Three Agents, One Repo—and a Collision Course

Running multiple AI agents on a single Git checkout is a collision waiting to happen. Agent A, halfway through a refactor, suddenly breaks Agent B’s tests due to shared dependencies or conflicting file edits. This shared-folder problem cripples parallel development.

Git worktrees offer an immediate fix: each task gets an isolated directory, its own branch, and a clean workspace. This second checkout shares the repository’s history, but agents aren’t writing on the same sheet of paper anymore. It’s a powerful primitive for parallelizing work.

However, plain Git worktrees introduce their own friction. Creating one demands typing the branch name three times, followed by manual directory changes. Cleanup requires another three commands to delete the worktree and its branch.

Furthermore, asking Git for a status delivers only a static list of folder paths. There’s no single, dynamic view of what every agent is doing, no integrated merge command, and dependencies remain a manual concern. Native worktree support, like Claude Code’s, fixes creation but still leaves these critical gaps.

The One-Line Workflow That Replaces Folder Juggling

Worktrunk streamlines parallel agent workflows by shifting focus from folder paths to branches. wt switch <branch> creates or enters a worktree, eliminating the need to type branch names or remember directory paths. This single command sets up an isolated environment for each agent.

wt list provides a consolidated, interactive dashboard. It displays every active worktree, showing its branch, progress relative to main, diff size, and agent activity indicators (e.g., a robot icon for active agents, a speech bubble for agents awaiting input). This replaces plain git worktree list’s static folder paths with actionable context.

When an agent finishes its task, wt merge automates a complex, six-step Git lifecycle into one command. It commits, squashes, rebases onto main, fast-forwards, and deletes the finished worktree and its branch. While wt merge automates most of the heavy lifting, conflicts still halt the rebase, requiring human intervention.

The Speed Trick: Reuse What Each Agent Needs

Running multiple agents demands efficient setup. Worktrunk provides lifecycle hooks, executing setup tasks automatically when a worktree is created. This eliminates repeated dependency installations and manual environment configuration, ensuring each agent starts productive.

Worktrunk also tackles storage and speed with wt step copy-ignored. This command reuses ignored files like node_modules or build caches. On supported filesystems (APFS, Btrfs), it employs copy-on-write, linking to the original files until changes occur. This saves significant disk space and time.

The video demonstrates dramatic results: a 14GB Rust build folder copied in ~20 seconds with copy-ignored versus 2 minutes normally. A first Rust build dropped from 68 seconds to 3-4 seconds. These are author-reported timings, not universal benchmarks. Filesystem support is crucial; EXT4 on Linux performs full copies. Also, native modules still require rebuilding. For more details on Worktrunk's approach to parallel agent workflows, check out Worktrunk — Git worktree management for parallel AI agent workflows.

Enjoying this? Get one like it in your inbox each morning.

one email a day · unsubscribe in two clicks · no third-party tracking

Useful, Fast-Moving—and Not for Every Developer

Worktrunk’s terminal-first orchestration contrasts sharply with native Claude Code worktrees. While Claude Code handles basic isolation and auto-cleanup, it leaves status monitoring and merge workflows to the user. Worktrunk fills this gap, offering a single view of all agent activity and a one-command merge that handles commits, squashes, rebases, and worktree deletion.

This tiny CLI is pre-1.0 (currently v0.81), meaning breaking changes are frequent; expect to update your config. Its shell-function setup for directory switching is crucial, as is reviewing project hooks that run shell commands. Unresolved merge conflicts still require manual intervention; Worktrunk stops the rebase and hands control to you.

Copy-on-write benefits from wt step copy-ignored are filesystem-dependent. On APFS, it’s nearly instant and saves significant space, but EXT4 Linux boxes get full copies. Native modules will still need a rebuild on new worktrees.

If you run one agent at a time, native worktrees or plain Git are likely sufficient. However, if you regularly run three, five, or more agents and need to cut worktree overhead—from setup and dependency installs to status checks and merge cleanup—Worktrunk provides the missing orchestration layer.

Frequently Asked Questions

What is Worktrunk?

Worktrunk is an open-source CLI that simplifies Git worktree management for developers running parallel coding tasks or AI agents.

How does Worktrunk help with parallel AI agents?

It gives each task its own branch and checkout, shows worktree status in one view, and streamlines merging and cleanup.

Does Worktrunk work only with Claude Code?

No. It integrates with Claude Code and supports other agent CLIs, including Codex, OpenCode, and Gemini CLI.

Does Worktrunk eliminate merge conflicts?

No. Worktrees isolate files during development, but changes that overlap can still conflict when they are merged.

Is Worktrunk ready for production?

It is pre-1.0, so expect possible breaking changes and review project hooks before approving their shell commands.

Found this useful? Share it.

For builders

Want Stork to write one of these about your product?

Send us a URL. We use the product, form a view, and publish what we actually think — in 8 languages, labeled Sponsored, with no copy approval on your side. That last part is what makes it worth quoting.

See how it works$199 · AI tools & software only

For builders

This page is doing a job for someone else’s tool.

AI agents read it. Buyers land on it. It answers in eight languages and over MCP. Your tool can have one like it — live in 24 hours.