Claude Code shipped with slash commands from the start — /commit, /review, /help. But in 2025, Anthropic introduced something more powerful: Agent Skills.
Skills are programmable, reusable capabilities you can add to Claude Code (and any compatible AI coding tool). They go beyond static commands. A skill can inject dynamic context, run shell commands, call APIs, and define exactly how Claude should behave for a specific workflow.
What a skill actually is
A skill is a directory containing a SKILL.md file and optional supporting files. That’s it.
The SKILL.md file defines:
- The slash command that triggers the skill (e.g.,
/deploy) - A description of what the skill does
- The prompt or instructions Claude follows when invoked
- Optional lifecycle hooks (before/after execution)
- Any tools the skill needs access to
When you run /deploy in Claude Code, Claude reads the SKILL.md, follows the instructions, uses the defined tools, and runs any hooks — all in one smooth flow.
The SKILL.md format
Here is a minimal example:
# Skill: Deploy to Staging
## Trigger
/deploy-staging
## Description
Runs build checks, tags the commit, and deploys to the staging environment.
## Instructions
1. Run `pnpm build` and report any errors.
2. If build passes, run `pnpm test` and stop if tests fail.
3. If tests pass, create a git tag with today's date.
4. Run `./scripts/deploy.sh staging` and report the output.
5. Confirm deployment by hitting the staging health endpoint.
## Tools
- shell: true
- read_file: true
## On Success
Report the staging URL and git tag created.
When you run /deploy-staging, Claude executes these steps in order, using shell access and file reads as needed.
Lifecycle hooks
Skills support hooks that run at key points:
- PreToolUse — runs before a tool is called (e.g., validate input, log the action)
- PostToolUse — runs after a tool completes (e.g., format output, trigger a follow-up action)
- Notification — sends a message without blocking execution
Hooks are defined as shell commands in SKILL.md:
## Hooks
before_shell: echo "Running shell command: $TOOL_INPUT"
after_shell: echo "Command completed with exit code: $EXIT_CODE"
This gives you observability and control over exactly what the skill does at each step.
Dynamic context injection
One of the most useful features: skills can inject context that changes per invocation.
Instead of hardcoding values, you reference environment variables or dynamic inputs:
## Instructions
You are deploying to {{ env.DEPLOY_TARGET }}. The current branch is {{ git.branch }}.
Check if there are any open PRs before proceeding.
Claude fills in the actual values at runtime. This makes one skill work across different environments, branches, and configurations without duplicating it.
Official, verified, and community skills
The skills ecosystem has three tiers:
- Official skills — shipped by Anthropic as part of Claude Code (e.g.,
/commit,/review-pr) - Verified skills — community-built, reviewed by Anthropic for quality and safety
- Community skills — open-source skills anyone can publish and use
You can install a community skill in one command:
claude skills install github:username/skill-name
Or add it to your project’s skills.json to share it with your team.
Why skills matter for developer workflows
Before skills, customizing Claude for your team meant:
- Writing long system prompts
- Maintaining a
CLAUDE.mdwith workflow notes - Hoping Claude remembered to follow them
Skills make that customization explicit and executable. Instead of telling Claude “always run tests before committing”, you write a /commit skill that does exactly that, every time, with no reliance on context memory.
The practical difference:
| Approach | Reliability | Reusability | Shareability |
|---|---|---|---|
| System prompt instructions | Medium | Low | Manual copy-paste |
| CLAUDE.md notes | Medium | Low | Per-repo only |
| Agent Skills | High | High | One command install |
Skills vs MCP servers
Both extend Claude’s capabilities, but in different ways:
- Skills are workflow scripts — they define how Claude behaves for a specific task in your development environment
- MCP servers are tool providers — they expose capabilities Claude can call (like querying a database or searching files)
You can use both together. A skill might orchestrate several MCP tool calls as part of its workflow.
Next steps
- How to Write Your First Claude Code Skill (SKILL.md Guide) — hands-on tutorial
- Browse the awesome-agent-skills repo for community examples
- Read the official skills docs
Related Reading.
How to Write Your First Claude Code Skill (SKILL.md Guide)
A hands-on tutorial to create a working Claude Code skill using SKILL.md — build a /smart-commit skill that runs checks, writes a message, and commits in one command.
What Are Agent Skills? AI Tools Explained Simply
Agent skills are the actions an AI can take beyond just talking. Learn what skills are, how they differ from prompts, and why they make AI actually useful in real workflows.
How Junior Engineers Should Actually Use Claude Code
Not a shortcut — a safety net. How to use Claude Code to learn faster, catch mistakes early, and ship better code without becoming dependent on AI for thinking.