Type / at the start of the input to see the live list for your build. The commands that matter day to day are /clear, /compact, /rewind, /context, /model, /effort, /usage, /init, /resume, and /plan. Custom commands are markdown files: .claude/commands/deploy.md and .claude/skills/deploy/SKILL.md both create /deploy. Arguments use $ARGUMENTS, 0-based $0 and $1, or named placeholders declared in frontmatter.
- Type
/at the start of the input to list every command your build actually has. Text after the name becomes arguments. - The context trio (
/clear,/compact,/rewind) does more for cost and quality than anything else. - Custom commands merged into skills.
.claude/commands/deploy.mdand.claude/skills/deploy/SKILL.mdboth create/deploy; skills add supporting files and invocation control. - Positional placeholders are 0-based:
$0is the first argument,$1the second. !`command`runs a shell command before Claude sees the prompt and substitutes the output. This is preprocessing, not tool use.- Many of the commands in the
/menu are bundled skills the model can also invoke on its own.
Session and context
These are the ones you will use every day. Context management is the single highest-leverage habit in Claude Code, because cost, rate-limit consumption, and answer quality all degrade as context fills.
| Command | What it does | When to reach for it |
|---|---|---|
/clear [name] | Starts a new conversation with empty context; the name labels the old one in the /resume picker | Starting an unrelated task in the same repo |
/compact [instructions] | Summarises the conversation so far; optional focus instructions | Same task, but context is getting heavy |
/rewind [N] | Rolls back code and conversation to a checkpoint, or a specific turn | The agent went down a wrong path |
/context [all] | Visualises context usage as a colored grid with optimization suggestions | Working out why turns got expensive |
/autocompact [auto|<tokens>] | Sets how full the window gets before auto-compaction fires | You want a bigger or smaller working window |
/resume [id|pattern] | Reopens a previous conversation, or opens a picker | Coming back to yesterday's work |
/branch [name] | Branches the conversation at this point | Trying a different direction without losing this one |
/fork [prompt] | Copies the conversation into a new background session | Two directions at once, independently |
/btw [question] | Asks a side question without adding it to the conversation | A quick aside you do not want in context forever |
/export [filename] | Exports the conversation as plain text | Sharing what the agent did, or filing a bug |
Model, effort, cost, and configuration
| Command | What it does |
|---|---|
/model [model] | Switches model and saves it as the default for new sessions |
/effort [level|auto] | Sets reasoning effort: low, medium, high, xhigh, max, or ultracode |
/usage (alias /cost) | Token usage and cost for the session, plus plan usage bars and an attribution breakdown |
/usage-credits | Buys usage beyond your plan limit, or requests it from your admin |
/status | Task status, model, effort level, session info. Runs without interrupting the response |
/config [key=value] | Opens settings: theme, model, output style, auto-update channel |
/fast [on|off] | Toggles fast mode, which trades price for latency on supported models |
/doctor | Bundled skill. Runs a setup checkup and can fix what it finds |
/login, /logout | Account switching |
/upgrade | Installs a newer Claude Code on your release channel |
Switching model mid-session is more useful than it sounds. Plan an approach on a large model, then drop to a smaller one for the mechanical implementation, all inside the same conversation. /effort is the finer dial: low for subagents and simple edits, high or xhigh for anything you would be annoyed to get wrong.
Project setup and repo knowledge
| Command | What it does |
|---|---|
/init | Analyses the repo and writes a CLAUDE.md |
/memory | Edits CLAUDE.md memory files and manages auto-memory entries |
/add-dir <path> | Gives the session access to another directory |
/cd <path> | Moves the session to a new working directory, preserving the prompt cache |
/permissions | Reviews and changes what the agent may do without asking |
/hooks | Views hook configuration for tool events |
/skills | Views, creates, enables, disables, or deletes skills |
/agents | Points you at .claude/agents/ for subagent management |
/mcp | Manages MCP server connections and OAuth |
/worktree [list|create|remove|checkout] | Manages git worktrees for parallel branches |
/import [codex|gemini] | Brings instruction files, MCP servers, commands, subagents, and skills over from another agent |
/plan | Switches into plan mode: Claude outlines the approach and waits for approval |
Writing your own
.claude/commands/ or a directory in .claude/skills/, commit it, and the whole team gets the same workflow.This is where the real leverage is, and the mechanics changed in 2026: custom commands merged into skills. Both shapes still work and both produce a command you invoke the same way.
| Where the file lives | Command name | What you get |
|---|---|---|
.claude/commands/deploy.md | /deploy | The classic form. Still supported, same frontmatter |
.claude/skills/deploy/SKILL.md | /deploy | Plus a directory for supporting files, invocation control, and automatic loading |
~/.claude/skills/deploy/SKILL.md | /deploy | Personal, available in every repo |
A command that only you can fire
---
name: review
description: Review the current diff like a senior engineer
disable-model-invocation: true
argument-hint: "[path]"
---
Review the staged and unstaged changes in this repository.
Focus on, in order:
1. Correctness. Does it do what the commit message claims?
2. Failure modes. What happens on empty input, network failure, concurrency?
3. Tests. Is the new behaviour actually covered?
4. Consistency with the patterns already in this codebase.
Do not comment on formatting; the linter handles that.
Report findings most severe first. If you find nothing real, say so
rather than inventing something to justify the review.
disable-model-invocation: true is the important line. It means only you can trigger this, which is what you want for anything with side effects: /deploy, /commit, /send-slack-message. You do not want Claude deciding to deploy because the code looks ready.
Arguments
Four substitution forms, and the indexed one is 0-based, which trips up anyone who learned the old $1-is-first convention.
| Placeholder | Expands to |
|---|---|
$ARGUMENTS | Everything the user typed after the command name |
$ARGUMENTS[N] | The Nth argument, 0-based |
$0, $1 | Shorthand for the above. $0 is the first argument |
$name | A named argument declared in the arguments frontmatter list |
---
name: fix-issue
description: Fix a GitHub issue end to end
disable-model-invocation: true
arguments: [issue]
allowed-tools: Bash(gh *)
---
Fix GitHub issue #$issue.
1. Run `gh issue view $issue` to read it.
2. Find the relevant code. Do not guess at file locations.
3. Write a failing test that reproduces the issue first.
4. Fix it. Keep the change minimal.
5. Run the full suite.
6. Commit as `fix: <summary> (#$issue)`.
> /fix-issue 482
Indexed placeholders use shell-style quoting, so /my-skill "hello world" second makes $0 expand to hello world. An indexed placeholder with no matching argument stays in the text unchanged; a named one expands to an empty string. To write a literal $1.00 in prose, escape it as \$1.00.
Dynamic context: run a command before Claude sees anything
This is the feature that turns a prompt template into a real tool. The !`command` syntax runs a shell command and substitutes its output into the prompt before the prompt is sent. Claude never sees the command, only the data.
---
name: pr-summary
description: Summarize changes in a pull request
context: fork
agent: Explore
allowed-tools: Bash(gh *)
---
## Pull request context
- PR diff: !`gh pr diff`
- PR comments: !`gh pr view --comments`
- Changed files: !`gh pr diff --name-only`
## Your task
Summarize this pull request for a reviewer who has not read the code...
- The inline form is recognised only when
!starts a line or follows whitespace.KEY=!`cmd`is left as literal text and does not run. - Substitution runs once over the original file. Command output is inserted as plain text and never rescanned, so a command cannot emit a placeholder for a later pass.
- For multi-line commands, open a fenced block with
```!instead of using the inline form. context: forkruns the skill in its own subagent, so a huge diff never lands in your main conversation. It runs in the background by default; setbackground: falseto wait for the result.
The frontmatter worth knowing
The fields you will actually use. All are optional; only description is recommended.
| Field | What it does |
|---|---|
description | What the skill does and when to use it. Claude reads this to decide whether to load it |
argument-hint | Autocomplete hint, for example [issue-number] |
arguments | Named positional arguments for $name substitution |
disable-model-invocation | true means only you can invoke it |
user-invocable | false hides it from the / menu; background knowledge only |
allowed-tools | Tools that skip the permission prompt for the invoking turn only |
disallowed-tools | Tools removed from the pool while the skill is active |
model, effort | Override the model or effort level while this skill is active |
context: fork, agent, background | Run it in a subagent, optionally a named one, optionally blocking |
paths | Glob patterns limiting when Claude auto-loads it |
Commands worth writing for your repo
- Release checklist. The eight steps your team always forgets one of. Mark it
disable-model-invocation: true. - New module scaffold. Encodes your directory conventions so the agent stops inventing its own.
- Debug this failure. Points at your actual log locations and test commands, with
!`tail -n 200 var/log/app.log`pulling the log in for free. - Update the docs. Names the files that must change together when an API changes.
Commands, skills, and hooks
Three overlapping extension points. Now that commands and skills are one file format, the question is not "which file do I write" but "who is allowed to fire it".
| Triggered by | Good for | |
|---|---|---|
Slash command / skill with disable-model-invocation | You typing /name | A workflow you invoke deliberately, especially with side effects |
| Skill, default settings | You, or the model deciding it is relevant | Capabilities the agent should reach for on its own |
| Hook | An event in the session | Enforcing something every time, without relying on the model |
Questions people ask
Type / at the start of the input in a session. It lists every command available in your build, including bundled skills, custom commands, and plugin commands, and filters as you type. Availability varies by platform, plan, and environment, so that menu is the only authoritative list.
/compact summarises the conversation so far and continues with a shorter context, keeping continuity, and it costs a pass over the whole conversation. /clear discards it entirely and costs nothing. Use compact mid-task, clear between unrelated tasks.
Create a markdown file. Either .claude/commands/deploy.md or .claude/skills/deploy/SKILL.md creates /deploy. Use YAML frontmatter for the description and argument handling. The skill form is recommended for anything new because it also gets a directory for supporting files.
Effectively yes. Custom commands merged into skills: existing .claude/commands/ files keep working and support the same frontmatter, and if a skill and a command share a name the skill takes precedence. Skills add supporting files, invocation control, and automatic loading.
$ARGUMENTS expands to everything typed after the command name. $ARGUMENTS[N] and its shorthand $N are 0-based, so $0 is the first argument. Declare an arguments list in frontmatter to use readable $name placeholders instead.
Yes. Commit .claude/commands/ or .claude/skills/ with the repository and everyone gets them. Personal ones live under ~/.claude/ and follow you across projects. Review a repo's skills before trusting the workspace, since allowed-tools can pre-approve tools.
It rolls back code and conversation to a checkpoint. With no argument it opens the rewind menu; pass a turn number to return to that turn. Double-tapping Escape reaches the same place. It is the real undo for an agent that went too far.
No. You invoke a slash command; a hook fires automatically on a session event. If a behaviour must happen every single time, use a hook, because it is deterministic and a model-invoked skill is not.
Sources
Every figure above was read from these pages on August 2026. Vendors reprice without notice; if you find a stale number, tell us.
- Claude Code commands reference the built-in command list and queueing rules
- Claude Code: extend Claude with skills the commands-merged-into-skills format, frontmatter, arguments, dynamic context
- Claude Code: hooks the deterministic alternative