Skill in Subagent - Claude Code
Run a skill in an isolated context via fork mode.
Skills can run inside a forked subagent context so they don't bloat the main conversation. The main session gets the summary, not the intermediate steps.
What it does
Mark a skill as context: fork and Claude spawns a subagent to execute it. The subagent has its own context window, runs to completion, and returns a concise result. The main session only sees the return value, not the detailed reasoning or tool output. It's how you keep large investigations from eating the primary context.
When to use it
- Research tasks that would otherwise fill context with reads.
- Large audits or scans where you only care about the conclusion.
- Parallel fan-out where each branch can be summarized independently.
- Keeping the main session focused on your actual coding work.
Gotchas
- Subagent context is ephemeral. Important findings need to land in a file or the return value.
- Forking costs a turn's worth of setup latency.
- Nested forks work but compound cost and latency. Use sparingly.
Official docs: https://code.claude.com/docs/en/skills.md#advanced-patterns
Technical content at the intersection of AI and development. Building with AI agents, Claude Code, and modern dev tools - then showing you exactly how it works.
Get the weekly deep dive
Tutorials on Claude Code, AI agents, and dev tools - delivered free every week.
Was this helpful?




