# Claude Code Custom Commands Legacy system for extending Claude Code with custom slash commands. Superseded by [[Claude Code Skills]], but existing commands continue to work. ## Types - **Project-specific**: stored under `<project root>/.claude/commands/`, prefix: `/project:` - **Personal**: stored under `~/.claude/commands`, prefix: `/user:` ## Syntax `/<prefix>:<command_name> [arguments]` Commands can be namespaced: `.claude/commands/frontend/component.md` → `/project:frontend:component` ## Arguments Dynamic values via the `$ARGUMENTS` placeholder: ```bash # Command definition echo "Fix issue #$ARGUMENTS following our coding standards" > .claude/commands/fix-issue.md # Usage > /project:fix-issue 123 ``` ## Requirements - Must use Markdown format (`.md` extension) - Content = the prompt or instructions - Placed in the appropriate commands directory ## Commands from mods A [[Claude Code Mods|mod]] can add a slash command that runs code instead of a prompt: `$.command.register({ name, description, argumentHint })` in a `session.start` hook, then a `command.run` hook that returns `{ text }` (shown in the transcript, and Claude reads it) or `{}`. No Claude turn is needed, and with `immediate: true` the command runs while Claude is working. A name already taken by a built-in command is refused. ## References - Add a command from a mod (official docs): https://code.claude.com/docs/en/plugins/mods/api#add-a-command - Custom commands: https://docs.anthropic.com/en/docs/claude-code/slash-commands#custom-slash-commands ## Related - [[Claude Code]] - [[Claude Code Skills]] - [[Claude Code Mods]] - [[Claude Code Extension Points]]