Claude Code Slash Commands — the official command table and custom commands
The official command reference lists each command with its usage and version requirement; custom commands have been merged into skills, and the older .claude/commands/ files keep working.
Common commands in the official reference
1) /init — initialize a project (write CLAUDE.md + .claude/ dir); 2) /review — run code review (alias of /code-review); 3) /compact — compress the current conversation context (the official docs: summarize the conversation so far to make room in the context window); 4) /cost — token usage for the current session (alias of /usage); 5) /loop — poll-execute a prompt / command on a schedule (deploy monitoring); 6) /schedule — create a Routine (see our Routines guide); 7) /plugin — browse / install / disable plugins; 8) /help — command list; the official command reference also has /context, /usage, /memory, /permissions, /output-style, /agents, /import.
/compact and /context both deal with context
Compact summarizes the current conversation and drops intermediate churn. Versus starting a new session: working memory and subagent state are preserved. The official reference keeps the two apart: /compact summarizes the conversation so far, optionally with focus instructions, while /context visualizes current context usage as a colored grid and offers optimization suggestions. The auto-compact window is set with /autocompact, either a size such as 500k or auto. /cost is an alias for /usage, so usage is read there.
Where custom commands and skills live
Custom commands have been merged into skills: a file at <repo>/.claude/commands/<name>.md and a skill at .claude/skills/<name>/SKILL.md both create the same command and work the same way, and your existing .claude/commands/ files keep working. The directory name, or the name in the frontmatter, becomes the command you type. Personal skills live in ~/.claude/skills/ and are available across all your projects; project skills live in the repository's .claude/skills/ folder and travel with it. Arguments are available via the $ARGUMENTS placeholder, with indexed forms such as $1; wrap multi-word values in quotes. The official docs suggest preferring a skill for new work, since skills also support supporting files.
How hooks, subagents, and plugins divide the work
Hooks are event-driven and cannot be invoked directly by the user: SessionStart and SessionEnd fire per session, UserPromptSubmit, Stop, and StopFailure per turn, and PreToolUse and PostToolUse on every tool call inside the agentic loop. A subagent is a dispatchable unit of work that runs in its own context window with a custom system prompt and specific tool access. A plugin is a bundle of client features and can ship hooks, skills, and slash commands at once. A slash command is the shortcut you type yourself. Before you design anything, decide which of the three you are writing: a command, an automation, or a task.
FAQ
How do we hand the team's slash commands to new members?
Commit the .claude/skills/ directory to the repository and the commands are available to anyone who clones it. Personal skills under ~/.claude/skills/ apply to one machine only, so each person maintains their own.
Can slash commands take arguments?
Yes — use $ARGUMENTS in the command file to capture additional text from /cmd arg1 arg2. Claude substitutes and injects the full prompt. An indexed form such as $1 picks one argument by position; wrap multi-word values in quotes. If you invoke a command with arguments but no placeholder in its content receives one, Claude Code appends what you typed, prefixed with ARGUMENTS:, to the end of the content, so Claude still sees it. See Claude Code docs for details.
Does Codex have similar slash commands?
Yes, but the two are separate systems. The official OpenAI Codex CLI documentation lists /init (create an AGENTS.md file with instructions for Codex), /status (show current session configuration), /permissions (choose what Codex is allowed to do), /model (choose what model and reasoning effort to use), and /review (review any changes and find issues). The names and the extension mechanism are not shared, so use each project's own documentation;
Run Claude Code slash commands on QCode
Call Claude Code through the QCode endpoint with your QCode key; model calls are billed per token and per-model rates are listed on the Models page. The official usage of slash commands and custom commands is at code.claude.com/docs/en/commands.
Open QCode