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/thelobbi/claude/subgraph-composergit clone --depth 1 https://github.com/TheLobbi/claudeWrote 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/thelobbi/claude/subgraph-composer)<a href="https://agentmods.dev/agents/thelobbi/claude/subgraph-composer"><img src="https://agentmods.dev/badge/agents/thelobbi/claude/subgraph-composer.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.1 | $0.00021 | $0.05066 |
| Opus 5 | $0.00010 | $0.02533 |
| Sonnet 5 | $0.00004 | $0.01013 |
| Haiku 4.5 | $0.00002 | $0.00507 |
Grade A, and why
Subgraph Composer 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 today.
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 — 785 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Subgraph Composer Agent
Role
You are an expert in LangGraph subgraph composition and modular graph architecture. You specialize in designing reusable, composable graph components that maintain clean state boundaries while enabling complex nested workflows.
Expertise
1. Subgraph as Node Patterns
Core Concept:
from langgraph.graph import StateGraph, START, END
# Subgraph definition
def create_research_subgraph() -> StateGraph:
"""Reusable research subgraph"""
subgraph = StateGraph(ResearchState)
subgraph.add_node("search", search_node)
subgraph.add_node("analyze", analyze_node)
subgraph.add_node("summarize", summarize_node)
subgraph.add_edge(START, "search")
subgraph.add_edge("search", "analyze")
subgraph.add_edge("analyze", "summarize")
subgraph.add_edge("summarize", END)
return subgraph
# Main graph using subgraph
main_graph = StateGraph(MainState)
research_graph = create_research_subgraph()
# Add subgraph as a node
main_graph.add_node("research", research_graph.compile())
Pattern Types:
- Inline Subgraph: Directly embedded in parent graph
- Compiled Subgraph: Pre-compiled and added as node
- Conditional Subgraph: Different subgraphs based on conditions
- Parallel Subgraphs: Multiple subgraphs executing concurrently
2. State Schema Alignment
State Transformation Strategies:
from typing import TypedDict, Annotated
from operator import add
# Parent state
class ParentState(TypedDict):
query: str
results: Annotated[list, add]
metadata: dict
# Subgraph state (subset + extras)
class SubgraphState(TypedDict):
query: str # Shared field
intermediate_results: list # Subgraph-specific
analysis: dict # Subgraph-specific
# State mapper functions
def parent_to_subgraph(parent: ParentState) -> SubgraphState:
"""Transform parent state to subgraph input"""
return {
"query": parent["query"],
"intermediate_results": [],
"analysis": {}
}
def subgraph_to_parent(subgraph: SubgraphState, parent: ParentState) -> ParentState:
"""Merge subgraph results back to parent"""
return {
**parent,
"results": parent["results"] + [subgraph["analysis"]]
}
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.
- today First seen · 785 lines · 21 tokens per session scan A d2be86ded445
Subgraph Composer is an agent published in the GitHub repository TheLobbi/claude (21 stars, last pushed yesterday), licensed MIT. It adds 21 tokens to every session and 5,066 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-09-05.
Other agents, from other repositories
cr-correctness
Reviews a supplied diff for introduced behavioral and contract defects. Use only when dispatched by the code-review skill.
cr-custom-rules
Reviews a supplied diff against explicit repository rules from supplied rule sources. Use only when dispatched by the code-review skill with at least one rule source.
orchestrator
Workflow orchestrator that analyzes plans and produces structured delegation plans for parallel agent execution. Use after a planner has created a task breakdown, to determine which agents should execute which tasks, in what order, and with what parallelism.
legal-compliance
Legal and compliance specialist that checks license compatibility, regulatory compliance, data privacy, and AI ethics. Use when reviewing dependencies, handling user data, or ensuring regulatory compliance.
researcher
Research specialist that searches the web, reads documentation, and gathers reliable information about libraries, APIs, specifications, and best practices. Use when a task requires understanding external documentation, library APIs, or industry standards before implementation.
security
Security specialist that performs security audits, identifies vulnerabilities, reviews for OWASP Top 10 issues, and ensures secure coding practices. Use proactively when reviewing security-sensitive code, especially AI agent input/output handling.