katas-hub-and-spoke-isolation

Implements hub-and-spoke multi-agent isolation using AgentDefinition and the built-in Agent dispatch tool.

Updated Jun 28, 2026
One-click install
npx skills add https://github.com/JaviMontano/claude-plugins --skill katas-hub-and-spoke-isolation-javimontano
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: katas-hub-and-spoke-isolation
Source: https://github.com/JaviMontano/claude-plugins/tree/main/plugins/claude-native-toolkit/skills/katas-hub-and-spoke-isolation
Command: npx skills add https://github.com/JaviMontano/claude-plugins --skill katas-hub-and-spoke-isolation-javimontano

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Multi-agent designs that concatenate the coordinator's full history into a single agent dilute model attention, leak policies across tasks, inflate cost by running everything on an expensive model, and widen the blast radius of prompt injection. This kata teaches structural isolation so each subagent starts with an empty context, its own tools, and its own model. ## Core Features & Use Cases - Structural subagent isolation: Register subagents as AgentDefinition entries in ClaudeAgentOptions.agents and dispatch them via the built-in Agent tool, so every dispatch opens a fresh session with its own system_prompt, tools, and model. - Per-subagent model and tool assignment: Run cheap extraction on haiku with tools=[] while reserving the expensive model for coordinator synthesis, and receive only each subagent's final message as a tool_result. - Use Case: In a Multi-Agent Research scenario over 30 documents, dispatch one isolated extractor subagent per document so a poisoned document contaminates only its own session while the coordinator aggregates just the extracted facts. ## Quick Start Ask the assistant to redesign your multi-agent research pipeline so each document is processed by an isolated extractor subagent registered with AgentDefinition and dispatched via the Agent tool.

Frequently Asked Questions about katas-hub-and-spoke-isolation

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I isolate subagents in a multi-agent Claude Code design?▼

Register each subagent as an AgentDefinition with its own description, prompt, tools, and model inside ClaudeAgentOptions.agents, then dispatch via the built-in Agent tool. Each dispatch opens a fresh session, so the subagent never inherits the coordinator's history.

How do I use a cheaper model for subagent tasks?▼

Set model="haiku" on the AgentDefinition for extraction-style tasks and reserve the expensive model for coordinator synthesis. Because each AgentDefinition carries its own model field, cost is controlled per subagent rather than globally.

Should I use Agent or Task as the dispatch tool name?▼

Current Claude Code and agent-sdk runtimes expose the built-in dispatch tool as Agent, while older SDK versions called it Task. Verify the installed runtime before fixing allowed_tools, since the name is version-dependent.

Does hub-and-spoke isolation limit prompt injection damage?▼

Yes. Because each Agent dispatch is a structurally separate session with least-privilege tools, a poisoned document only contaminates its own subagent session. The coordinator receives only that subagent's final message, not its internal history.

When should I not use hub-and-spoke subagent isolation?▼

Avoid it for single-agent tasks with no independent subtasks, such as drafting one short email. It is also wrong to simulate isolation by concatenating all context into one agent and relying on a system prompt, which is the canonical anti-pattern.