[DOCS] Performance comparison: Subagent vs. hook vs. skill invocation overhead
Documentation Type
Missing documentation (feature not documented)
Documentation Location
https://code.claude.com/docs/en/sub-agents#create-custom-subagents
Section/Topic
https://code.claude.com/docs/zh-CN/features-overview#skill-vs-subagent
Current Documentation
_No response_
What's Wrong or Missing?
I'm trying to understand the performance overhead differences between three approaches for executing scripts/tools:
- Subagent approach: Invoking a tool (e.g., Bash) through a subagent using the Task tool
- Direct hook approach: Calling a script directly via a hook (e.g., PreToolUse with
async: false) - Skill-based approach: Triggering a skill that executes a tool or script
Questions:
- What is the performance overhead of each approach compared to the others?
- Are there any latency benchmarks or performance metrics available for subagent invocation, hook execution, and skill triggering?
- How does the overhead scale with complexity (simple scripts vs. complex operations)?
- In what scenarios would one approach be significantly more efficient than the others?
- If a skill triggers an async hook, what is the combined overhead?
Context:
I'm designing a system where I need to decide between using subagents, hooks, or skills for executing scripts, and understanding the performance implications would help me make the right architectural choice.
Additional information:
- Claude Code version: e2.1.114
- OS: Linux
Suggested Improvement
The current documentation introduces Skills, Subagents, and Hooks primarily from a use-case perspective. However, to make informed architectural decisions, developers need additional guidance on:
- Performance characteristics - execution time, latency, and throughput differences between each approach
- Resource consumption - computational cost, token usage, and API call overhead for each option
- Comparative analysis - a side-by-side comparison table or decision matrix showing when to use Skills vs. Subagents vs. Hooks based on performance and cost trade-offs
This would help framework users avoid blind architectural choices and select the most appropriate solution based on their specific performance and cost requirements.
Impact
High - Prevents users from using a feature
Additional Context
_No response_
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗