Agents & Protocols

Parallel Agent Worktree Review

Reviews a plan or shell script that lets several coding agents work in parallel, each in its own git worktree, and lists only the five mistakes that make the agents collide, one line each with a fixed code, the place, why it breaks and the fix - or exactly No findings. It catches one branch checked out in two worktrees or forced onto a second one, two agents started on the same fixed port, an untracked secret file missing in a new worktree or written by two agents, a build folder or database file written by more than one agent, and worktrees that are never removed. It leaves out the safe look-alikes, such as two worktrees on different branches cut from one commit or a shared folder that every agent only reads. Use before launching parallel agents, to audit an orchestration script, or to debug agents that overwrite each other.

Parallel Agent Worktree Review is a tested SKILL.md that reviews a plan or shell script that lets several coding agents work in parallel, each in its own git worktree, and lists only the five mistakes that make the agents collide, one line each with a fixed code, the place, why it breaks and the fix - or exactly No findings; an agent buys it once for $0.01 over x402.

Tested 2026-10-19No code, no hidden instructionsv1.0.0 · 6.4 KB · perpetual license

Not for

How an agent stops or retries, what the agents write, locking worktrees, sparse checkout and bare repositories. It reads one pasted plan or script and judges only what is written in it.

Tested, honestly

Tested 2026-10-19 with a strong and a weak model.

SonnetStrong model, claude-sonnet-5-5
Right on all 3 cases, read by hand. On the script with a forced add it named the second worktree as the branch problem and the missing removal at the end, and left out the read-only fixtures folder and the separate branch cut from the same commit. On the three-bugfix plan it gave exactly the shared port and the shared database file and left out the copied env file and the proper cleanup. On the tidy plan it answered exactly No findings.
HaikuWeak model, claude-haiku-5-5
Right on all 3 cases, read by hand. It gave the same two lines as the strong model on each planted plan, with sound fixes, and answered exactly No findings on the tidy plan. It spent far more output tokens than needed on the clean plan, but the final answer was one sentence.

Full test summary

Example

Our own test text, before and after the skill ran. Excerpts only.

English · claude-sonnet-5-5

Before

#!/bin/bash # Run three agents in parallel on the search feature set -e cd ~/projects/shop git worktree add ../shop-a feature/search git worktree add -f ../shop-b feature/search git worktree add -b agent/c ../shop-c HEAD chmod -R a-w /data/fixtures (cd ../shop-a && PORT=4001 run-agent --task search-ui --fixtures /data/fixtures) &…

After

BRANCH-TWICE — worktree ../shop-b (`git worktree add -f ../shop-b feature/search`) — feature/search is already checked out in ../shop-a and the add is forced past git's refusal, so both agents work on one branch — give each agent its own branch, e.g. `git worktree add -b agent/b ../shop-b feature/search`…

What is in the file

  • What git guarantees, as published in the git documentation on 19 October 2026
  • The answer
  • The codes
  • Rules
  • Work in this order
  • Short example

Languages

English. Tried in: English.

License

Perpetual, non-exclusive; use and modify for yourself incl. paid work; no resale or republishing. Holder: Georgi Kalchev, aiskills402.com. Full terms.

Versions

Current version 1.0.0, updated 2026-10-19. Whoever bought an earlier version gets new ones free through the same re-download token.

  1. v1.0.0 · 2026-10-19

    First release, written in the light-test batch of 19 October 2026 (three cases, price $0.01). The idea is ours; no foreign skill was opened, facts come from public documentation (see notes/ideas.md). Output: see the skill description.

    Test: three cases written by hand (two planted, each with a safe look-alike, one clean control), one run on Claude Sonnet and one on Claude Haiku, no run without the skill, no iteration on the skill text after the runs. `test/control.mjs` shows that the checks pass on the ideal answers and fail on realistic wrong ones. See `test-summary.json` for the verdicts read by hand.

FAQ

Shared starting commit for every worktree: a collision?

No. Two worktrees on different branches that start from one commit are normal and git allows them. The skill reports one branch held by two worktrees, or an add that is forced past git refusal.

Is a shared folder that agents only read a problem?

No. A fixtures folder made read-only and read by every agent is left alone. The skill reports a shared path that more than one agent writes, such as one database file in a temp folder or a common build folder.

Does it warn about missing env files?

Yes, when the plan never copies or links them. A fresh checkout holds only committed content, so an untracked env file or key is absent until the plan puts it there. The git manual does not state this in so many words, and the skill says as much in its text.

What was in the test?

Three plans were each read by both models in a single run: a script that forces one branch into two folders and never removes them, a plan that starts three servers on one port against one shared database file, and a tidy plan with ports computed per agent. On reading each answer, both models met all expectations.

Share

Read this page as Markdown: /skills/git-worktree-parallel-agents.md.

More in Agents & Protocols

  • Prompt Caching Review

    Agents & Protocols

    SKILL.md · v1.0.0 · 8.8 KB

    Reviews ONE Claude API request (tools, system, messages, the cache marks, the model, the sizes and how often it is sent) for the five reasons its prompt cache does not pay off, and lists only those, one line each with a fixed code, the place, why the cache misses and the fix - or exactly No findings. It catches text that changes on every call (a clock, a request id, a user name) at or before the cache mark, a large stable prefix with no mark, a marked prefix shorter than the model's minimum, tools or system edited between calls, and calls spaced further apart than the cache lifetime. It leaves out the safe look-alikes, such as a timestamp placed after the last mark or a mark on the latest user turn. Use to review a request before an agent ships, to find out why prompt caching shows zero cache read tokens, or to gate a change to a system prompt or a tool list.

    $0.01once

    • x402
    • USDC
    • Base
    Get skill

    Tested with Sonnet and Haiku, 19 Oct 2026

  • Agent Loop Review: Repeats, Caps, Self-Grading

    Agents & Protocols

    SKILL.md · v1.0.0 · 11.8 KB

    Reviews the description, configuration or code of an agent loop, anything that repeats on its own: a scheduled job that calls a model, an agent that retries until it is done, a batch of actions, a self-improving prompt loop. It finds where the loop runs away or repeats a side effect (no ceiling on iterations, the same scheduled tick delivered twice, a progress marker written after the effect, nothing kept between iterations, a batch that goes on after a refusal that will repeat for every item), where it judges its own work (the model says it is finished), where it acts beyond its brief (a token or tool set wider than the job, a delete, publish or mass send with no approval step) and where a dead source looks healthy (an empty reply counted as success, parallel workers writing one shared file). Each finding has a fixed code, the place, the reason and a fix, then one verdict. Use for an agent loop review, to find out why a cron job runs twice, to check a retry until done loop, or to catch a runaway agent loop before it runs unattended.

    $0.01once

    • x402
    • USDC
    • Base
    Get skill

    Tested with Sonnet and Haiku, 18 Oct 2026

  • Recommended

    x402 Listing Review: Catalogs, Scanners, Buyers

    Agents & Protocols

    SKILL.md · v1.0.2 · 13.8 KB

    Reviews how a paid HTTP resource sold over x402 is advertised to catalogs, scanners and buyer agents, and how the seller's own scripts read those catalogs back, from pasted 402 bodies, OpenAPI documents, discovery files, liveness guard code, catalog presence check scripts and buyer alerts. Flags a tiered tariff advertised as one row (a comparison bot reads the structured amount, not the description), one liveness clock for several catalog rows that are dropped one by one, a price above the standard buyer client's default cap with no note where agents read before buying, a discovery file the scanner no longer parses, a bearer scheme the scanner's indexer does not recognise by name, a scanner record that was never re-crawled after a fix, a presence check that reads only one of the two response field names or has no control that must return zero, a first buyer that is a crawler paying hundreds of sellers, and discovery endpoints that read the database on every crawl. Each finding has a fixed code, the place, the reason and a fix, then one verdict. Use for an x402 listing review, to check x402 discovery or Bazaar catalog presence code before trusting it, or to audit how a paid API is listed and read.

    $0.05once

    • x402
    • USDC
    • Base
    Get skill

    Tested with Sonnet and Haiku, 9 Oct 2026

  • Claude Session Saver: When to Clear or Compact

    Agents & Protocols

    SKILL.md · v1.0.0 · 12.6 KB

    Reviews a snapshot of a Claude Code session (the context size, measured or guessed; the task and where it stands; git status; what still runs in the background; the plan or notes file; what the person asked) and decides whether the person should type /clear, type /compact with a focus text, finish one step first, or keep going. Before a fresh session it lists what would be lost or left behind: results that exist only in the chat, a plan file with no next step, uncommitted or unpushed work, changes made by another session, background servers and temporary deployments, a secret about to be written into notes. It also flags the timing and command mistakes: a deploy or migration in progress, waiting for auto-compact, a size judged by feel, a cold cache after a long break, the same correction made three times, /compact on finished work, /compact with no focus, an agent that claims it will clear the session itself, and huge files or logs read whole. Each finding has a fixed code, the reason and a step, then one decision line. Use it to decide when to clear a Claude Code session, to save work before /clear, or to write a claude code /compact focus before the context gets costly.

    $0.03once

    • x402
    • USDC
    • Base
    Get skill

    Tested with Sonnet and Haiku, 16 Oct 2026