Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add agents/dsswift/ion/hierarchiesgit clone --depth 1 https://github.com/dsswift/ionWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/agents/dsswift/ion/hierarchies)<a href="https://agentmods.dev/agents/dsswift/ion/hierarchies"><img src="https://agentmods.dev/badge/agents/dsswift/ion/hierarchies.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00011 | $0.00560 |
| Opus 5 | $0.00005 | $0.00280 |
| Sonnet 5 | $0.00002 | $0.00112 |
| Haiku 4.5 | $0.00001 | $0.00056 |
Grade A, and why
hierarchies scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 83 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Agent Hierarchies
Agents form a directed graph through the parent frontmatter field. The engine builds this graph during discovery and validates it before any agent runs.
Parent-child model
An agent declares its parent by name:
---
name: css-specialist
parent: frontend-reviewer
---
This creates an edge from frontend-reviewer to css-specialist. The parent can delegate tasks to its children, and the children inherit context about the parent's domain.
Graph structure
The AgentGraph holds all discovered agents and their relationships:
type AgentGraph struct {
Agents map[string]*AgentDef // name -> definition
Children map[string][]string // parent name -> child names
Roots []string // agents with no parent
}
- Roots are agents with no
parentfield (or an empty one). They appear at the top of any hierarchy listing. - Children are sorted alphabetically for deterministic output.
Unknown parents
If an agent references a parent that was not discovered, the engine treats it as a root agent and logs a warning:
agent "css-specialist" references parent "frontend-reviewer" which was not found
The agent still loads and functions normally. It just won't appear as a child in any hierarchy.
Cycle detection
The engine uses DFS coloring (white/gray/black) to detect cycles before the graph is finalized. If a cycle exists, discovery returns an error and no agents from that graph are loaded.
Example cycle:
agent-a (parent: agent-c)
agent-b (parent: agent-a)
agent-c (parent: agent-b)
This produces:
cycle detected: agent-a -> agent-b -> agent-c -> agent-a
The cycle path is included in the error message to help you identify which parent field to fix.
Runtime agent registry
During a session, spawned agents are tracked in an in-memory registry (agentRegistry). This is separate from the discovery graph. The registry tracks:
- Agent name
- Process ID
- Parent agent name (for subprocess trees)
- Stdin write function (for steering)
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 3d ago First seen · 83 lines · 11 tokens per session scan A f9139bd663e7
hierarchies is an agent published in the GitHub repository dsswift/ion (4 stars, last pushed 3d ago), licensed MIT. It adds 11 tokens to every session and 560 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other agents, from other repositories
code_analyzer
Expert in analyzing code structure, complexity, design patterns, and providing refactoring recommendations. Uses CAST (Code Abstract Syntax Tree) tools for deep code understanding.
report_writer
Expert in synthesizing information from multiple sources into well-structured, professional reports. Specializes in technical documentation and analysis summaries.
web_searcher
Expert in searching and retrieving technical documentation, best practices, and relevant resources from the web. Synthesizes findings from multiple sources.
document_agent
Minimal example for creating and using AI Agents with aworld-cli.
building-agents
Create intelligent agents that connect to MCP servers, discover tools automatically, and execute tasks with full observability.
reasoning-patterns
Every Promptise agent is powered by a Reasoning Graph. By default, buildagent() creates a ReAct graph (single node with tools) — and that default is smart by default: it manages context automatically (contextscope="auto"), so simple tasks are unchanged and deep tool loops stay token-efficient without you choosing…