Overview
Agent Skills extend Claude with specialized capabilities that Claude autonomously invokes when relevant. Skills are packaged asSKILL.md files containing instructions, descriptions, and optional supporting resources.
For comprehensive information about Skills, including benefits, architecture, and authoring guidelines, see the Agent Skills overview.
How Skills Work with the SDK
When using the Claude Agent SDK, Skills are:- Defined as filesystem artifacts: Created as
SKILL.mdfiles in specific directories (.claude/skills/) - Loaded from filesystem: Skills are loaded from configured filesystem locations. You must specify
settingSources(TypeScript) orsetting_sources(Python) to load Skills from the filesystem - Automatically discovered: Once filesystem settings are loaded, Skill metadata is discovered at startup from user and project directories; full content loaded when triggered
- Model-invoked: Claude autonomously chooses when to use them based on context
- Enabled via allowed_tools: Add
"Skill"to yourallowed_toolsto enable Skills
Default behavior: By default, the SDK does not load any filesystem settings. To use Skills, you must explicitly configure
settingSources: ['user', 'project'] (TypeScript) or setting_sources=["user", "project"] (Python) in your options.Using Skills with the SDK
To use Skills with the SDK, you need to:- Include
"Skill"in yourallowed_toolsconfiguration - Configure
settingSources/setting_sourcesto load Skills from the filesystem
Skill Locations
Skills are loaded from filesystem directories based on yoursettingSources/setting_sources configuration:
- Project Skills (
.claude/skills/): Shared with your team via git - loaded whensetting_sourcesincludes"project" - User Skills (
~/.claude/skills/): Personal Skills across all projects - loaded whensetting_sourcesincludes"user" - Plugin Skills: Bundled with installed Claude Code plugins
Creating Skills
Skills are defined as directories containing aSKILL.md file with YAML frontmatter and Markdown content. The description field determines when Claude invokes your Skill.
Example directory structure:
- Agent Skills in Claude Code: Complete guide with examples
- Agent Skills Best Practices: Authoring guidelines and naming conventions
Tool Restrictions
The
allowed-tools frontmatter field in SKILL.md is only supported when using Claude Code CLI directly. It does not apply when using Skills through the SDK.When using the SDK, control tool access through the main allowedTools option in your query configuration.allowedTools option:
Import statements from the first example are assumed in the following code snippets.
Discovering Available Skills
To see which Skills are available in your SDK application, simply ask Claude:Testing Skills
Test Skills by asking questions that match their descriptions:Troubleshooting
Skills Not Found
Check settingSources configuration: Skills are only loaded when you explicitly configuresettingSources/setting_sources. This is the most common issue:
settingSources/setting_sources, see the TypeScript SDK reference or Python SDK reference.
Check working directory: The SDK loads Skills relative to the cwd option. Ensure it points to a directory containing .claude/skills/:
Skill Not Being Used
Check the Skill tool is enabled: Confirm"Skill" is in your allowedTools.
Check the description: Ensure it’s specific and includes relevant keywords. See Agent Skills Best Practices for guidance on writing effective descriptions.
Additional Troubleshooting
For general Skills troubleshooting (YAML syntax, debugging, etc.), see the Claude Code Skills troubleshooting section.Related Documentation
Skills Guides
- Agent Skills in Claude Code: Complete Skills guide with creation, examples, and troubleshooting
- Agent Skills Overview: Conceptual overview, benefits, and architecture
- Agent Skills Best Practices: Authoring guidelines for effective Skills
- Agent Skills Cookbook: Example Skills and templates
SDK Resources
- Subagents in the SDK: Similar filesystem-based agents with programmatic options
- Slash Commands in the SDK: User-invoked commands
- SDK Overview: General SDK concepts
- TypeScript SDK Reference: Complete API documentation
- Python SDK Reference: Complete API documentation