Custom Commands in AI
From the Claude Code cheat sheet ยท Essential Commands ยท verified Jul 2026
Custom Commands
Create your own slash commands
markdown
# Custom command locations:
~/.claude/commands/ # User-level commands
.claude/commands/ # Project-level commands
# Example: optimize.md
---
name: optimize
description: Optimize performance
---
Find and optimize performance bottlenecks
# Example with arguments: fix-issue.md
---
name: fix-issue
description: Fix GitHub issue
---
Fix issue #$ARGUMENTS from our GitHub repo
# Use custom commands:
/optimize
/fix-issue 123markdown
// EXAMPLE: Creating a test runner command
// File: ~/.claude/commands/test.md
---
name: test
description: Run tests for a specific file
---
Run the test suite for $ARGUMENTS and fix any failures
// Usage:
> /test auth.service.ts๐ Commands are markdown files
๐ Support arguments with $ARGUMENTS
๐ Project commands override user commands
customcommands