Subagent Delegation — AI's Clones
Subagent Delegation — AI's Clones — easy-to-understand guide based on official docs
Imagine you’re a project manager juggling three deadlines. You wouldn’t do all the work yourself—you’d brief three assistants, send them off, and collect their reports. That’s exactly what delegate_task does for your AI.
What Is Subagent Delegation?
In plain terms, it lets your main AI spin up several “mini AIs” (subagents), each working in its own isolated sandbox. They don’t share notes, they don’t interrupt each other, and they only hand back a single summary when done. Think of it as giving your AI the power to clone itself.
The Catch: Subagents Have Amnesia
Here’s the most important thing to remember: your subagent knows nothing about your conversation history. It’s a fresh hire on day one. Everything you’ve discussed, every command you’ve run—gone. Its only “onboarding” comes from two fields you provide:
goal: What you want it to accomplishcontext: The background info it needs to get the job done
So you must stuff all necessary details into that call. Otherwise, your subagent will wander around like a headless chicken.
One Task? Send One Assistant
For a single job, the syntax is straightforward:
delegate_task(
goal="Debug why tests fail",
context="Error: assertion in test_foo.py line 42"
)
Here, you’re telling the subagent: “Investigate the test failure—the error is at line 42.”
Multiple Tasks? Send a Team
Need several things done at once? Fire off multiple subagents in parallel. By default, up to 3 can work simultaneously (you can adjust this—there’s no hard ceiling):
delegate_task(tasks=[
{"goal": "Research topic A", "context": "Focus on recent primary sources"},
{"goal": "Research topic B", "context": "Compare the leading explanations"},
{"goal": "Fix the build", "context": "Project root: /home/user/project"}
])
Each task becomes its own independent subagent. They work in parallel, never waiting on each other.
Background Mode: The Main AI Stays Busy
Here’s a cool trick: top-level calls run automatically in the background. The main AI fires off the instructions and keeps working on other things. When a subagent finishes, its results come back as a new message. If your main AI is playing “coordinator,” it waits for all subagents to finish, then synthesizes everything into one final report.
Summary & Practical Advice
delegate_task is like giving your AI a cloning machine. It handles multiple independent tasks simultaneously, boosting efficiency dramatically.
Pro tip: Because subagents have amnesia, write your context like you’re emailing a brand-new colleague who knows nothing about your project. Include background details, file paths, error messages, reference links—everything. When in doubt, over-share. That’s the secret to making this tool sing.
📖 Official Docs
This article is based on the official Hermes Agent documentation:Official docs › getting-started/nix