Source-linked AI summary
Subagents vs Agent Skills: Executing Reusable Knowledge for Long-Horizon Agentic Tasks
Wasu Top Piriyakulkij, Rachel Lawrence, Alicia Curth, Sushrut Karmalkar, Niranjani Prasad
TL;DR
Long-horizon agents need to use reusable knowledge without allowing accumulated context to degrade reasoning. The paper compares loading skill instructions into the main context with executing skills as subagents, finding that subagents work best for procedural skills with explicit input-output contracts, at the cost of communication overhead.
Problem
The paper asks how agents can use reusable skill knowledge in long-horizon tasks when loading instructions into growing contexts can degrade reasoning.
Method
The paper executes skill packages either in the main context or as subagents in separate contexts, using procedural packages with explicit input-output contracts synthesized from successful trajectories.
Results
Subagent execution outperforms agent-skill execution for procedural skill packages with explicit input-output contracts, whereas original packages without such contracts favor agent-skill execution.
Takeaways & Limitations
Reusable knowledge benefits from both procedural organization with clear interfaces and execution that encapsulates task-specific information behind separate contexts.
Takeaways & Limitations
Subagents work well only when skill packages encode procedural knowledge with clear input-output contracts, a property existing curated skills do not always exhibit.
Abstract
from arXiv · showhide
How can language model agents effectively leverage libraries of reusable knowledge to solve long-horizon tasks? Recent work has increasingly focused on agent skills: reusable capabilities represented as skill packages, i.e., multi-file bundles containing instructions, scripts, and other resources that help agents perform specific tasks. Agent skills are typically executed by loading their skill instructions into an agent's context and relying on the agent to follow them. As task horizons grow, however, this approach becomes increasingly brittle, because reasoning quality degrades as more information accumulates in the context window. We investigate an alternative approach in which skill packages are instead invoked as subagents. Rather than loading skill instructions into the main context, subagent execution spawns fresh context windows dedicated to solving individual subtasks. We show that subagent execution outperforms agent-skill execution when skill packages expose clear input-output contracts and their instructions encode the procedural knowledge needed to fulfill those contracts. The tradeoff is additional communication overhead, as extra tokens are required to coordinate between the main agent and its subagents. Our results show that the benefit of reusable knowledge depends not only on its content, but also on how it is organized and invoked.
1 Introduction
The paper frames reusable agent skills as explicit knowledge packages, but argues that loading their instructions into a growing context can become brittle for long-horizon tasks. It therefore studies executing skills as subagents, whose separate contexts reduce the information processed by any single context, with communication overhead as the tradeoff.
- Agent skills are multi-file packages containing instructions and scripts for solving specific tasks.
- Subagent execution reduces the information processed by each individual context but requires extra tokens for communication between the main agent and subagents.
- Agent-skill execution loads skill instructions into the main agent’s context, so each skill step unfolds within the main reasoning process.
- As task horizons lengthen, adding instructions to the context can become unproductive because agent performance degrades as context grows.
- Subagent execution instead creates a new context window seeded with skill instructions, performs the skill independently, and returns its output to the main agent.
- The paper argues that subagent execution is especially effective when skill packages encode procedural knowledge with clear input-output contracts.
2 Background: Agents with Tools, Agent Skills, and Subagents
The paper formalizes iterative tool-calling agents and contrasts two ways of using the same skill package: exposing instructions to the main policy or executing them through a separately instantiated subagent policy.
- At each turn, the language model produces a response, selects a tool, supplies arguments, receives tool output, and appends the interaction to its context.
- A skill package contains a description, an instruction file, and supporting resources such as scripts, examples, reference documents, and nested directories.
- Agent Skills: Invoking an agent skill returns its instruction file, exposing the skill contents directly to the main context for execution by the main policy.
- Subagents: Invoking a subagent instead instantiates a distinct policy conditioned on the skill instructions and initializes a separate context from the task input.
- Both mechanisms use the same skill package, but agent skills condition the main policy while subagents use a separately instantiated policy acting in a context hidden from the main agent.
3 Subagents For Long-horizon Agentic Tasks
The paper motivates subagents as a way to reduce peak context length by encapsulating subtasks, while identifying delegation and communication as costs. It proposes procedural skills with explicit input-output contracts as self-contained interfaces for effective delegation.
- Reducing Peak Context Length Through Subagent Execution: Long-horizon tasks accumulate verbose tool interactions, intermediate reasoning, and other information, making them susceptible to context-length degradation.
- Reducing Peak Context Length Through Subagent Execution: Subagent execution decomposes work across separate context windows so that peak context length can be shorter than in a single monolithic window.
- Reducing Peak Context Length Through Subagent Execution: Subagents encapsulate subtask-specific information by hiding internal trajectories and exposing only final outputs to the main agent.
- Reducing Peak Context Length Through Subagent Execution: This peak-context reduction costs additional communication because subagents need sufficient inputs and repeated information across context windows.
- Input-Output Contracts for Effective Subagents: Effective delegation requires the main agent to identify an appropriate subagent and provide enough information for the delegated task.
- Input-Output Contracts for Effective Subagents: Input-output contracts specify when a subagent may be invoked, how its instructions solve the task, and what information it returns.
- Input-Output Contracts for Effective Subagents: The options analogy maps input contracts to initiation conditions, instructions to the policy, and output contracts to termination constraints.
- Input-Output Contracts for Effective Subagents: Figure 2 compares agent-skill and subagent accuracy across base models and contrasts human-authored packages without contracts with procedural packages containing explicit contracts.
4 Experiments
Experiments on SkillsBench compare agent-skill and subagent execution using curated and synthesized skill packages, then test scaling under distracting context. Subagents outperform agent skills with explicit input-output contracts, reduce peak context for stronger models, and consume more total tokens.
- Experimental setup: SkillsBench contains 87 long-horizon tasks with human-authored skill packages, while the synthesized set provides explicit input-output contracts for 64 tasks.The paper uses OpenHands throughout, and reports results on the 64-task synthesized subset.
- Skill-package construction: Most curated skill packages lack clearly specified inputs and outputs, limiting their suitability for subagent execution.The packages often provide relevant information without defining the interface needed for delegated execution.
- Main results: With curated skills, agent skills match or outperform subagents, but with procedural packages and explicit input-output contracts, subagents outperform agent skills, especially on smaller models.This reversal supports the claim that subagent execution benefits from procedural abstractions with well-defined interfaces.
- Comparison caveat: The synthesized packages outperform curated packages under both execution modes, but this comparison is uncontrolled because the package sets differ in content.The result suggests comparable or better package quality without isolating the synthesis procedure’s effect.
- Scaling with context: As distracting tools lengthen the initial context, subagent execution degrades more gracefully than agent-skill execution.Keeping skill instructions outside the already-large main context matters more as context pressure increases.
- Peak context: For stronger models, subagents lower peak context length on over 80% of tasks, while weaker models show smaller or reversed reductions.Peak-context comparisons are meaningful only when success rates are similar across execution modes.
- Token cost: Subagent execution consumes substantially more total tokens because each subagent must receive context that the main agent already holds.The experiment therefore identifies a tradeoff between reduced peak context and duplicated communication context.
5 Related Work
Related work spans tool-calling agents, long-horizon multi-tool interaction, programmatic skill learning, and skill-package synthesis. This paper differs by studying how skill packages are invoked rather than focusing on learning the packages themselves.
- Tool-Calling Language Model Agents: Tool-calling agents use prompting or training to interleave reasoning with tool use or generate tool calls.Related systems include ReAct, Toolformer, Gorilla, ToolLLM, and HuggingGPT-style orchestration.
- Tool-Calling Language Model Agents: Recent benchmarks emphasize long, stateful interactions across many tools, where accumulated context creates scaling demands.SkillsBench tasks require many tool-calling turns and substantial context accumulation.
- LLM Skill Learning: Earlier skill-learning work builds executable code skills, creates reusable tools, or composes tool calls into skills.Examples include Voyager, LATM, CREATOR, CRAFT, and SkillCraft.
- LLM Skill Learning: Recent skill-package learning methods synthesize or refine multi-file skill folders from trajectories or failures, typically executing them as agent skills.This paper also uses skill packages but studies their execution as subagents rather than concentrating on package learning.
6 Conclusion and Future Work
The paper finds that subagent execution helps long-horizon agents by distributing computation across contexts, but works best for procedural skills with clear input-output contracts. It identifies communication cost and skill-library organization as important open problems.
- Subagents reduce the information any single context must process by distributing computation across multiple context windows.
- Subagent execution is most suitable for skills encoding procedural knowledge with clear input-output contracts.Such skills can be executed largely independently of the main agent’s context.
- The paper frames subagent execution as a mechanism for enforcing modularity by encapsulating task-specific knowledge behind clear interfaces.
- Subagent execution increases communication cost because relevant information may need to be repeated across context windows.The approach trades higher total token count for reduced peak context length.
- Future work should study efficient main-agent–subagent communication and principled refactoring of growing skill libraries.
A.1 Organizing Libraries of Skills to Decrease Initial Context Load
Hierarchical skill libraries expose only a subset of skills at each level, reducing the need to present the full library up front. Hybrid execution performs best across library organizations, while deeper hierarchies did not add gains in these experiments.
- Library organization: Hierarchical libraries reveal a small set of top-level nodes and let agents navigate step by step to leaf skills.Flat libraries expose all leaf skills simultaneously, whereas routing nodes reveal their children when selected.
- Library organization: The experiments compare flat, hierarchical tree, hierarchical graph, and two-level task-tree organizations.Tree nodes have one parent, graph nodes may have multiple parents, and the task tree groups skills by task.
- Execution modes: Execution varies independently between fully inline agent-skill, fully isolated subagent, and hybrid modes.In the hybrid mode, routing nodes run as agent skills and leaf skills run as subagents.
- Results: The task-tree and hierarchical-graph libraries perform best, with the LLM-built graph outperforming the LLM-built tree.The result suggests that allowing multiple paths to a leaf skill helps.
- Results: Deeper hierarchies produced no further gains in these experiments, although benefits may emerge with libraries of thousands of skills.
- Results: Hybrid execution is consistently best across all four library types: routing nodes run inline and leaf skills run as subagents.The authors link this division to routing nodes lacking procedural contracts and leaf skills having them.
A.2 Additional results on SkillsBench
Additional SkillsBench results preserve the main interpretation across more base models: subagent execution changes skill-call behavior, and Figure 5 compares accuracy across library organizations and execution modes.
- Additional-base-model results show the same interpretation as the main-text results.The authors include only three LLMs in the main text for readability.
- Subagent execution leads to more skill calls per task across all tested base LLMs.The authors hypothesize that growing context causes agent-skill execution to underthink, producing fewer calls.
- Figure 5 reports average SkillsBench task accuracy by library organization and execution mode on Qwen3.5-9B.The organizations are flat, hierarchical tree, hierarchical graph, and two-level task tree; modes are fully agent skill, fully subagent, and hybrid.
A.3 OpenHands Agent Implementation Details
The OpenHands implementation runs each SkillsBench task in a Docker container and routes all LLM calls through a controlled proxy. The setup also replaces the default prompt behavior and modifies timeout and native-skill handling.
- Each SkillsBench task runs OpenHands inside a Docker container as the benchmark harness’s registered agent.
- A controlled proxy routes every LLM call, enabling system-prompt injection, sampling overrides, and uniform request-response logging.
- The implementation replaces OpenHands’ vanilla system prompt with a simpler prompt and initializes spawned subagents with a separate prompt.
- The setup extends MCP tool-call timeouts from five minutes to two hours because subagents are treated as MCP tools.
- The implementation removes OpenHands’ native skills and disables native automatic skill retrieval.
A.4 Well-interfaced Procedural Skill Authoring details
The authors synthesize and manually refine procedural skill packages with explicit input and output descriptions, then illustrate the resulting skills and experimental setup through figures.
- Skill package synthesis: Copilot CLI initially generates 3–5 skill packages for the edit-pdf task, after which authors manually verify expected inputs, outputs, and faithful transformations.The packages are intended to encode well-interfaced procedural skills.
- Example skills: Figures 10 and 11 provide example descriptions for the vulnerability-record-normalization and offline-vulnerability-scan skills.The offline scan saves a reproducible dependency-lockfile scan as JSON for later normalization.
- Computational resources: Experiments use NVIDIA A100 GPU nodes for locally served open-weight models, while closed-weight or large models are accessed through a hosting API.The local-serving setup uses vLLM on A100 GPUs.
- Experimental figures: Figure 6 plots average task accuracy against the number of distracting skills for each base LLM model and execution mode.The plotted skill packages come from the synthesized set.
- Experimental figures: Figure 7 reports the number of skill calls for each base LLM model using the synthesized skill packages.The figure compares skill-call behavior across the evaluated models.
- Prompt configuration: Figures 8 and 9 document the prompts used for the OpenHands agent and spawned subagents, including available skill names and the subagent initialization template.The spawned-subagent template receives the skill body, task, and input information.