Skills require
deepagents>=1.7.0.What are skills
Skills are a directory of folders, where each folder has one or more files that contain context the agent can use:- A
SKILL.mdfile containing instructions and metadata about the skill - Additional scripts (optional)
- Additional reference info, such as docs (optional)
- Additional assets, such as templates and other resources (optional)
Any additional assets (scripts, docs, templates, or other resources) must be referenced in the
SKILL.md file with information on what the file contains and how to use it so the agent can decide when to use them.How skills work
When you create a deep agent, you can pass in a list of directories containing skills. As the agent starts, it reads through the frontmatter of eachSKILL.md file.
When the agent receives a prompt, the agent checks if it can use any skills while fulfilling the prompt. If it finds a matching prompt, it then reviews the rest of the skill files. This pattern of only reviewing the skill information when needed is called progressive disclosure.
Example
You might have a skills folder that contains a skill to use a docs site in a certain way, as well as another skill to search the arXiv preprint repository of research papers:SKILL.md file always follows the same pattern, starting with metadata in the frontmatter and followed by the instructions for the skill.
The following example shows a skill that gives instructions on how to provide relevant langgraph docs when prompted:
Full example
The following example shows aSKILL.md file using all available frontmatter fields:
Usage
Pass the skills directory when creating your deep agent:- StateBackend
- StoreBackend
- FilesystemBackend
List of skill source paths.Paths must be specified using forward slashes and are relative to the backend’s root.
- If omitted, no skills are loaded.
- When using
StateBackend(default), provide skill files withinvoke(files={...}). - With
FilesystemBackend, skills are loaded from disk relative to the backend’sroot_dir.
The SDK only loads the sources you pass in
skills. It does not automatically scan CLI directories such as ~/.deepagents/... or ~/.agents/....For CLI storage conventions, see App data.Emulating CLI source order in SDK
Emulating CLI source order in SDK
If you want CLI-style layering in SDK code, pass all desired sources explicitly in lowest-to-highest precedence order:Then pass that ordered list as
skills when creating your agent.Source precedence
When multiple skill sources contain a skill with the same name, the skill from the source listed later in theskills array takes precedence (last one wins). This lets you layer skills from different origins.
Skills for subagents
When you use subagents, you can configure which skills each type has access to:- General-purpose subagent: Automatically inherits skills from the main agent when you pass
skillstocreate_deep_agent. No additional configuration is needed. - Custom subagents: Do not inherit the main agent’s skills. Add a
skillsparameter to each subagent definition with that subagent’s skill source paths.
What the agent sees
When skills are configured, a “Skills System” section is injected into the agent’s system prompt. The agent uses this information to follow a three-step process:- Match—When a user prompt arrives, the agent checks whether any skill’s description matches the task.
- Read—If a skill applies, the agent reads the full
SKILL.mdfile using the path shown in its skills list. - Execute—The agent follows the skill’s instructions and accesses any supporting files (scripts, templates, reference docs) as needed.
Execute skill scripts in a sandbox
Skills can include scripts alongside theSKILL.md file, such as, for example, a Python file that performs a search or data transformation. The agent can read these scripts from any backend, but to execute them, the agent needs access to a shell — which only sandbox backends provide.
When you use a CompositeBackend that routes skills to a StoreBackend for persistence while using a sandbox as the default backend, skill files live in the store rather than in the sandbox is where code runs. For sandboxes to be able to use the scripts, you must use custom middleware to upload skill scripts into the sandbox before the agent starts:
beforeAgent hook runs before each agent invocation, reading skill files from that shared namespace and uploading them into the sandbox filesystem. Once synced, the agent can execute scripts with the execute tool just like any other file in the sandbox.
For a more complete example that also syncs memories bidirectionally, see syncing skills and memories with custom middleware.
Skills vs. memory
Skills and memory (AGENTS.md files) serve different purposes:
| Skills | Memory | |
|---|---|---|
| Purpose | On-demand capabilities discovered through progressive disclosure | Persistent context always loaded at startup |
| Loading | Read only when the agent determines relevance | Always injected into system prompt |
| Format | SKILL.md in named directories | AGENTS.md files |
| Layering | User → project (last wins) | User → project (combined) |
| Use when | Instructions are task-specific and potentially large | Context is always relevant (project conventions, preferences) |
When to use skills and tools
These are a few general guidelines for using tools and skills:- Use skills when there is a lot of context to reduce the number of tokens in the system prompt.
- Use skills to bundle capabilities together into larger actions and provide additional context beyond single tool descriptions.
- Use tools if the agent does not have access to the file system.
Connect these docs to Claude, VSCode, and more via MCP for real-time answers.

