How Skills Work in Claude Code
Othman Lahoui
MAR 2026 · 7 min read
"Claude doesn't just answer — it executes. Skills are the bridge between intent and action."
If you've used Claude Code for more than a few sessions, you've probably typed a slash command — /commit, /review-pr, or maybe a custom one your team built. But what's actually happening when you do that?
Skills (also called slash commands) are one of the most underrated features of Claude Code. They turn repetitive, multi-step workflows into a single invocation. This post breaks down how they work under the hood and how to build your own.

What exactly is a Skill?
A skill is a Markdown file stored in ~/.claude/skills/. When you type /my-skill, Claude Code reads that file, expands it into a full prompt, and injects it into your conversation as if you had typed it yourself.
That's it. No magic runtime, no compiled binary. Just a prompt template that gets resolved at invocation time.
Skills vs. Hooks
Skills are user-invoked — you trigger them deliberately with a slash command. Hooks are event-driven — they fire automatically in response to tool use events. Both are powerful, but for different problems.
Anatomy of a Skill file
Here's a minimal skill that generates a conventional commit message:
--- name: commit description: Generate a conventional commit message for staged changes --- Review the staged git diff and write a conventional commit message. Rules: - Use type: feat | fix | docs | refactor | chore - Keep subject under 72 characters - Add a body if the change is non-trivial Run: git diff --staged
The frontmatter gives Claude Code the metadata it needs to show the skill in autocomplete. The body is the actual prompt — written in plain English.
When should you build a Skill?
You have a good candidate for a skill when:
- You type the same multi-sentence instruction more than twice a week
- A workflow requires Claude to follow a specific format or set of rules consistently
- You want to share a workflow with your team without explaining it each time
- The task involves reading a specific file or running a specific command as context
The compounding effect
The real power of skills isn't any single skill — it's the library you build over time. Each skill is a piece of institutional knowledge encoded as a prompt. New team members get it for free. Future-you doesn't have to remember the exact phrasing that works.
Start with one skill this week. The commit message generator above takes five minutes to write and will save you hours over a year.
Building with Claude?
I write about AI systems, cloud infrastructure, and developer tooling. Check out my other posts.
Read More