Slash Commands in Claude Code: Complete Guide to Creating and Using (2026)
If you use Claude Code in the terminal, you may have already noticed that typing/opens a list of commands. These are theslash commands-- shortcuts that perform specific actions without having to type long prompts.
But most users stop at native commands and never discover that they cancreate your own slash commandsusing Skills. In this guide, you will learn everything: from the built-in commands to how to create a costm skill from scratch.
1. What are slash commands in Claude Code
Slash commands are commands that start with/and that you type directly at the Claude Code prompt. They are divided into two types:
- Native (built-in):It already comes with Claude Code. They perform system actions such as clearing context, viewing costs or starting projects.
- Custom (Skills):created by you (or installed by third parties). Appear in the same list when you type
/. Each skill is a Markdown file with instructions that Claude follows when the command is triggered.
The bottom line: costm slash commands transform Claude Code from a generic wizard into aspecialist on demand. You type/auditoria-seoand it performs a full audit. Digital/gerar-copyand he creates copy following specific frameworks.
How Claude detects skills:When starting a session, Claude Code scans the folders.claude/skills/of the local project and~/.claude/skills/global. Each subfolder with a fileSKILL.mdis registered as an available slash command. The name and description come from the file's frontmatter.
2. All native slash commands
Claude Code comes with a series of built-in commands. Here is the complete and updated list:
| Command | What it does |
|---|---|
/help | Shows the list of available commands and general help |
/clear | Clears all context of the current conversation, starting from scratch |
/compact | Compresses conversation history to save tokens (accepts optional instructions on how to summarize) |
/cost | Shows the accumulated token cost of the current session |
/init | Generate the fileCLAUDE.mdof the project with instructions based on the codebase |
/review | Do code review of the current diff (changes not committed) |
/terminal-setup | Install the Shift+Cmd+U shortcut to get terminal context |
/config | Open the Claude Code configuration file |
/logout | Closes the current authentication session |
/login | Switch account or authentication method |
/doctor | Diagnose installation and configuration problems |
/permissions | Show and manage tool permissions |
/memory | Edit the fileCLAUDE.mdof the project |
/model | Switch between available templates (Opus, Sonnet, Haiku) |
/vim | Activate vim editing mode in input |
These commands cover system operations. But note: none of them specialize inmarketing, SEO, copywriting, development with specific frameworksor any technical domain. For this, you need skills.
3. How to create costm slash commands using Skills
Claude Code's Skills system is straightforward: you create a folder with a Markdown file and Claude Code does the rest. No package installation, no compilation, no CLI configuration.
The 3-step process:
- Create the skill folderinside
.claude/skills/(in the project) or~/.claude/skills/(global) - Create the file
SKILL.mdwith YAML frontmatter + Markdown instructions - Ready.The next time you type
/In Claude Code, your skill appears in the list
$ mkdir -p .claude/skills/auditoria-seo
$ touch .claude/skills/auditoria-seo/SKILL.md
# Agora abra o Claude Code e digite /
$ claude
> / ← sua skill "auditoria-seo" aparece aqui
Claude Code detects new skills automatically when starting the session. If you add a skill with Claude Code already open, start a new session with/clearor restart Claude Code for it to appear.
4. Complete structure of a skill
A skill can be simple (just theSKILL.md) or complete (with tests and reference files). Here is the maximum structure:
minha-skill/
SKILL.md ← instrucoes (obrigatorio)
evals/
evals.json ← testes automateds (opcional)
references/
dados.md ← contexto extra (opcional)
template.html ← templates (opcional)
The SKILL.md file
The main file for every skill. It has two parts: theYAML frontmatter(metadata) and theMarkdown body(instructions).
name: auditoria-seo
description: Faz auditoria SEO completa de uma pagina ou site
---
# Auditoria SEO
Voce e um especialista em SEO tecnico e on-page.
Quando acionado, execute a seguinte auditoria:
## Checklist
1. Analise a tag <title> (comprimento, keyword)
2. Verifique a meta description
3. Avalie a estrutura de headings (H1-H6)
4. Confira canonical, hreflang, robots
5. Analise schema markup (JSON-LD)
6. Verifique imagens (alt text, formatos)
7. Analise links internos e externos
8. Avalie Core Web Vitals potenciais
## Formato de saida
Entregue um relatorio com:
- Score de 0-100
- Problemas criticos (vermelho)
- Improvements recomendadas (amarelo)
- O que esta bom (verde)
Frontmatter fields
| Field | Mandatory | Description |
|---|---|---|
name | Sim | Name of the slash command (appears as/nome) |
description | Sim | Short description that appears in the command list |
The Markdown body accepts any formatting: lists, tables, code blocks, headings. Everything you write there will be the instruction that Claude follows when the user activates the command.
references/ folder
Files in folderreferences/are loaded as additional context when the skill is triggered. Use for:
- Output templates (HTML, JSON, CSV)
- Reference data (style guides, tone of voice, brand guidelines)
- Examples of expected input and output
- Domain-specific technical documentation
evals/ folder
The fileevals.jsondefines automated tests to validate whether the skill is working correctly. It is useful for those who distribute skills or want to guarantee quality after updates.
5. Where to put files: local vs global
Claude Code looks for skills in two places:
| Location | Path | Scope |
|---|---|---|
| Project (location) | .claude/skills/ |
Only available when you open Claude Code in that project directory |
| User (global) | ~/.claude/skills/ |
Available in any project, in any directory |
When to use each one?
- Location:project-specific skills. Example: a code review skill that follows the conventions of that repository, or a deployment skill that uses the project's specific pipeline.
- Global:skills that you use in any context. Example: SEO audit, copy generation, translation, Markdown formatting. These are utility skills that are independent of the project.
Practical tip:If you work in marketing, put your marketing skills in the global folder (~/.claude/skills/). So, no matter what project you're on -- your copy, SEO, ads and analytics skills are always available.
If there is a local and a global skill with the same name, the local one has priority. This allows you to costmize behaviors per project.
Want to master this faster?
Everything you are learning here becomes 10x more powerful with ready-made skills. Instead of typing commands manually, skills do the heavy lifting for you. 748+ professional skills, installs in 2 minutes.
Quero as Skills — $96. Practical examples: 3 skills from scratch
We are going to create three real skills for you to understand the pattern and start using today.
Example 1: On-Page SEO Audit
name: seo-audit
description: Auditoria SEO on-page completa com score e recomendacoes
---
# SEO Audit Skill
Voce e um consultor SEO senior com 10 anos de experiencia.
## Ao ser acionado:
1. Peca a URL ou o HTML da pagina
2. Analise os seguintes elementos:
- Title tag (50-60 chars, keyword presente)
- Meta description (150-160 chars)
- H1 unico e com keyword principal
- Hierarquia H2-H6 logica
- Schema markup (JSON-LD)
- Canonical e hreflang
- Alt text em imagens
- Links internos (min 3-5)
- Core Web Vitals potenciais
## Formato do relatorio:
Score: X/100
[CRITICO] Problemas que precisam de correcao imediata
[ALERTA] Improvements recomendadas
[OK] Elementos que estao corretos
With this skill installed, you type/seo-auditin Claude Code and it starts the audit automatically.
Example 2: Copy Generator (AIDA)
name: gerar-copy
description: Gera copy de vendas usando framework AIDA
---
# Copywriter AIDA
Voce e um copywriter direto-resposta especializado
no framework AIDA (Atencao, Interesse, Desejo, Acao).
## Ao ser acionado:
Peca ao usuario:
1. Produto/servico
2. Publico-alvo
3. Principal dor/desejo
4. Formato (landing page, email, anuncio, post)
## Regras de escrita:
- Frases curtas (max 20 palavras)
- Paragrafos de 1-3 linhas
- Beneficios > funcionalidades
- Use numeros especificos ("em 14 dias", nao "rapidamente")
- Tom: confiante, direto, sem jargao
- Inclua pelo menos 3 CTAs ao longo do texto
Example 3: Automated Code Review
name: code-review
description: Code review detalhado com foco em seguranca e performance
---
# Code Review Skill
Voce e um engenheiro de software senior fazendo code review.
## Ao ser acionado:
1. Leia o diff atual (git diff) ou o arquivo indicado
2. Analise os seguintes aspectos:
### Seguranca
- SQL injection, XSS, CSRF
- Secrets/credenciais expostas
- Validacao de input
### Performance
- Queries N+1
- Memory leaks potenciais
- Operacoes desnecessarias em loops
### Qualidade
- Naming conventions
- DRY (codigo duplicado)
- Complexidade ciclomatica
- Testes ausentes
## Formato:
Para cada issue encontrada:
[SEVERITY] arquivo:linha - descricao + sugestao de fix
Note the pattern: every skill follows the same structure -- frontmatter with name and description, role context (who Claude should be), instructions for when triggered, execution rules and output format.
7. Advanced tips: evals, references and composition
Using reference files
For skills that need rich context, add files to the folderreferences/. Claude Code loads these files automatically when the skill is activated.
email-marketing/
SKILL.md
references/
tone-of-voice.md ← guia de tom de voz da marca
melhores-subjects.md ← subjects lines que funcionaram
template-email.html ← template HTML padrao
No SKILL.md, you can reference these files directly in the instructions. Claude will have access to them as part of the skill context.
Testing with evals
The fileevals/evals.jsonallows you to define tests to validate that the skill works as expected. The structure follows the standard:
Evals are useful for those who create skills for teams or for distribution -- they ensure that updates do not break the expected behavior.
Composition: combining multiple skills
You can create skills that reference other skills. For example, a "product launch" skill that directs Claude to execute sequentially:
- The market research skill
- The copy generation skill
- The landing page creation skill
- The tracking configuration skill
This turns Claude Code into a true automated workflow, where each step feeds into the next.
Good practices when writing skills
- Be specific on paper:“You are a senior copywriter specializing in B2B SaaS” works better than “You are a writer”
- Set the output format:If you want a table, a list or a report, specify. Claude follows the structure you define
- Include restrictions:"Never use technical jargon", "Limit to 500 words", "Always include examples". Constraints make the output more predictable
- Use clear sections:setote context, instructions, rules and format with H2 or H3 headings. Claude better processes well-structured instructions
- Test before distributing:Run the skill several times with different inputs to ensure consistency
8. Why not create it from scratch?
Youhe cancreate all your skills from scratch. But consider what this involves:
- Domain search:each skill requires in-depth knowledge of the area. A Google Ads skill, for example, needs to cover campaign structure, bidding strategies, quality score, extensions, scripts -- there are hours of research just for one skill
- Iteration and testing:the first version of a skill is rarely the best. You need to test with different inputs, adjust instructions, refine the output format. There are multiple rounds of iteration
- Maintenance:platforms change. What was best practice in Meta Ads 6 months ago may be outdated. Skills need constant updating
- Coverage:creating 5 skills is viable. Creating 50 is laborious. Create 134 marketing skills or 750 development skills and a months-long project
The real cost of creating skills from scratch isn't just the writing time -- it's theopportunity cost. Every hour you spend writing a skill is an hour youit is notusing Claude Code to deliver real work to your clients.
The math is simple
If you charge R$100/hour and spend 2 hours creating a skill, the real cost was R$200. For $9, you have access to an entire package with hundreds of ready-made, tested and updated skills.
It's not about "not knowing how to create" -- it's about using your time on what generates revenue and leaving the infrastructure ready for those who have already done the heavy lifting.
Next step: install skills and see the difference
You already know the basics. Now imagine Claude Code knowing how to do all this himself — SEO, copywriting, code review, deployment, data analysis. That's what skills do. Lifetime access, updates included.
Ver o Mega Bundle — $9FAQ
Native slash commands (like/help, /clear, /compact) are commands built into Claude Code that perform system actions. Custom skills are filesSKILL.mdthat you create in the folder.claude/skills/-- they appear as costm slash commands in the same list. When you type/, both natives and skills appear together.
Create a folder inside.claude/skills/in your project (for local access) or in~/.claude/skills/(for global access). Inside the folder, create a fileSKILL.mdwith YAML frontmatter containingname e description, followed by instructions in Markdown. Claude Code automatically detects and the command appears when you type/in the terminal.
Yes. Claude Code scans all folders within.claude/skills/and records eachSKILL.mdas a setote slash command. You can combine local skills (project specific) with global skills (available in all projects). Packages likeminhakills.iooffer 748+ professional skills in 7 categories ready to install at once.