You describe the swarm. HiveSmith forges it.
Archived on 2026-11-10. HiveSmith is complete and no longer maintained. v1.3.0 is the final release, verified against Claude Code v2.1.296; later Claude Code and model releases are not tracked, so check the generated files against the current documentation before relying on them. Much of what HiveSmith automated can now be done with Claude Code's built-in sub-agents and dynamic workflows. The code stays available under the Apache 2.0 license.
A meta-agent system that designs and generates production-ready agent swarms, sized to the work: from a single well-tooled agent to an orchestrator with specialised workers. Built for the Claude Code CLI ecosystem.
You describe what you need. HiveSmith researches the domain, architects the agent hierarchy, writes every prompt and config file, validates the topology, and delivers a working swarm β ready to run with claude.
HiveSmith β the smith that forges hives. Sister project of SwarmForge (the Gemini/Antigravity edition): same lineage, rebuilt from the ground up on Claude Code's native primitives: sub-agents, auto-loaded rules, and project MCP config. HiveSmith has since moved to a leaner pipeline with fewer agents.
HiveSmith is itself a swarm. An orchestrator (CLAUDE.md) coordinates 15 specialized sub-agents β each a real Claude Code sub-agent with its own isolated context window, tool allowlist, and model tier β through a clarifying step plus six working steps:
0. Clarify β Ask about missing constraints that change the design (skipped when the request is explicit)
1. Research β Launch only the researchers the request needs, in parallel; save their reports as files
2. Architecture β Read the raw reports, resolve conflicts, design the blueprint (roster, tiers, state, hooks)
3. Infrastructure & Safety β Safety rules + guard hooks; MCP config and custom tools only when the blueprint needs them
4. Persona Generation β Write CLAUDE.md, .claude/agents/*.md, rules, settings and the operator README to disk
5. Verification β Fresh-context evaluators audit prompts, schemas, dependencies and the DAG in parallel
6. Delivery β Hand the verified swarm tree to the user
If verification finds issues, the orchestrator routes each one back to the agent that wrote the file and re-verifies what changed, for at most three rounds; anything left is delivered as a named risk. The user's request travels verbatim to every worker; research reports travel as file paths, never as compressed summaries.
-
Fewest Agents the Work Justifies. Multi-agent systems typically spend 3-10x the tokens of a single agent on the same task, and splitting one body of work into sequential phases loses context at every handoff. So every agent in a generated swarm must stand on a stated ground β context isolation, genuinely parallel work, or a specialization threshold β and there is no target roster size; a single well-tooled agent with rules and hooks is a valid result. Generated instruction files keep only what the model cannot infer on its own, without stacked CRITICAL/MUST emphasis or role inflation (Rule 09).
-
Native Claude Code Sub-Agents. Every worker persona is a
.claude/agents/<name>.mdfile with the official frontmatter schema (name,description,tools,model, plus advanced keys βeffort,maxTurns,memoryβ where the role justifies them). The orchestrator delegates through Claude Code's Agent tool, so each worker runs in an isolated context window with a least-privilege tool allowlist enforced by the harness itself β researchers can search but not write, and validators get no write tools (for the two that keep persistent memory,qa-validatorandprompt-evaluator, Claude Code adds file tools for that memory, so their read-only scope rests on their instructions). -
Deterministic Guard Hooks. The Destructive Action Barrier is not just prose: a
PreToolUsehook (.claude/hooks/block-destructive.py, on the Bash and PowerShell tools) deterministically blocksrm -rf,mkfs, force-pushes, SQLDROPs, and cloud resource deletions before they run, including forms hidden inbash -c,eval, subshells or a quoted command name, and it fails closed (onFailure: block) if it cannot run. Generated swarms ship the same layers β a rules file for context, a domain-tailored guard hook, and permission deny and ask rules β plus scoped credentials and, where agents run commands on untrusted content, Claude Code's sandbox, because a pattern guard is a tripwire against mistakes, not a security boundary. -
Tier-Based Model Routing with a Budget. HiveSmith assigns models using Claude aliases (
fable,opus,sonnet,haiku) based on cognitive load. In a generated swarm, heavy reasoning and architecture can getfable(Fable 5.1), orchestration and complex coding getopus(Opus 5.5), research and most workers getsonnet(Sonnet 5.5), and fast lookups and scanning gethaiku(Haiku 5.5). When Anthropic ships new models, the aliases resolve to the latest versions automatically. Generated swarms run on your subscription, so they follow a hard tier budget: anopusorchestrator,sonnetworkers by default,haikufor mechanical roles,opusworkers only with benchmark evidence, at most onefableagent, and nevereffort: maxβ the QA gate rejects rosters that break it. Effort is left at each model's official default unless the blueprint sets one (Opus 5.5, Sonnet 5.5 and Haiku 5.5 default tomedium, so verification and research roles in a generated swarm carryeffort: highon every tier, and mechanicalhaikuroles carryeffort: low; a generatedsettings.jsonmay carryeffortLevel: highwhen the domain justifies it, and you can cap everything withmaxEffortLevel). You can always edit the generatedsettings.jsonand agent frontmatter by hand afterwards. Operators can still re-route everything at launch withCLAUDE_CODE_SUBAGENT_MODEL(default for agents without amodel) plusCLAUDE_CODE_SUBAGENT_MODEL_FORCE=1(makes it override every definition). -
Research Before Architecture. Every generated swarm can research its own domain, through dedicated researcher agents or, in a single-agent design, the orchestrator's own search tools. HiveSmith never relies on pre-trained knowledge for domain-specific decisions. It searches the web first, every time β via Claude Code's native
WebSearch/WebFetchtools, with an optional tokenless duckduckgo-mcp-server fallback in.mcp.json. -
Strict, Fresh-Context Verification. The
qa-validatorchecks the generated frontmatter schemas against Claude Code's real spec (and rejects foreign fields), enforces the tier budget, confirms every hook script and state file exists, runs dependency pre-flights (uv,npx), and validates directory structure;prompt-evaluatoraudits the prompts for measured anti-patterns and outdated prompting;dag-validatorchecks the delegation graph. None of them sees the authors' reasoning.
All 15 sub-agents live in .claude/agents/:
| Agent | Role | Default Tier |
|---|---|---|
domain-architect |
Reconciles the research and designs the blueprint: roster, tiers, shared state, hooks | Fable |
persona-engineer |
Writes all system prompts (CLAUDE.md, .claude/agents/*.md) | Fable |
prompt-evaluator |
Simulates edge cases and audits generated prompts for anti-patterns | Fable |
safety-engineer |
Generates domain-specific safety rules | Fable |
tool-smith |
Builds custom scripts when standard MCP tools aren't enough | Fable |
mcp-integrator |
Generates the project-root .mcp.json for the target swarm |
Opus |
dag-validator |
Validates swarm topology β detects cycles, orphan agents, broken links | Opus |
researcher-google-cloud |
Google Cloud, Gemini best practices | Opus |
researcher-anthropic-openai |
Anthropic & OpenAI multi-agent patterns | Opus |
researcher-tech-stack |
Version verification, deprecation checks | Opus |
researcher-security |
OWASP, HITL, guardrail best practices | Opus |
researcher-academic-independent |
arXiv, independent AI research blogs | Opus |
researcher-vcs-github |
Mines GitHub/GitLab for existing agent configs | Opus |
repo-analyzer-worker |
Concurrent read-only scanning of cloned repos or your existing codebase | Sonnet |
qa-validator |
Schema validation, dependency checks, pass/fail reporting | Sonnet |
"Default Tier" is set in each agent's
model:frontmatter and applied automatically by Claude Code. HiveSmith's own roster is deliberately generously tiered β it is a creator, and the quality of what it forges is worth the tokens. Thehaikutier remains part of the routing doctrine for the swarms HiveSmith generates.
HiveSmith is powered by Claude Code.
1. Prerequisites:
- Claude Code CLI β installed and authenticated (
claudecommand available). Version 2.1.296 is recommended, since the doctrine is verified against it (per-calleffortneeds 2.1.292, theautoCompactWindowkey 2.1.296); 2.1.280 is the floor for the core features (theopusalias resolving to Opus 5.5, theomitClaudeMdfrontmatter key,maxEffortLevel, partialmaxTurnsresults,SubagentStophooks, theexperimental.cacheTtlkey, and the project-settingsdefaultModebehaviour the QA gate checks). Thesonnetalias resolves to Sonnet 5.5 only on 2.1.284 or newer and on the Anthropic API (older versions and other providers resolve an earlier Sonnet), and thehaikualias resolves to Haiku 5.5 only on 2.1.293 or newer and on the Anthropic API (elsewhere it resolves to Haiku 4.5, which has no effort support, so ahaikuagent'seffortkey has no effect there). The fail-closed guard (onFailure: block) needs 2.1.295 or newer; on older versions the setting is not available and a guard that cannot start lets the command through. HiveSmith was verified against v2.1.296. - Python 3, reachable as
python3onPATHβ runs theblock-destructive.pyguard hook. Without it, every Bash and PowerShell command is blocked (fail-closed). - uv β optional, only for the
uvxDuckDuckGo MCP fallback (pinned to a reviewed version in.mcp.json)
2. Clone this repository:
git clone https://github.com/Sh3rm/HiveSmith.git
cd HiveSmith3. Boot the swarm:
claude "Build me a Kubernetes monitoring swarm with Prometheus and Grafana integration"That's it. HiveSmith will research the domain, architect the agent hierarchy, write every prompt and config file, validate the output, and deliver a working swarm into your target directory.
Model configuration is automatic. The default model is set in
.claude/settings.json, and each sub-agent'smodel:frontmatter uses Claude aliases (fable,opus,sonnet,haiku) that automatically resolve to the latest available versions (currently Fable 5.1, Opus 5.5, Sonnet 5.5, Haiku 5.5 on the Anthropic API; other providers may resolve earlier versions). You don't need to edit model names manually. Doctrine last verified against Claude Code v2.1.296 and its changelog (2026-10-12).
Optional check after hand edits. On Claude Code 2.1.283 or newer,
/doctor prompt-auditauditsCLAUDE.md, agents, skills and commands for prompt patterns written for older models β useful after you customise HiveSmith or a generated swarm.
File access is native. Claude Code's built-in
Read/Write/Edit/Bashtools (governed by its permission system) handle all filesystem work β no filesystem MCP server is needed or used.
HiveSmith/
βββ CLAUDE.md # Orchestrator system prompt (plain markdown)
βββ README.md
βββ LICENSE
βββ .gitignore
βββ .mcp.json # Project-scoped MCP servers (optional search fallback)
βββ research-archive/ # Frozen research corpus from past generation runs (not live config)
βββ .claude/
βββ settings.json # Default model, MCP allowlist + guard-hook wiring
βββ hooks/
β βββ block-destructive.py # PreToolUse guard: deterministic Destructive Action Barrier
βββ rules/ # Auto-loaded global rules
β βββ 01-web-search-mandatory.md
β βββ 02-destructive-action-barrier.md
β βββ 03-agent-as-code-standard.md
β βββ 04-prompt-injection-shield.md
β βββ 05-idempotency-and-state.md
β βββ 06-human-in-the-loop.md
β βββ 07-conflict-resolution.md
β βββ 08-blueprint-schema.md
β βββ 09-swarm-quality-doctrine.md
βββ agents/ # 15 sub-agent definitions
βββ dag-validator.md
βββ domain-architect.md
βββ mcp-integrator.md
βββ persona-engineer.md
βββ prompt-evaluator.md
βββ qa-validator.md
βββ repo-analyzer-worker.md
βββ researcher-academic-independent.md
βββ researcher-anthropic-openai.md
βββ researcher-google-cloud.md
βββ researcher-security.md
βββ researcher-tech-stack.md
βββ researcher-vcs-github.md
βββ safety-engineer.md
βββ tool-smith.md
Generated swarms follow the same layout: a plain-markdown CLAUDE.md orchestrator, sub-agents in .claude/agents/, auto-loaded rules in .claude/rules/, model config in .claude/settings.json, and β only when external capabilities are needed β a project-root .mcp.json. When a swarm's core job is a repeatable fan-out with cross-verification, it can also ship a saved dynamic workflow in .claude/workflows/.
All agents (both HiveSmith's own and any it generates) operate under 9 global rules:
- Web Search Mandatory β No hallucinated packages, versions, or configs
- Destructive Action Barrier β No
rm -rf,DROP TABLE, or cloud deletions without human approval; enforced by a fail-closedPreToolUseguard hook and permission rules, with scoped credentials and the sandbox as the real bound - Agent-as-Code Standard β The canonical Claude Code schema: file formats, frontmatter keys, context inheritance, hooks doctrine, coordination mechanisms (hub-and-spoke by allowlist, agent teams, dynamic workflows), model routing and the generated-swarm tier budget β single source of truth for the whole workspace
- Prompt Injection Shield β All external inputs treated as untrusted; no generated agent combines untrusted input, private data and an outbound or state-changing tool (the Rule of Two); memory never stores unverified instructions
- Idempotency & State Safety β Operations must be safe to re-run
- Human-in-the-Loop β Agents pause and ask when facing critical ambiguity
- Conflict Resolution β Orchestrator resolves inter-agent disagreements; safety wins by default
- Blueprint Schema β Enforced JSON structure for all swarm blueprints, including per-agent decomposition justification, shared-state and hook sections
- Swarm Quality Doctrine β Anthropic's guidance and published research encoded as hard checks: single-agent justification, context-boundary (not phase) decomposition, ~200-line prompt budgets, verifier hardening, just-in-time context, instruction files written for current models
Contributions are welcome. If you have ideas for new agent types, improved safety rules, or better research strategies, feel free to open an issue or submit a pull request.
Apache 2.0 β See LICENSE for details.