---
title: "Claude Code Skills and Slash Commands"
description: "How Claude Code Skills and slash commands work in 2026: create a reusable /command, write a SKILL.md, use arguments and dynamic context, and know when to use each."
type: "guide"
locale: "en"
category: "Claude Code"
canonical: "https://agenticschool.dev/guides/claude-code-skills-and-commands"
datePublished: "2026-06-13"
dateModified: "2026-06-13"
---

# Claude Code Skills and Slash Commands

- Category: Claude Code
- Keywords: claude code skills, claude code slash commands, reusable claude commands, claude skills tutorial, skill.md claude code
- Canonical URL: https://agenticschool.dev/guides/claude-code-skills-and-commands
- Locale: en

> How Claude Code Skills and slash commands work in 2026: create a reusable /command, write a SKILL.md, use arguments and dynamic context, and know when to use each.

Claude Code Skills and slash commands are reusable, named workflows: instead of retyping the same multi-step instructions, you invoke one and the agent runs your proven steps with the right context already loaded. As of 2026, custom slash commands have merged into Skills: a file at .claude/commands/deploy.md and a Skill at .claude/skills/deploy/SKILL.md both create the /deploy command and work the same way. This guide shows you how to create a slash command and a SKILL.md, how arguments and dynamic context work, where they live, and when Claude loads a Skill automatically versus when you trigger it yourself.

## Skills and commands are now one thing

For years Claude Code had two separate features: slash commands (a Markdown file you triggered with /name) and Skills (a richer, self-contained capability). In 2026 they were unified. Custom commands have been merged into Skills, so both create a slash command and behave the same way. Your existing .claude/commands/ files keep working, and Skills simply add optional features on top: a directory for supporting files, frontmatter to control who invokes them, and the ability for Claude to load them automatically when relevant. Claude Code Skills follow the open Agent Skills standard, so the same skill can work across tools.

- A file at .claude/commands/deploy.md creates /deploy.
- A Skill at .claude/skills/deploy/SKILL.md also creates /deploy.
- Skills add: supporting files, invocation control, and automatic loading by description.
- Existing .claude/commands/ files still work; Skills are the recommended path forward.

## Creating a slash command

The simplest reusable workflow is a Markdown file whose name becomes the command. Drop a file in .claude/commands/ (project) or ~/.claude/commands/ (personal) and Claude Code exposes it as a slash command. Use the $ARGUMENTS placeholder to capture whatever you type after the command, or positional $1, $2 for individual arguments. A description in the YAML frontmatter shows up as help text. This is perfect for a single, well-defined action you trigger often.

```markdown
<!-- .claude/commands/fix-issue.md -->
---
description: Investigate and fix a GitHub issue by number.
argument-hint: [issue-number]
---

Fix GitHub issue #$ARGUMENTS. First read the issue with the gh CLI, then
find the relevant code, propose a fix in plan mode, and only implement
after I approve. Run the test suite before you say it is done.
```
A slash command at .claude/commands/fix-issue.md, invoked as "/fix-issue 123". $ARGUMENTS captures the 123.

## Writing a SKILL.md

A Skill is a directory with a SKILL.md file at its root: YAML frontmatter plus Markdown instructions, and optionally bundled scripts, templates or reference files. The directory name becomes the command you type, and the description is what Claude reads to decide when to load the skill automatically, so a sharp description is half the work. Only the description is recommended; everything else is optional. Skills shine when a workflow is multi-step, has its own assets, or you want Claude to invoke it on its own when the moment fits.

```markdown
<!-- .claude/skills/summarize-changes/SKILL.md -->
---
description: Summarise uncommitted changes and flag risks. Use when the user asks what changed or wants a commit message.
allowed-tools: Read, Grep
---

## Current changes

!`git diff HEAD`

## Instructions

Summarise the changes above in two or three bullet points, then list any
risks such as missing error handling, hardcoded values, or tests that need
updating. If the diff is empty, say there are no uncommitted changes.
```
A SKILL.md at .claude/skills/summarize-changes/SKILL.md, invoked as /summarize-changes or loaded automatically by its description.

The line with !`git diff HEAD` is dynamic context injection: Claude Code runs the command and replaces the line with its output before the model sees the skill, so the instructions arrive with your real diff already inlined. Keep the body concise, because once a skill loads its content stays in context across turns.

## Where they live and who invokes them

Project Skills live in .claude/skills/<name>/SKILL.md and apply to that repo; personal Skills live in ~/.claude/skills/<name>/SKILL.md and follow you everywhere. Claude can invoke a Skill automatically when your request matches its description, or you can trigger it directly with /name. If a workflow should only ever run when you ask for it (a deploy, say), set disable-model-invocation: true so Claude never triggers it on its own. To hide a knowledge-only skill from the slash menu, set user-invocable: false.

- Project: .claude/skills/<name>/SKILL.md - shared with the repo.
- Personal: ~/.claude/skills/<name>/SKILL.md - all your projects.
- Auto-invoked by description, or triggered directly with /name.
- disable-model-invocation: true makes a skill manual-only; user-invocable: false hides it from the / menu.

## When to use which

The signal to package anything is repetition: the second time you brief the agent on the same sequence, capture it. Then choose the form by how rich it is. A single clear action with no assets is a plain command file. A multi-step process with its own templates, scripts or reference docs, or one you want Claude to load automatically, is a Skill. You can start with a command and grow it into a Skill later. Keep your library small and focused: two or three you actually reach for beat twenty you forget exist.

## Steps

### 1. Pick a workflow you repeat

Choose the multi-step instruction you find yourself retyping, such as a deploy, a commit-and-PR flow, or a scaffold-and-test routine.

### 2. Start with a command file

Create .claude/commands/<name>.md with your prompt and a description in the frontmatter. Use $ARGUMENTS to accept input. Invoke it as /<name>.

### 3. Promote to a SKILL.md if it grows

When the workflow needs bundled files or you want Claude to load it automatically, create .claude/skills/<name>/SKILL.md with a sharp description. The directory name becomes the command.

### 4. Add dynamic context if useful

Inline live data with a !`command` line (for example !`git diff HEAD`) so the skill arrives with real context already filled in.

### 5. Set invocation control

For workflows that should only run on request, add disable-model-invocation: true so Claude never triggers them on its own. Keep the body concise to limit context cost.

## FAQ

### What is the difference between a Claude Code Skill and a slash command?

As of 2026 they are unified: custom commands have merged into Skills, and both create a slash command that works the same way. A plain command is a single Markdown file; a Skill is a directory (SKILL.md plus optional supporting files) that adds invocation control and automatic loading by description.

### Where do I put a Claude Code Skill?

Project Skills go in .claude/skills/<name>/SKILL.md in your repo and apply to that project. Personal Skills go in ~/.claude/skills/<name>/SKILL.md and are available across all your projects. The directory name becomes the command you type.

### How do I create a custom slash command in Claude Code?

Create a Markdown file in .claude/commands/ (or ~/.claude/commands/ for personal). The filename becomes the command, so deploy.md creates /deploy. Use $ARGUMENTS to capture text typed after the command, and add a description in the YAML frontmatter for help text.

### How does Claude know when to use a Skill automatically?

Claude reads each Skill's description and loads the skill when your request matches it. That is why a clear, specific description is the most important part of a Skill. To prevent automatic loading and make a skill manual-only, set disable-model-invocation: true.

### What is dynamic context injection in a Skill?

A line like !`git diff HEAD` in a SKILL.md tells Claude Code to run that command and replace the line with its output before the model reads the skill. The skill then arrives with live data (your diff, your branch, a file listing) already inlined, so the response is grounded in real state.

### Do my old .claude/commands files still work?

Yes. After the merge into Skills, existing files in .claude/commands/ keep working and support the same frontmatter. Skills are the recommended path going forward because they support supporting files and automatic invocation, and if a skill and a command share a name, the skill wins.
