dag-map — Claude Code skill: visualize agent orchestration graph
dag-map renders the multi-agent orchestration graph for a session: parent-child relationships, depth layers, and fan-out. Use it to understand how agents branch and nest within a session.
MIT ★ 1,198 updated 2026-10-23
/plugin marketplace add hoangsonww/Claude-Code-Agent-Monitor
/plugin install ccam-workflows@claude-code-agent-monitor-pluginsWhat dag-map does
dag-map pulls orchestration data from the Agent Monitor workflow API—parent→child edges, agent depth, and fan-out counts—and generates a full topology report. The output includes a summary (root agent, total count, max depth, max fan-out), an edge list grouped by depth, a table of depths with fan-out metrics, and an ASCII tree rendering of the structure.
The skill cross-checks consistency: it compares the orchestration graph against raw agent records and session details to catch orphan nodes (edges pointing to missing agents). For a single-agent session with no subagents, it reports that plainly instead of fabricating a tree.
If the monitor dashboard is unreachable, the skill suggests starting it with npm start from the repo root.
What it helps with
- see the subagent hierarchy within a Claude Code session
- check orchestration depth and maximum fan-out per parent
- find orphan nodes—agents in parent-child pairs without records
- validate orchestration data against raw agent records
- export the agent structure as an ASCII tree for reports
Example prompts for the agent
- Show me the agent graph for session
550e8400-e29b-41d4-a716-446655440000 - Visualize the dag for my last session
- Check orchestration structure and verify agent node counts
How to install dag-map
1Plugin marketplace
/plugin marketplace add hoangsonww/Claude-Code-Agent-Monitor/plugin install ccam-workflows@claude-code-agent-monitor-pluginsThis installs the whole ccam-workflows plugin with all its skills
2Skills CLI (Vercel)
npx skills add hoangsonww/Claude-Code-Agent-Monitor --skill dag-map -a claude-code3Manually: put the files in place
~/.claude/skills/dag-map/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/dag-map/
1Skills CLI (Vercel)
npx skills add hoangsonww/Claude-Code-Agent-Monitor --skill dag-map -a codex2Manually: put the files in place
.agents/skills/dag-map/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add hoangsonww/Claude-Code-Agent-Monitor --skill dag-map -a cursor2Manually: put the files in place
.cursor/skills/dag-map/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install hoangsonww/Claude-Code-Agent-Monitor plugins/ccam-workflows/skills/dag-map2Manually: put the files in place
.github/skills/dag-map/SKILL.md1Skills CLI (Vercel)
npx skills add hoangsonww/Claude-Code-Agent-Monitor --skill dag-map -a gemini-cli2Platform CLI
gemini skills install https://github.com/hoangsonww/Claude-Code-Agent-Monitor --path plugins/ccam-workflows/skills/dag-mapManually: put the files in place
.devin/skills/dag-map/SKILL.mdThe legacy .windsurf/skills/ path still works
Claude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about dag-map
How do I install dag-map in Claude Code?
Run /plugin marketplace add hoangsonww/Claude-Code-Agent-Monitor, then /plugin install ccam-workflows@claude-code-agent-monitor-plugins. Next, execute npx skills add hoangsonww/Claude-Code-Agent-Monitor --skill dag-map -a claude-code. The skill will be available at ~/.claude/skills/dag-map/SKILL.md.
What does dag-map display?
A directed acyclic graph of agent orchestration: root agent, total agent count, maximum nesting depth, all parent→child edges grouped by layer, and fan-out metrics (children per parent). Also includes an ASCII tree for quick visual inspection.
What if the monitor dashboard is not running?
Start it by running npm start from the root of the Claude-Code-Agent-Monitor repository. dag-map fetches data from the monitoring API, so the dashboard must be accessible.
Source text
SKILL.md · MIT
---
name: dag-map
description: >
Render the multi-agent orchestration DAG for a session — parent→child
subagent edges, tree depth, and fan-out — from the Agent Monitor workflow
intelligence API. Cross-checks the orchestration dataset against the raw
agent records and session detail. Use when visualizing how a session's agent
structure was organized.
---
# DAG Map
Render the subagent orchestration graph for one Claude Code session as a depth-ordered DAG.
## Input
The user provides: **$ARGUMENTS**
A session ID. If empty, fetch `GET /api/sessions?limit=1` and use the most recent session, stating which one you picked.
## Data Sources
| Endpoint | Returns |
|----------|---------|
| `GET /api/workflows/{sessionId}` | The `orchestration` dataset: DAG nodes (agent id, type, model, status, depth) and parent→child edges |
| `GET /api/agents` | Raw subagent records (`status`, `type`, `depth`, `parent`) to cross-check node/edge counts |
| `GET /api/sessions/{sessionId}` | Full session detail with nested `agents[]` to confirm the root and total agent count |
## Report Sections
### 1. Topology Summary
From `orchestration`: the root agent, total agent count, max depth, and max fan-out (most children under any one parent). Confirm the agent count against `/api/agents` filtered to this session.
### 2. Edge List
Every parent→child edge, grouped by depth, formatted as:
`depth d: parent[model] → child[type, status]`
Mark leaf agents (no children) and any orphan nodes (a `parent` that is not present in the node set).
### 3. Depth & Fan-out Table
| Depth | Agents at depth | Children spawned | Avg fan-out |
|-------|-----------------|------------------|-------------|
### 4. ASCII Tree
A simple indented tree rendering of the DAG, e.g.:
```
root [opus, completed]
├─ explore [sonnet, completed]
└─ code-review [sonnet, error]
└─ debugger [sonnet, completed]
```
## Output
- Render as Markdown tables plus one fenced ASCII tree block.
- Cite real node and edge counts from the API — never invent agents or edges.
- If a session has no subagents, say so plainly (single-agent session, depth 0) instead of fabricating a tree.
- If the dashboard is unreachable, tell the user to start it with `npm start` from the repo root.
© Son Nguyen · MIT · hoangsonww/Claude-Code-Agent-Monitor