multi-agent-patterns
Design multi-agent architectures for complex tasks.
Skill by NeoLabHQ
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/neolabhq-multi-agent-patterns-816c1d
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: design, agent-building
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions: not checked yet.
What's inside
- Skill name
multi-agent-patterns- Description
- Design multi-agent architectures for complex tasks. Use when single-agent context limits are exceeded, when tasks decompose naturally into subtasks, or when specializing agents improves quality.
- License
- GPL-3.0
- Instructions
- 367 lines in SKILL.md · view on GitHub
Files (1)
- SKILL.md
SKILL.md (first lines)
# Multi-Agent Architecture Patterns for Claude Code Multi-agent architectures distribute work across multiple agent invocations, each with its own focused context. When designed well, this distribution enables capabilities beyond single-agent limits. When designed poorly, it introduces coordination overhead that negates benefits. The critical insight is that sub-agents exist primarily to isolate context, not to anthropomorphize role division. ## Core Concepts Multi-agent systems address single-agent context limitations through distribution. Three dominant patterns exist: supervisor/orchestrator for centralized control, peer-to-peer/swarm for flexible handoffs, and hierarchical for layered abstraction. The critical design principle is context isolation—sub-agents exist primarily to partition context rather than to simulate organizational roles. Effective multi-agent systems require explicit coordination protocols, consensus mechanisms that avoid sycophancy, and careful attention to failure modes including bottlenecks, divergence, and error propagation. ## Why Multi-Agent Architectures ### The Context Bottleneck Single agents face inherent ceilings in reasoning capability, context management, and tool coordination. As tasks grow more complex, context windows fill with accumulated history, retrieved documents, and tool outputs. Performance degrades according to predictable patterns: the lost-in-middle effect, attention scarcity, and context poisoning. Multi-agent architectures address these limitations by partitioning work across multiple context windows. Each agent operates in a clean context focused on its subtask. Results aggregate at a coordination layer without any single context bearing the full burden. ### The Parallelization Argument Many tasks contain parallelizable subtasks that a single agent must execute sequentially. A research task might require searching multiple independent sources, analyzing different documents, or comparing competing approaches. A single agent processes these sequentially, accumulating context with each step. Multi-agent architectures assign each subtask to a dedicated agent with a fresh context. All agents work simultaneously, then return results to a coordinator. The total real-world time approaches the duration of the longest subtask rather than the sum of all subtasks. ### The Specialization Argument Different tasks benefit from different agent configurations: different system prompts, different tool sets, different context structures. A general-purpose agent must carry all possible configurations in context. Specialized agents carry only what they need. Multi-agent architectures enable specialization without combinatorial explosion. The coordinator routes to specialized agents; each agent operates with lean context optimized for its domain. ## Architectural Patterns ### Pattern 1: Supervisor/Orchestrator The supervisor pattern places a central agent in control, delegating to specialists and synthesizing results. The supervisor maintains global state and trajectory, decomposes user objectives into subtasks, and routes to appropriate workers. ``` User Request -> Supervisor -> [Specialist A, Specialist B, Specialist C] -> Aggregation -> Final Output ``` **When to use:** Complex tasks with clear decomposition, tasks requiring coordination across domains, tasks where human oversight is important. **Advantages:** Strict control over workflow, easier to implement human-in-the-loop interventions, ensures adherence to predefined plans. **Disadvantages:** Supervisor context becomes bottleneck, supervisor failures cascade to all workers, "telephone game" problem where supervisors paraphrase sub-agent responses incorrectly. **Claude Code Implementation:** Create a main command that orchestrates by calling specialized subagents using the Task tool. The supervisor command contains the coordination logic and calls subagents for specialized work. ```markdown <!-- Example supervisor command structure --> 1. Analyze the user request and decompose into subtasks 2. For each subtask, dispatch to appropriate specialist: - Use Task tool to spawn subagent with focused context - Pass only relevant context to each subagent 3. Collect and synthesize results from all subagents 4. Return unified response to user ``` **The Telephone Game Problem:** Supervisor architectures can perform worse when supervisors paraphrase sub-agent responses incorrectly, losing fidelity. The fix: allow sub-agents to pass responses directly when synthesis would lose important details. In Claude Code, this means letting subagents write directly to shared files or return their output verbatim rather than having the supervisor rewrite everything. ### Pattern 2: Peer-to-Peer/Swarm The peer-to-peer pattern removes central control, allowing agents to communicate directly based on predefined protocols. Any agent can transfer control to any other through explicit handoff mechanisms. **When to use:** Tasks requiring flexible exploration, tasks where rigid planning is counterproductive, tasks with emergent requirements that defy upfront decomposition. **Advantages:** No single point of failure, scales effectively for breadth-first exploration, enables emergent problem-solving behaviors. **Disadvantages:** Coordination complexity increases with agent count, risk of divergence without central state keeper, requires robust convergence constraints. **Claude Code Implementation:** Create commands that can invoke other commands based on discovered needs. Use shared files (like task lists or state files) as the coordination mechanism. ```markdown <!-- Example peer handoff structure --> 1. Analyze current state from shared context file 2. Determine if this agent can complete the task 3. If specialized help needed: - Write current findings to shared state - Invoke appropriate peer command/skill 4. Continue until task complete or hand off ``` ### Pattern 3: Hierarchical Hierarchical structures organize agents into layers of abstraction: strategic, planning, and execution layers. Strategy layer agents define goals and constraints; planning layer agents break goals into actionable plans; execution layer agents perform atomic tasks. ``` Strategy Layer (Goal Definition) -> Planning Layer (Task Decomposition) -> Execution Layer (Atomic Tasks) ``` **When to use:** Large-scale projects with clear hierarchical structure, enterprise workflows with management layers, tasks requiring both high-level planning and detailed execution. **Advantages:** Mirrors organizational structures, clear separation of concerns, enables different context structures at different levels. **Disadvantages:** Coordination overhead between layers, potential for misalignment between strategy and execution, complex error propagation. **Claude Code Implementation:** Structure your plugin with commands at different abstraction levels. High-level commands focus on strategy and call mid-level planning commands, which in turn call atomic execution commands. ## Context Isolation as Design Principle The primary purpose of multi-agent architectures is context isolation. Each sub-agent operates in a clean context window focused on its subtask without carrying accumulated context from other subtasks. ### Isolation Mechanisms **Instruction passing:** For simple, well-defined subtasks, the coordinator creates focused instructions. The sub-agent receives only the instructions needed for its specific task. In Claude Code, this means passing minimal, targeted prompts to subagents via the Task tool. **File system memory:** For complex tasks requiring shared state, agents read and write to persistent storage. The file system serves as the coordination mechanism, avoiding context bloat from shared state passing. This is the most natural pattern for Claude Code—agents communicate through markdown files, JSON state files, or structured documents. **Full context delegation:** For complex tasks where the sub-agent needs complete understanding, the coordinator shares its entire context. The sub-agent has its own tools and instructions but receives full context for its decisions. Use sparingly as it defeats the purpose of context isolation. ### Isolation Trade-offs Full context delegation provides maximum capability but defeats the purpose of sub-agents. Instruction passing maintains isolation but limits sub-agent flexibility. File system memory enables shared state without context passing but introduces consistency challenges. The right choice depends on task complexity, coordination needs, and the nature of the work. ## Consensus and Coordination ### The Voting Problem
From NeoLabHQ/context-engineering-kit, GPL-3.0.
More from NeoLabHQ/context-engineering-kit
- 0.623score
write-tests
NeoLabHQ
Add missing test coverage for your local code changes by generating new test files (covers uncommitted and untracked changes, or the latest commit if…
SkillBFreshness: B★ 1.8KClaude Code +9 - 0.623score
multi-agent-patterns
NeoLabHQ
Design multi-agent architectures for complex tasks.
SkillBFreshness: B★ 1.8KClaude Code +9 - 0.623score
review-pr
NeoLabHQ
Review an existing GitHub pull request and post inline review comments on its diff.
SkillBFreshness: B★ 1.8KClaude Code +9 - 0.623score
brainstorm
NeoLabHQ
Use when creating or developing, before writing code or implementation plans - refines rough ideas into fully-formed designs through collaborative…
SkillBFreshness: B★ 1.8KClaude Code +9 - 0.621score
review-local-changes
NeoLabHQ
Review your local uncommitted working-tree changes (git diff plus untracked files) and return actionable improvement suggestions.
SkillBFreshness: B★ 1.8KClaude Code +9 - 0.621score
load-pr-comments
NeoLabHQ
Use to load open/unresolved PR review comments then aggregate them as tasks in .specs/comments/*.md for parallel agents to fix.
SkillBFreshness: B★ 1.8KClaude Code +9 - 0.621score
resolve-fixed-pr-comments
NeoLabHQ
Verify what PR review comments have been addressed (committed/pushed OR uncommitted local changes) and resolve the threads that are genuinely fixed or no…
SkillBFreshness: B★ 1.8KClaude Code +9 - 0.621score
launch-sub-agent
NeoLabHQ
Launch an intelligent sub-agent with automatic model selection based on task complexity, specialized agent matching, Zero-shot CoT reasoning, and mandatory…
SkillBFreshness: B★ 1.8KClaude Code +9 - 0.620score
root-cause-tracing
NeoLabHQ
Use when errors occur deep in execution and you need to trace back to find the original trigger - systematically traces bugs backward through call stack…
SkillBFreshness: B★ 1.8KClaude Code +9 - 0.620score
git-notes
NeoLabHQ
Use when adding metadata to commits without changing history, tracking review status, test results, code quality annotations, or supplementing commit messages…
SkillBFreshness: B★ 1.8KClaude Code +9 - 0.618score
create-pr
NeoLabHQ
Create pull requests using GitHub CLI with proper templates and formatting
SkillBFreshness: B★ 1.8KClaude Code +9 - 0.618score
actualize
NeoLabHQ
Reconcile the project's FPF state with recent repository changes
SkillBFreshness: B★ 1.8KClaude Code +9
Signals
- Stars
- 1,782
- Forks
- 163
- Open issues
- 7
- Last commit (this folder)
- Aug 7, 2026 (2 months ago)
- Last release
- Aug 26, 2026 (2 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- GPL-3.0
- Website
- neolab.gitbook.io/cek
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
Same skill elsewhere
Copies of this SKILL.md published by others; search shows only one of them.
- 0.623score
multi-agent-patterns
NeoLabHQ
Design multi-agent architectures for complex tasks.
SkillBFreshness: B★ 1.8KClaude Code +9 - 0.374score
multi-agent-patterns
SyntaxAsSpiral
Design multi-agent architectures for complex tasks.
SkillAFreshness: A★ 5Claude Code +9 - 0.325score
multi-agent-patterns
NeoLabHQ
Design multi-agent architectures for complex tasks.
SkillBFreshness: B★ 1.8KClaude Code +9
More from NeoLabHQ
- 0.623score
brainstorm
NeoLabHQ
Use when creating or developing, before writing code or implementation plans - refines rough ideas into fully-formed designs through collaborative…
SkillBFreshness: B★ 1.8KClaude Code +9 - 0.623score
multi-agent-patterns
NeoLabHQ
Design multi-agent architectures for complex tasks.
SkillBFreshness: B★ 1.8KClaude Code +9 - 0.623score
review-pr
NeoLabHQ
Review an existing GitHub pull request and post inline review comments on its diff.
SkillBFreshness: B★ 1.8KClaude Code +9 - 0.623score
write-tests
NeoLabHQ
Add missing test coverage for your local code changes by generating new test files (covers uncommitted and untracked changes, or the latest commit if…
SkillBFreshness: B★ 1.8KClaude Code +9 - 0.621score
launch-sub-agent
NeoLabHQ
Launch an intelligent sub-agent with automatic model selection based on task complexity, specialized agent matching, Zero-shot CoT reasoning, and mandatory…
SkillBFreshness: B★ 1.8KClaude Code +9 - 0.621score
load-pr-comments
NeoLabHQ
Use to load open/unresolved PR review comments then aggregate them as tasks in .specs/comments/*.md for parallel agents to fix.
SkillBFreshness: B★ 1.8KClaude Code +9
Cite this page
multi-agent-patterns skill. Agent Mart. https://agentmart.dev/skills/neolabhq-multi-agent-patterns-816c1d (last updated 2026-10-24)