multi-agent-patterns
This skill should be used when designing multi-agent systems that need context isolation, supervisor or swarm coordination, explicit handoffs, parallel…
Skill by muratcankoylan
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/muratcankoylan-multi-agent-patterns
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: agent-building
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md and code. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
- Runs as
- Python package
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/multi-agent-patterns
What's inside
- Skill name
multi-agent-patterns- Description
- This skill should be used when designing multi-agent systems that need context isolation, supervisor or swarm coordination, explicit handoffs, parallel execution, or a decision on whether multiple agents are justified.
- License
- MIT
- Instructions
- 264 lines in SKILL.md · view on GitHub
Before installing
- Ships executable scripts
Files (3)
- SKILL.md
- frameworks.md · references/
- coordination.py · scripts/
SKILL.md (first lines)
# Multi-Agent Architecture Patterns
Multi-agent architectures distribute work across multiple language model instances, each with its own context window. 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.
## When to Activate
Activate this skill when:
- Single-agent context limits constrain task complexity
- Tasks decompose naturally into parallel subtasks
- Different subtasks require different tool sets or system prompts
- Building systems that must handle multiple domains simultaneously
- Scaling agent capabilities beyond single-context limits
- Designing production agent systems with multiple specialized components
Do not activate this skill for adjacent work owned by other skills:
- Deciding task-model fit, pipeline shape, or project-level cost before topology is known: `project-development`.
- Designing hosted sandboxes, warm pools, remote sessions, or background runtime infrastructure: `hosted-agents`.
- Sharing orchestrator state through KV-cache compaction in controlled runtimes: `latent-briefing`.
- Designing the tools each agent exposes: `tool-design`.
## Core Concepts
Use multi-agent patterns when a single agent's context window cannot hold all task-relevant information. Context isolation is the primary benefit — each agent operates in a clean context without accumulated noise from other subtasks, preventing the telephone game problem where information degrades through repeated summarization.
Choose among three dominant patterns based on coordination needs, not organizational metaphor:
- **Supervisor/orchestrator** — Use for centralized control when tasks have clear decomposition and human oversight matters. A single coordinator delegates to specialists and synthesizes results.
- **Peer-to-peer/swarm** — Use for flexible exploration when rigid planning is counterproductive. Any agent can transfer control to any other through explicit handoff mechanisms.
- **Hierarchical** — Use for large-scale projects with layered abstraction (strategy, planning, execution). Each layer operates at a different level of detail with its own context structure.
Design every multi-agent system around explicit coordination protocols, consensus mechanisms that resist sycophancy, and failure handling that prevents error propagation cascades.
## Detailed Topics
### Why Multi-Agent Architectures
**The Context Bottleneck**
Reach for multi-agent architectures when a single agent's context fills with accumulated history, retrieved documents, and tool outputs to the point where performance degrades. Recognize three degradation signals: the lost-in-middle effect (attention weakens for mid-context content), attention scarcity (too many competing items), and context poisoning (irrelevant content displaces useful content).
Partition work across multiple context windows so each agent operates in a clean context focused on its subtask. Aggregate results at a coordination layer without any single context bearing the full burden.
**The Token Economics Reality**
Budget for substantially higher token costs. Production data shows multi-agent systems can cost far more tokens than single-agent chat (claim-multi-agent-token-multiplier):
| Architecture | Token Multiplier | Use Case |
|--------------|------------------|----------|
| Single agent chat | Baseline | Simple queries |
| Single agent with tools | Higher than baseline | Tool-using tasks |
| Multi-agent system | Much higher than baseline | Complex research/coordination |
Browsing-agent evaluation research suggests token usage, tool calls, and model choice dominate performance variance (claim-evaluation-browsecomp-variance). This supports measuring multi-agent setups against single-agent baselines instead of assuming extra agents help.
Prioritize model selection alongside architecture design — upgrading to better models often provides larger performance gains than doubling token budgets. BrowseComp data shows that model quality improvements frequently outperform raw token increases. Treat model selection and multi-agent architecture as complementary strategies.
**The Parallelization Argument**
Assign parallelizable subtasks to dedicated agents with fresh contexts rather than processing them sequentially in a single agent. A research task requiring searches across multiple independent sources, analysis of different documents, or comparison of competing approaches benefits from parallel execution. Total real-world time approaches the duration of the longest subtask rather than the sum of all subtasks.
**The Specialization Argument**
Configure each agent with only the system prompt, tools, and context it needs for its specific subtask. A general-purpose agent must carry all possible configurations in context, diluting attention. Specialized agents carry only what they need, operating with lean context optimized for their domain. Route from a coordinator to specialized agents to achieve specialization without combinatorial explosion.
### Architectural Patterns
**Pattern 1: Supervisor/Orchestrator**
Deploy a central agent that maintains global state and trajectory, decomposes user objectives into subtasks, and routes to appropriate workers.
```
User Query -> Supervisor -> [Specialist, Specialist, Specialist] -> Aggregation -> Final Output
```
Choose this pattern when: tasks have clear decomposition, coordination across domains is needed, or human oversight is important.
Expect these trade-offs: strict workflow control and easier human-in-the-loop interventions, but the supervisor context becomes a bottleneck, supervisor failures cascade to all workers, and the "telephone game" problem emerges where supervisors paraphrase sub-agent responses incorrectly.
**The Telephone Game Problem and Solution**
Anticipate that supervisor architectures initially perform approximately 50% worse than optimized versions due to the telephone game problem (LangGraph benchmarks). Supervisors paraphrase sub-agent responses, losing fidelity with each pass.
Fix this by implementing a `forward_message` tool that allows sub-agents to pass responses directly to users:
```python
def forward_message(message: str, to_user: bool = True):
"""
Forward sub-agent response directly to user without supervisor synthesis.
Use when:
- Sub-agent response is final and complete
- Supervisor synthesis would lose important details
- Response format must be preserved exactly
"""
if to_user:
return {"type": "direct_response", "content": message}
return {"type": "supervisor_input", "content": message}
```
Prefer swarm architectures over supervisors when sub-agents can respond directly to users, as this eliminates translation errors entirely.
**Pattern 2: Peer-to-Peer/Swarm**
Remove central control and allow agents to communicate directly based on predefined protocols. Any agent transfers control to any other through explicit handoff mechanisms.
```python
def transfer_to_agent_b():
return agent_b # Handoff via function return
agent_a = Agent(
name="Agent A",
functions=[transfer_to_agent_b]
)
```
Choose this pattern when: tasks require flexible exploration, rigid planning is counterproductive, or requirements emerge dynamically and defy upfront decomposition.
Expect these trade-offs: no single point of failure and effective breadth-first scaling, but coordination complexity increases with agent count, divergence risk rises without a central state keeper, and robust convergence constraints become essential.
Define explicit handoff protocols with state passing. Ensure agents communicate their context needs to receiving agents.
**Pattern 3: Hierarchical**
Organize agents into layers of abstraction: strategy (goal definition), planning (task decomposition), and execution (atomic tasks).
```
Strategy Layer (Goal Definition) -> Planning Layer (Task Decomposition) -> Execution Layer (Atomic Tasks)From muratcankoylan/Agent-Skills-for-Context-Engineering, MIT.
More from muratcankoylan/Agent-Skills-for-Context-Engineering
- 0.865score
context-optimization
muratcankoylan
This skill should be used for improving context efficiency: context budgeting, observation masking, prefix or KV-cache strategy, partitioning, token-cost…
SkillAFreshness: A★ 18.2KClaude Code +9 - 0.858score
context-engineering-collection
muratcankoylan
A comprehensive collection of Agent Skills for context engineering, harness engineering, multi-agent architectures, and production agent systems.
SkillAFreshness: A★ 18.2KClaude Code +9 - 0.821score
CLAUDE.md · muratcankoylan/Agent-Skills-for-Context-Engineering
muratcankoylan
CLAUDE.md from muratcankoylan/Agent-Skills-for-Context-Engineering: 131 lines covering Project Overview, Repository Structure, Build & Test Commands, Skill…
TemplateAFreshness: A★ 18.2KClaude Code - 0.818score
AGENTS.md · muratcankoylan/Agent-Skills-for-Context-Engineering
muratcankoylan
AGENTS.md from muratcankoylan/Agent-Skills-for-Context-Engineering: 47 lines covering Learned User Preferences, Learned Workspace Facts, Repository Operating…
TemplateAFreshness: A★ 18.2KCodex +5 - 0.765score
context-fundamentals
muratcankoylan
This skill should be used to explain or reason about the foundational concepts of context engineering: what context is, the anatomy of a context window, how…
SkillCFreshness: C★ 18.2KClaude Code +9 - 0.761score
book-sft-pipeline
muratcankoylan
This skill should be used for book-to-SFT pipelines: ePub extraction, literary segmentation, author-voice dataset construction, style-transfer training, LoRA…
SkillCFreshness: C★ 18.2KClaude Code +9 - 0.761score
advanced-evaluation
muratcankoylan
This skill should be used for advanced LLM evaluation: LLM-as-judge systems, direct scoring, pairwise comparison, rubric calibration, evaluator bias…
SkillCFreshness: C★ 18.2KClaude Code +9 - 0.761score
context-degradation
muratcankoylan
This skill should be used for diagnosing and mitigating context degradation: lost-in-middle failures, context poisoning, context clash, context confusion…
SkillCFreshness: C★ 18.2KClaude Code +9 - 0.761score
evaluation
muratcankoylan
This skill should be used when building agent evaluation systems: deterministic checks, regression suites, multi-dimensional rubrics, quality gates…
SkillCFreshness: C★ 18.2KClaude Code +9 - 0.751score
reasoning-trace-optimizer
muratcankoylan
Debug and optimize AI agents by analyzing reasoning traces, context degradation, tool confusion, instruction drift, repeated task failures, and performance…
SkillCFreshness: C★ 18.2KClaude Code +9 - 0.730score
self-managed-context
muratcankoylan
This skill should be used when a model gets read-write control over its own live context window instead of a harness-scheduled compaction policy: the context…
SkillAFreshness: A★ 18.2KClaude Code +9 - 0.730score
self-improvement-loops
muratcankoylan
This skill should be used when the harness, scaffold, workflow, or optimizer itself is the optimization target: recursive self-improvement (RSI) loops…
SkillAFreshness: A★ 18.2KClaude Code +9
Signals
- Stars
- 18,201
- Forks
- 1,505
- Open issues
- 16
- Last commit (this folder)
- Jun 29, 2026 (4 months ago)
- Last release
- May 22, 2026 (5 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- 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.
More from muratcankoylan
- 0.865score
context-optimization
muratcankoylan
This skill should be used for improving context efficiency: context budgeting, observation masking, prefix or KV-cache strategy, partitioning, token-cost…
SkillAFreshness: A★ 18.2KClaude Code +9 - 0.858score
context-engineering-collection
muratcankoylan
A comprehensive collection of Agent Skills for context engineering, harness engineering, multi-agent architectures, and production agent systems.
SkillAFreshness: A★ 18.2KClaude Code +9 - 0.821score
CLAUDE.md · muratcankoylan/Agent-Skills-for-Context-Engineering
muratcankoylan
CLAUDE.md from muratcankoylan/Agent-Skills-for-Context-Engineering: 131 lines covering Project Overview, Repository Structure, Build & Test Commands, Skill…
TemplateAFreshness: A★ 18.2KClaude Code - 0.818score
AGENTS.md · muratcankoylan/Agent-Skills-for-Context-Engineering
muratcankoylan
AGENTS.md from muratcankoylan/Agent-Skills-for-Context-Engineering: 47 lines covering Learned User Preferences, Learned Workspace Facts, Repository Operating…
TemplateAFreshness: A★ 18.2KCodex +5 - 0.765score
context-fundamentals
muratcankoylan
This skill should be used to explain or reason about the foundational concepts of context engineering: what context is, the anatomy of a context window, how…
SkillCFreshness: C★ 18.2KClaude Code +9 - 0.761score
advanced-evaluation
muratcankoylan
This skill should be used for advanced LLM evaluation: LLM-as-judge systems, direct scoring, pairwise comparison, rubric calibration, evaluator bias…
SkillCFreshness: C★ 18.2KClaude Code +9
Cite this page
multi-agent-patterns skill. Agent Mart. https://agentmart.dev/skills/muratcankoylan-multi-agent-patterns (last updated 2026-10-24)