Skills with Claude Agent SDK
Claude Agent SDK is a programmatic way to build agentic apps with a Claude Code-like execution model.
Skills in SDK are filesystem-based and enabled through agent configuration.
What Agent SDK Requires
Section titled “What Agent SDK Requires”From official docs, to use skills in Agent SDK you must:
- Allow the
Skilltool inallowed_tools - Set
setting_sourcesto include"user"or"project"(or both) - Store skills in supported filesystem locations (for example
.claude/skills/...)
Unlike Claude Code CLI behavior, skills are not programmatically registered in Agent SDK.
They must exist as files on disk.
Minimal Configuration Pattern
Section titled “Minimal Configuration Pattern”{ "allowed_tools": ["Task", "Skill", "Write", "Bash", "WebSearch", "WebFetch"], "setting_sources": ["user", "project"]}Task is needed to dispatch subagents.
Skill is needed for skill discovery/use.
Multi-Agent Research Pattern
Section titled “Multi-Agent Research Pattern”A strong Agent SDK pattern is:
- Main agent orchestrates the task
- Main agent dispatches specialized subagents in parallel
- Main agent synthesizes outputs into one final artifact
Typical subagents:
- Docs researcher: official documentation extraction
- Repo analyzer: repository structure/code analysis
- Web researcher: tutorials, community content, external references
Where to Apply Skills
Section titled “Where to Apply Skills”You can apply skills at multiple levels, but a common design is:
- Main agent uses one methodology skill (for example
learning-a-tool) - Subagents stay focused on retrieval/extraction prompts and tool use
This keeps orchestration policy centralized and avoids duplicating methodology across subagents.
Agent Definition Shape
Section titled “Agent Definition Shape”In SDK, each subagent definition typically includes:
description(when to dispatch)prompt(process/output format)tools(strictly scoped set)
Important: every tool referenced by subagents must also be permitted by the parent allowed_tools policy.
How This Fits with Subagents
Section titled “How This Fits with Subagents”- Parent agent can orchestrate the task.
- Subagents can run isolated work with scoped tool access.
- Skills provide repeatable procedure inside each delegated step.
Use subagents for isolation/parallelization; use skills for consistency.
MCP Integration Pattern
Section titled “MCP Integration Pattern”When external systems are needed (for example Notion), configure MCP servers in the SDK runtime and allow corresponding MCP tools.
Practical flow:
- Configure MCP server command/env
- Add MCP tool names to
allowed_tools(explicit or wildcard pattern) - Let agents call MCP tools for read/write operations
This is useful for publishing generated artifacts (for example writing a markdown resource guide into Notion blocks).
Plan-Then-Execute Pattern
Section titled “Plan-Then-Execute Pattern”For long research tasks, ask for a plan first, then execute:
- Generate plan (delegation + synthesis outline)
- Confirm/adjust scope
- Run parallel subagent tasks
- Synthesize and write outputs
This improves controllability and avoids unnecessary tool usage.
Safety and Ops Guardrails
Section titled “Safety and Ops Guardrails”- Add user confirmations for potentially destructive tools (
Write,Bash) where possible. - Add interrupts/cancellation handling for long-running subagent jobs.
- Bound runtime with token/time/tool-call limits.
- Log delegated tasks, tool calls, and output artifacts for auditability.
Best Practices
Section titled “Best Practices”- Keep skill scope narrow and composable.
- Store skills in project scope when they are repo-specific.
- Use user scope for personal reusable skills.
- Test activation behavior with representative prompts before production.
- Validate subagent output contracts before final synthesis.