con un clic
nested-subagents
Spawn nested sub-agents (agents that spawn sub-agents, up to depth=5) via Claude Code's native Task tool — for context-managed deep delegation
Menú
Spawn nested sub-agents (agents that spawn sub-agents, up to depth=5) via Claude Code's native Task tool — for context-managed deep delegation
Basado en la clasificación ocupacional SOC
One-command drift detection. Composes audit-list + oia-audit + audit-trend into a single primitive — finds the most recent audit in `metaharness-audit` namespace, runs a fresh audit against the current repo, diffs them via ADR-152 §3.1 similarity, and alerts when structural distance crosses `--threshold`. Iter 53 of ADR-150 deep integration.
ADR-152 — weighted similarity between two harness fingerprints (genome + score JSON). Returns overall score in [0,1] plus per-component breakdown (cosine over 9 numerics, categorical agreement over 4 enums, jaccard over agent_topology). Unblocks ADR-151 §3.2 Recommender, §3.3 Drift Detection, §3.5 Plugin Compat. Pure-TS, no `@metaharness/*` dep — preserves ADR-150's four architectural constraints.
Composite Phase-2 audit worker (ADR-150). Bundles harness oia-manifest + threat-model + mcp-scan into one timestamped audit record stored in the `metaharness-audit` memory namespace. Designed for cron-scheduled drift detection.
7-section repo readiness report from `metaharness genome <path>`. Returns repo_type / agent_topology / risk_score / mcp_surface / test_confidence / publish_readiness. Pure-read; degrades gracefully (ADR-150).
Static security scan of a harness's declared MCP surface via `harness mcp-scan <path>`. Reads `.mcp/servers.json` + `.harness/claims.json`. Pure-read, no dispatch. Exits 1 on findings at or above `--fail-on` severity.
Scaffold a custom AI agent harness via `metaharness new <name> --template <id> --host <id>`. Defaults to DRY-RUN (no writes) unless --confirm is passed. Refuses to write to the calling repo root or anywhere inside it. Honors ADR-150 architectural constraint + ruflo's "destructive-action confirmation" pattern.
| name | nested-subagents |
| description | Spawn nested sub-agents (agents that spawn sub-agents, up to depth=5) via Claude Code's native Task tool — for context-managed deep delegation |
| argument-hint | <problem-statement> |
| allowed-tools | Task TodoWrite Read Grep Glob Bash |
Spawn a tree of sub-agents where each child can itself spawn children, up to 5 levels deep. The motivation is context management, not parallelism: each level gets a fresh context window so deep work doesn't blow the top-level agent's context budget.
subagent_types and need their own specialized prompts (e.g., pii-detector at one leaf, tester at another).Skip this skill when flat fan-out (Task × N in one message) suffices — nesting adds latency.
Invoke the coordinator — spawn nested-coordinator as your top-level agent:
Task({
subagent_type: "nested-coordinator",
name: "root-coordinator",
description: "Decompose and delegate <problem>",
prompt: "<problem statement, with constraints and expected output shape>"
})
The coordinator decomposes first — it lays out the spawn tree via TodoWrite before any Task call. Inspect the tree before approving deep work.
Children spawn children — any nested-coordinator (or any other agent whose YAML frontmatter declares tools: [..., Task]) can itself call Task to spawn the next level. Leaf agents (without Task in their tools list) cannot.
Each level reports a summary — children return ~200-token structured summaries, not full transcripts. The whole point is to keep the parent's context clean.
Tree shape is persisted — the post-task hook writes parent_agent_id and depth to AgentDB on every spawn (ADR-147 P2). Query after the run for cost attribution and pattern learning.
| Source | Limit |
|---|---|
| Anthropic API | 5 levels (announced 2026-06-09) |
Ruflo default (pre-task hook) | 4 levels — one-level guard band, configurable in claude-flow.config.json |
| Strict-mode env var | CLAUDE_FLOW_STRICT_NESTING=true to enforce the ruflo cap |
The hook returns a typed NESTING_DEPTH_EXCEEDED error at the cap, with the full chain in the payload so the parent can decide to summarize, hand off, or abort.
parent_agent_id lineage gives accurate per-tree spend, not just flat per-agent.ruflo-sparc:sparc-orchestrator (5 phases ≈ 5 levels), ruflo-goals:dossier-investigator (recursive entity expansion), v3-queen-coordinator (hierarchical-mesh top).Task to leaf agents. Leaves must not spawn. Add the leaf's subagent_type directly under the coordinator instead.hooks_codemod) are depth-0 deterministic transforms — never put them inside a spawn tree.ruflo-agent:nested-coordinator — the orchestratorAuthScope.delegationDepth