- Home
- Skills
- Agents & Orchestration
- Sub-Agent Setup
More screenshots
Works with the AI Agents you already use
Sub-Agent Setup
Operational rules for Claude Code sub-agents that prevent git conflicts, stalled runs, and wasted tokens.
$5
Sub-Agent Setup
Example session with this skill installed
Use the sub-agent setup rules to plan how I should run three sub-agents on this
repo: one to refactor the billing module, one to update its tests, and one to
write the migration notes. Two of them write files and commit. Tell me which
ones need a worktree, which run in the foreground, and what each report should
look like.
- Read your context and instructions
- Compiled the sub-agent setup
Sample output for the request above, not a live run.
Summary
Three sub-agents, two of them writing and committing. Run all three in isolated worktrees and run them in the foreground, since you're watching the session.
| Agent | Job | Isolation | Mode | Report shape |
|---|---|---|---|---|
| Billing refactor | Refactor the billing module | Worktree | Foreground | Branch, commit, changed files, open questions |
| Test update | Update tests for the new billing module | Worktree, from the refactor's branch | Foreground | Pass/fail count, failing tests |
| Migration notes | Write migration notes (one file, no code changes) | Worktree | Foreground | One-page notes file |
Why each choice
Billing refactor and test update both write files and commit, so each gets its own worktree. This stops one agent's staged changes from landing in the other's commit.
- The test update starts from the refactor's branch, not
main, so it tests the new code. - Migration notes writes a file, so it also gets a worktree, even though it doesn't commit code.
- Foreground for all three. Foreground avoids a stalled run if a completion notice is missed.
Follow-ups
If the test agent reports a failure in billing, send the fix to the same agent with SendMessage. Don't spawn a new one, since a new spawn starts with none of the context and repeats the whole job.
Next steps
- Merge the billing refactor first, then the test update, so the tests run against the new code.
- Read
git diff --cached --statbefore any push from the shared checkout. - Review the migration notes last, after both code changes are merged.
Connects securely to your tools. The creator never sees your data.
About this skill
Stop wasting tokens and time on failed sub-agent runs. Unplanned spawns can cause git index conflicts, stalled background runs, and repeated work with no context. This skill gives you the rules to decide when to spawn, which isolation to use, when to run in the foreground, how to send follow-ups, and how to get a clean report back.
What it does
- Decides when a task needs a sub-agent instead of a single tool call.
- Uses worktree isolation for any agent that writes or commits.
- Runs in the foreground in unattended sessions, so runs don't stall.
- Sends follow-ups to the same agent with
SendMessage, instead of a new spawn. - Sets a fixed output shape so the parent can read the result quickly.
Use cases
- Splitting a refactor across directories with worktree isolation.
- Running a build-and-test pass and a separate verification pass on code changes.
- Background documentation while the parent handles logic.
- Migrations that need isolated build and test loops.
Known limitations
Doesn't fix a weak task plan. Needs git worktree support for full isolation. Written for multi-agent setups in Git repositories.
- Based on one multi-agent setup, so some rules may not fit every project.
- Doesn't fix a weak task plan. Define the task before you spawn agents.
- Needs git worktree support for full isolation.
- Some rules come from our own runs, not from Anthropic's documentation.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before any payment.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 1 month ago
Permissions
No external accounts, services, or network access are needed. Works on the task you describe in your own repository.