Why Chained Agent Skills Break and the Three-Layer Fix That Holds
Deep skill chains overload an agent's context. Build with atoms, molecules and compounds instead, with examples for Claude Code, LangGraph, CrewAI and Agno.
This article is published in English.
Sources: Why AI Agent Skills Break When We Chain Them and the Three-Layer Fix
The more layers a chain of agent skills has, the more the agent forgets. A three-layer composition pattern keeps skills dependable at any depth, and it translates across Claude Code, LangGraph, CrewAI and Agno.
Why flat skill graphs fall apart
On paper the skill graph is attractive: link skills together, let the agent walk the graph and assemble capabilities as needed. A marketing skill calls a research skill, which calls a scraping skill, and you have an automated pipeline.
In practice it breaks, in Claude Code, Codex, Cursor and every other agent whose context window is finite.
Here is the mechanism. The agent loads only skill descriptions at first, which is enough to know what exists. The full content of a skill loads when it's invoked, and then it stays in the session, using up context. Claude Code documents its limits openly: once a session is compacted, a single skill may keep at most 5,000 tokens, and all skills together share 25,000. Five full skills already touch that ceiling. Load ten and something is dropped without warning. Other agents hit similar walls with different numbers.
Developers across frameworks describe the same curve. A calling B works reliably. A to B to C is hit or miss. A to B to C to D is hope more than engineering. The agent ends up with too many instructions competing for attention and too little room to hold them.
Composing skills is not the broken idea. Composing them as a flat graph is. The examples here use Claude Code's SKILL.md format because its documentation is the clearest, but the atoms, molecules and compounds pattern applies to any agent with skills, tools or plugins.
Three levels that match real composition
Most agent frameworks already layer things: direct tools, chained workflows and delegation to subagents. Claude Code makes it explicit with its command, skill and task hierarchy. The three levels below map onto Codex (skills and commands), Cursor (rules and tools) and anything that supports tool calling and subprocesses.
Atoms: one skill, one job
An atom is a SKILL.md for one narrow task, with near-deterministic behaviour. It calls no other skills and makes no judgment calls. It has a clear input and a clear output.
---
name: verify-email
description: Verify an email address using Hunter.io API.
Use when validating email deliverability before outreach.
allowed-tools: Bash
---
## Verify Email
1. Read the Hunter API key from $HUNTER_API_KEY
2. Call the Hunter email-verifier endpoint
3. Return: status (deliverable/risky/undeliverable), score, smtp_check
4. If the API errors, report the error. Do not guess.
A simple test: if you can describe the whole skill in a sentence without using "and", it's an atom. Other examples are scraping a URL to markdown, running a test suite, linting a file, fetching a pull-request diff or looking up DNS records.
Molecules: written-out chains of atoms
A molecule solves a bigger problem by running two to ten atoms in a set order. What separates it from a skill graph is that the orchestration is written down. The molecule doesn't depend on the model discovering which atoms exist and guessing the order at runtime.
---
name: qualify-lead
description: Research a company, find the right contact, verify
their email, output a qualified lead card.
allowed-tools: Bash Read Write
---
## Qualify Lead
Execute these steps IN ORDER.
### Step 1: Company Research
Use /research-company. Capture: size, industry, funding, tech stack.
### Step 2: Find Contact
Use /find-contact. Target: VP Eng, CTO, Head of Platform.
### Step 3: Find & Verify Email
Use /find-email, then /verify-email.
If undeliverable, return to Step 2 (max 3 attempts).
### Step 4: Output Lead Card
Write structured markdown to leads/{company-slug}.md
Notice what the file avoids saying. It never tells the agent to work out which skills it needs. It names the sequence: research the company, find the contact, find the email, then verify it, in that order.
That explicitness is where reliability comes from. A loose instruction like "research the company and find the best way to contact them" makes the model choose atoms at runtime, and sometimes it skips a step or improvises a workflow that ignores your atoms altogether.
Compounds: orchestrating subagents
Compounds start where one context window can't hold everything. They use Claude Code's Task tool to launch subagents, each with its own context window and its own preloaded skills.
---
name: outbound-playbook
description: Run the full outbound playbook for a target segment.
Spawns parallel agents to qualify leads and draft emails.
disable-model-invocation: true
allowed-tools: Bash Read Write Task Teammate
---
## Outbound Playbook
### Phase 1: Build Lead List
Ask the user for: target segment, company size range, geography.
Use /scrape-directory to pull matching companies.
### Phase 2: Parallel Lead Qualification (Task tool)
For each company (batch of 5):
- Spawn a subagent with qualify-lead preloaded
- Each subagent qualifies one company independently
### Phase 3: Draft Emails (Task tool)
For each qualified lead:
- Spawn a subagent with draft-email preloaded
### Phase 4: Human Review Checkpoint
STOP. Present sample drafts. Ask: "Review these. Adjust or proceed?"
Do NOT proceed without explicit user approval.
### Phase 5: Campaign Summary
Compile results to outbound/{segment}/campaign-summary.md
Two properties set compounds apart. First, subagents get separate context windows, so the lead-qualification work doesn't compete with email drafting for space. That's why compounds scale past the ceiling that breaks deep chains.
Second, disable-model-invocation: true means only a person can start the playbook. The model can't decide by itself to launch an outbound campaign. Compounds trigger real-world actions, so a human should hold the switch at the top.
Folder layout
.claude/skills/
# ATOMS — single purpose, near-deterministic
verify-email/SKILL.md
find-email/SKILL.md
find-contact/SKILL.md
research-company/SKILL.md
scrape-url/SKILL.md
# MOLECULES - explicit chains of atoms
qualify-lead/SKILL.md
review-and-test/SKILL.md
draft-blog-post/SKILL.md
# COMPOUNDS - subagent orchestration, human-driven
outbound-playbook/SKILL.md
feature-build-ship/SKILL.md
Names are flexible. The separation is what counts.
The same idea elsewhere
Nothing here is specific to SKILL.md. Every major agent framework has equivalents, and the syntax changes while the composition logic holds.
LangGraph: tools, chains, subgraphs
In LangGraph, atoms are functions decorated with @tool, molecules are sequential graphs with explicit node order, and compounds are subgraphs with separate state.
from langgraph.graph import StateGraph
from langchain_core.tools import tool
# ATOM: a single tool
@tool
def verify_email(email: str) -> dict:
"""Verify email deliverability via Hunter.io."""
response = requests.get(f"https://api.hunter.io/v2/email-verifier?email={email}")
return response.json()
# MOLECULE: explicit sequential graph
workflow = StateGraph(LeadState)
workflow.add_node("research", research_company)
workflow.add_node("find_contact", find_contact)
workflow.add_node("verify", verify_email)
workflow.add_edge("research", "find_contact")
workflow.add_edge("find_contact", "verify")
graph = workflow.compile()
# COMPOUND: subgraph composition
parent = StateGraph(CampaignState)
parent.add_node("qualify", qualify_subgraph) # each is a compiled graph
parent.add_node("draft", email_subgraph) # with its own state
parent.add_node("review", human_review_node)
The difference from Claude Code is that a LangGraph molecule is a graph with explicit edges rather than a list of instructions, so orchestration is structural, not textual. Conditionals, loops and parallel branches come more naturally this way, though setup takes more code.
CrewAI: tools, tasks, crews inside flows
CrewAI maps cleanly. Atoms are tools, molecules are tasks chained with context dependencies, and compounds are crews run by flows.
from crewai import Agent, Task, Crew, Flow
from crewai.tools import tool
# ATOM: a tool
@tool
def verify_email(email: str) -> str:
"""Verify email deliverability."""
return requests.get(f"https://api.hunter.io/v2/email-verifier?email={email}").text
# MOLECULE: tasks chained via context
researcher = Agent(role="Researcher", goal="Find company info", tools=[search_tool])
verifier = Agent(role="Verifier", goal="Verify contacts", tools=[verify_email])
research_task = Task(description="Research {company}", agent=researcher)
verify_task = Task(description="Verify the contact", agent=verifier, context=[research_task])
crew = Crew(agents=[researcher, verifier], tasks=[research_task, verify_task])
# COMPOUND: Crews inside a Flow
class OutboundFlow(Flow):
@start()
def qualify_leads(self):
return qualify_crew.kickoff(inputs={"segment": self.state.segment})
@listen(qualify_leads)
def draft_emails(self, qualified):
return email_crew.kickoff(inputs={"leads": qualified})
@listen(draft_emails)
def human_review(self, drafts):
return drafts # pause for human approval
The context=[research_task] parameter is the explicit link. That parameter tells the verification task to hold until the research task finishes and to read what it produced. Leave it out and every task runs on its own, so the chain is gone.
Agno: tools, agents, teams
Agno has the lightest mapping. Atoms are @tool functions, a molecule is an agent holding several tools plus a description that fixes the execution order, and compounds use the Team construct.
from agno.agent import Agent
from agno.models.anthropic import Claude
from agno.tools import tool
# ATOM
@tool
def verify_email(email: str) -> str:
"""Verify email deliverability via Hunter.io."""
return requests.get(f"https://api.hunter.io/v2/email-verifier?email={email}").text
# MOLECULE: agent with ordered tools
qualify_agent = Agent(
model=Claude(id="claude-sonnet-4-6"),
description="Qualify a lead: research company, find contact, verify email. Execute in that order.",
tools=[research_company, find_contact, find_email, verify_email],
)
# COMPOUND: team of agents
from agno.team import Team
outbound_team = Team(
agents=[qualify_agent, email_drafter, campaign_reporter],
description="Run the full outbound playbook for a target segment.",
)
Because the ordering lives in the description, Agno's molecule resembles the SKILL.md approach more than LangGraph's structural edges. It's simpler to write and a touch less deterministic about order.
One architecture, many syntaxes
Implementation details differ but the shape doesn't. Any framework that grows beyond toy demos ends up with the same three layers, because the constraints are identical everywhere: finite context, unreliable automatic chaining, and a need for human oversight on high-stakes work.
Where it still breaks
- Weak atoms ruin everything above them. If a verify-email atom reports success when the API actually failed, every molecule and compound relying on it produces garbage. Test atoms one by one before composing.
- Molecules past ten atoms get unreliable. In Claude Code, the combined post-compaction budget is a hard ceiling, and other agents have their own limits. Keep molecules to two through ten atoms and put critical steps early.
- Compounds past eight to ten molecules hit their own ceiling. The orchestrator must track which subagents finished, what they produced and what comes next, and beyond a certain size it loses the thread. Split a larger compound in two with a human checkpoint between the halves.
- Automatic invocation is less dependable than explicit invocation. Vercel's published agent evaluations reported skills going uninvoked in a large share of test cases, and the pattern likely holds beyond Claude Code. That's tolerable for atoms. For molecules and compounds, turn off auto-invocation and trigger them yourself.
You're the driver and the agent is the engine.
Why it matters
The scarce resource isn't compute or tokens. It's your attention. Typing "verify this email" and typing "run outbound for the fintech segment" cost about the same mental effort to start and monitor, yet the outputs differ by orders of magnitude.
In short, atoms give the agent predictable units of work, molecules string those units into sequences that accomplish something, and compounds run several sequences side by side in separate context windows. Every level adds output while your own attention stays roughly flat.
The architecture is already supported, explicitly in Claude Code and through equivalent constructs elsewhere. The composition pattern is what most developers haven't built yet.
Claude Code's skill documentation lives at code.claude.com/docs/en/skills, and the SKILL.md format follows the open Agent Skills standard that works across several AI tools. Atoms, molecules and compounds are a proposed pattern, and the code shown is pseudo-code meant to explain the concepts.