Skip to main content
articleFebruary 2, 2026

The Practical Guide to AI Slash Commands

Slash commands turn repetitive AI prompts into reusable, instantly-triggerable shortcuts—store them once, invoke them forever across Claude Code, Cursor, Gemini, and Codex.

Slash commands let you define custom commands for repeatable processes. Instead of constantly retrieving stored prompts and pasting them manually, you create a command file once and invoke it by name.

How They Work

Command files require frontmatter metadata:

  • Description of what the command does
  • Argument hints for expected parameters
  • Allowed tools the agent can execute
  • Model designation (optional)

The filename maps directly to the command name. fix-pr-comments.md becomes /fix-pr-comments.

When to Use Them

  • Manual workflow triggering needed
  • Simple, repetitive tasks
  • Frequent prompt reuse

Directory Locations by Tool

ToolGlobal CommandsProject Commands
Claude Code~/.claude/commandsproject/.claude/commands
Cursor~/.cursor/commandsproject/.cursor/commands
Gemini~/.gemini/commandsproject/.gemini/commands
Codex~/.codex/promptsproject/.codex/prompts
OpenCode~/.config/opencode/commands/.opencode/commands/

Note: Some platforms like Codex have deprecated this feature.

Connections