Feature: Slash Commands
Relevant source files
The following files were used as context for generating this wiki page:Slash Commands are custom, user-defined workflows that can be invoked within the Claude Code environment by typing /command-name. They serve as shortcuts for complex or repetitive tasks, providing Claude with a specific set of instructions, allowed tools, and context to execute a job. These commands are a core part of automating development workflows, from running quality checks to managing pull requests and interacting with external ticketing systems.
The entire system is file-based, making commands easy to create, share, and version control alongside the project's source code. They are defined in Markdown files located in the .claude/commands/ directory.
Sources: README.md:100-101, README.md:600-602
Architecture and Configuration
Slash Commands are defined by individual Markdown files within a dedicated directory. This simple, file-based architecture makes them highly discoverable and manageable.
Sources: README.md:98, README.md:600-602
Directory Structure
All command files must be placed in the .claude/commands/ directory at the root of the project. The filename (without the .md extension) determines the name of the command.
The following diagram illustrates the location of command files within the project structure.
Sources: README.md:88-102
Command File Format
Each command is a Markdown file composed of two main parts: a YAML frontmatter block for configuration and a Markdown body for the instructions.
---
description: Brief description shown in command list
allowed-tools: Bash(git:*), Read, Grep
---
# Command Instructions
Your task is to: $ARGUMENTS
## Steps
1. Do this first
2. Then do this
Sources: README.md:604-614
Frontmatter Configuration
The frontmatter configures the command's behavior and metadata.
| Field | Description | Example |
|---|---|---|
description | A brief description of the command's purpose, which is displayed in the command list. | Brief description shown in command list |
allowed-tools | A comma-separated list of tools that the command is permitted to use. This acts as a security and scope-limiting measure. | Bash(git:*), Read, Grep |
Sources: README.md:605-607
Command Body and Variables
The body of the Markdown file contains the system prompt and detailed instructions for Claude. It supports special variables to handle arguments passed to the command.
| Variable | Description |
|---|---|
$ARGUMENTS | A single string containing all arguments passed after the command name. |
$1, $2, ... | Individual positional arguments passed to the command. |
Sources: README.md:616-618
Inline Bash Execution
Commands can execute and embed the output of shell commands directly into the instruction prompt using the !``...`` syntax. This is useful for dynamically gathering context from the local environment, such as the current Git branch or recent commits.
Example:
Current branch: !`git branch --show-current`
Recent commits: !`git log --oneline -5`
This allows the command to be aware of the current state of the repository when it runs.
Sources: README.md:620-624
Command Execution Flow
When a user invokes a slash command, a sequence of events is triggered to process the request and execute the defined task.
This sequence diagram shows the interaction between the user, Claude, and the command's definition file.
Sources: README.md:600-602, README.md:616-618
Available Commands
The repository provides several pre-built commands for common development workflows.
| Command | Description | Source File |
|---|---|---|
/onboard | Guides the user through a deep exploration of a task, helping to understand requirements and formulate a plan. | .claude/commands/onboard.md |
/pr-review | Initiates a comprehensive pull request review workflow. | .claude/commands/pr-review.md |
/pr-summary | Generates a summary description for a pull request. | .claude/commands/pr-summary.md |
/code-quality | Runs a series of quality checks on the codebase. | .claude/commands/code-quality.md |
/docs-sync | Checks for alignment between documentation and recent code changes. | .claude/commands/docs-sync.md |
/ticket | Manages a full ticket workflow, from reading requirements in JIRA/Linear to implementing the feature and updating the ticket status. | .claude/commands/ticket.md |
Sources: README.md:602, README.md:763-771
Deep Dive: /ticket Command Workflow
The /ticket command is a powerful example of integrating Claude with external systems like JIRA or Linear via MCP Servers. It automates the entire lifecycle of a development ticket.
The workflow for the /ticket command is as follows:
This diagram illustrates the end-to-end automation provided by the /ticket command, from initial ticket ingestion to final pull request creation.
Sources: README.md:315-331, .claude/commands/ticket.md
Summary
Slash Commands are a foundational feature for customizing and automating developer workflows with Claude Code. By defining simple Markdown files, teams can create powerful, reusable, and version-controlled instructions for tasks ranging from code reviews and quality checks to complex integrations with external project management tools. This file-based system provides a low barrier to entry for creating sophisticated automations that are tailored to a project's specific needs.
Sources: README.md:98-102, README.md:600-602