Worktrunk: parallel worktrees, lifecycle control and source analysis
Worktrunk performance and cost: measure parallelism without inventing savings
Build a practical ledger for checkout preparation, builds, model calls and review time before deciding whether more agents improve throughput.
What you will learn
- Measure a completed task, not the speed of starting another agent
- Separate shared resources from per-worktree overhead
- Use a controlled comparison and explain the bottleneck
Before you start
- Basic Git branches and command-line navigation
- A disposable repository for optional reader exercises
Explain worktree boundaries, verify a first checkout and review configured commands before adopting automation.
Key takeaways
- Count accepted changes, not launched agents.
- Track local resource costs separately from model charges.
- Unknown measurements are not free resources or zero latency.
Measure a completed task, not the speed of starting another agent
Worktrunk can make parallel checkouts easier to manage, but launching more tasks is not the same as finishing more accepted changes. Define completion as reviewed code passing the chosen checks, with conflicts resolved and required services cleaned up. Record wall-clock time for that unit before comparing one-worker and multi-worker workflows.
Separate checkout setup, dependency preparation, build/test work, model requests and human review. A fast switch command can sit inside a slow overall pipeline. We have not measured Worktrunk latency, build throughput or developer time, so this article supplies a measurement design rather than an improvement percentage.
Separate shared resources from per-worktree overhead
Git worktrees share repository infrastructure, but dependency directories, build artifacts and running development servers can still multiply. Measure disk use and memory for your actual configuration. Sharing a cache may reduce repeated downloads yet create locking or contamination concerns; do not assume two branches can safely share every generated artifact.
For AI-assisted tasks, record provider, model, input/output usage and retries separately from local resource usage. Optional commit-message generation introduces another external command and potentially another model request. Whether content is cached or billed depends on that configured service. Unknown prices and token counts should remain null, not become zero-cost claims.
Use a controlled comparison and explain the bottleneck
Choose comparable tasks, pin the repository and tool versions, keep acceptance checks constant and record worker count. Repeat enough cases to expose variation; report failures and abandoned tasks alongside successful ones. A two-task example demonstrates a workflow, not a statistically reliable benchmark. Do not change hooks and the model simultaneously and attribute every difference to Worktrunk.
If build memory saturates, reduce concurrent builds. If review queues grow, fewer simultaneous agents may finish faster. If dependency preparation dominates, investigate that stage before adding workers. The decision is conditional: adopt the coordination layer when its measured benefit exceeds configuration and maintenance overhead in your environment.
Decision guide
| Criterion | Option A | Option B |
|---|---|---|
| Best when | You need predictable behavior and easy auditing | You need adaptive optimization and have reliable telemetry |
| Main risk | May leave performance on the table | Can become difficult to explain or debug |
Implementation steps
- 1
Define one accepted task and fixed checks.
- 2
Record setup, build, model and review stages.
- 3
Compare controlled worker counts over repeated tasks.
- 4
Inspect the bottleneck before increasing parallelism.
Copy-ready example
{
"taskId": "example-only",
"workers": 2,
"setupSeconds": null,
"buildSeconds": null,
"peakMemoryBytes": null,
"inputTokens": null,
"outputTokens": null,
"retries": null,
"reviewMinutes": null,
"accepted": null,
"measured": false
}Frequently asked questions
How much faster is Worktrunk?
This series contains no independently measured speedup.
Are optional LLM commit messages free?
That depends on the external command and provider; no cost measurement was performed here.
Sources
- Worktrunk / README.mdSource checked 2026-09-14
- Worktrunk / docs/src/content/docs/llm-commits.mdSource checked 2026-09-14
- Worktrunk / docs/src/content/docs/hook.mdSource checked 2026-09-14