Claude Almanac
Core

Slash Commands and Skills

Custom actions invoked directly in conversations, unified under the Skills framework.

Claude Code Slash Commands and Skills

Slash commands (starting with /) are custom actions you can invoke directly in Claude Code conversations. Since Claude Code unified the .claude/commands/ system with the broader Skills framework, all slash commands are now implemented as skills.

Overview

Key Features:

  • Invoke with /skill-name
  • Claude can invoke automatically when relevant (unless disabled)
  • Include supporting files, dynamic context, and complex logic
  • Work across interactive mode, print mode, and subagents

Built-in Slash Commands

CommandPurpose
/clearClear conversation history
/compact [instructions]Compact conversation with optional focus
/configOpen Settings interface
/contextVisualize current context usage
/costShow token usage statistics
/doctorCheck Claude Code installation health
/exitExit the REPL
/export [filename]Export conversation to file/clipboard
/helpGet usage help
/initInitialize project with CLAUDE.md guide
/mcpManage MCP server connections
/memoryEdit CLAUDE.md memory files
/modelSelect or change AI model
/permissionsView or update permissions
/planEnter plan mode directly
/rename <name>Rename current session
/resume [session]Resume a conversation
/rewindRewind conversation and/or code
/statsVisualize usage and session history
/statusShow version, model, account info
/statuslineSet up Claude Code's status line UI
/tasksList and manage background tasks
/teleportResume a remote session
/themeChange color theme
/todosList current TODO items
/usageShow plan usage limits
/terminal-setupConfigure terminal for extended shortcuts

MCP Prompts: MCP servers expose prompts as /mcp__<server>__<prompt>

Creating Custom Skills

Directory Structure

# Project-specific skills (version controlled)
mkdir -p .claude/skills/my-skill

# Personal skills (all projects)
mkdir -p ~/.claude/skills/my-skill

Basic SKILL.md

---
name: my-skill
description: What this skill does and when to use it
---

Your instructions here...

Invoke with /my-skill.

Full Skill Structure

my-skill/
├── SKILL.md           # Required: Main instructions
├── reference.md       # Optional: Detailed docs
├── examples.md        # Optional: Usage examples
├── template.txt       # Optional: Template for Claude
└── scripts/
    └── helper.py      # Optional: Executable scripts

SKILL.md Frontmatter

---
name: my-skill
description: Detailed description of what this skill does
disable-model-invocation: true
user-invocable: true
allowed-tools: Read, Grep, Bash
model: sonnet
context: fork
agent: Explore
argument-hint: [argument1] [argument2]
hooks:
  PreToolUse: ./pre-tool-hook.sh
---

Field Reference

FieldRequiredDescription
nameNoDisplay name (lowercase, hyphens, max 64 chars)
descriptionRecommendedWhat it does and when to use it
disable-model-invocationNoPrevent auto-loading (manual only)
user-invocableNoHide from / menu (Claude only)
allowed-toolsNoTools without permission prompts
modelNoModel when skill is active
contextNoSet to fork for isolated subagent
agentNoSubagent type with context: fork
argument-hintNoAutocomplete hint
hooksNoSkill lifecycle hooks

Skill Parameters

Passing Arguments

---
name: fix-issue
description: Fix a GitHub issue
---

Fix GitHub issue $ARGUMENTS following our coding standards.

Invoke: /fix-issue 123

Available Variables

VariableDescription
$ARGUMENTSAll arguments passed to the skill
${CLAUDE_SESSION_ID}Current session ID

Dynamic Context

Use !`command` syntax for dynamic data:

---
name: pr-summary
description: Summarize changes in a pull request
---

## Pull request context
- PR diff: !`gh pr diff`
- PR comments: !`gh pr view --comments`

Summarize this pull request...

Invocation Control

FrontmatterYou InvokeClaude InvokesUse Case
(default)YesYesGeneral knowledge/tasks
disable-model-invocation: trueYesNoSide-effects (deploy, commit)
user-invocable: falseNoYesBackground knowledge

Tool Restrictions

---
name: safe-reader
description: Read files without making changes
allowed-tools: Read, Grep, Glob
---

Available: Read, Write, Edit, Bash, Glob, Grep, Skill

Integration with Other Features

With Subagents

---
name: deep-research
description: Research a topic thoroughly
context: fork
agent: Explore
---

Research $ARGUMENTS thoroughly...

With Hooks

---
name: my-skill
hooks:
  PreToolUse: ./validate-before-running.sh
---

With Extended Thinking

Include "ultrathink" in skill content:

---
name: complex-analyzer
description: Deep analysis with extended thinking
---

Perform ultrathink analysis of...

Skill Scope Hierarchy

LocationPathApplies toPriority
EnterpriseManaged settingsOrganization1 (highest)
Personal~/.claude/skills/<skill>/SKILL.mdAll projects2
Project.claude/skills/<skill>/SKILL.mdThis project3
Plugin<plugin>/skills/<skill>/SKILL.mdWhere installedVia namespace

Best Practices

Good Descriptions

# Good: Specific and action-oriented
description: Explains code with visual diagrams and analogies. Use when explaining how code works, teaching a codebase, or answering "how does this work?"

# Poor: Too vague
description: Code explanation skill

Skill Content Types

Reference Content (knowledge, no action):

---
name: api-conventions
description: API design patterns for this codebase
disable-model-invocation: false
---

When writing API endpoints:
- Use RESTful naming conventions
- Return consistent error formats

Task Content (step-by-step instructions):

---
name: deploy
description: Deploy the application to production
disable-model-invocation: true
---

1. Run the test suite
2. Build the application
3. Push to deployment

Keep SKILL.md Focused

Max 500 lines. Reference supporting files:

## Additional resources

- For complete API details, see [reference.md](reference.md)
- For usage examples, see [examples.md](examples.md)

Restrict Availability

{
  "permissions": {
    "deny": [
      "Skill(deploy:*)"
    ]
  }
}

Advanced Patterns

Dynamic Context with Git

---
name: commit-helper
description: Help write better commits
allowed-tools: Bash(git:*)
---

## Repository state
- Current branch: !`git rev-parse --abbrev-ref HEAD`
- Changed files: !`git diff --name-only`
- Current status: !`git status --short`

Help me write a conventional commit message...

Chaining Skills and Subagents

---
name: research-and-report
description: Research and generate report
context: fork
agent: Explore
---

1. Research $ARGUMENTS thoroughly
2. Find relevant code and documentation
3. Generate findings report

Sources

On this page