Skip to content

AI CODING ASSISTANTS

The Complete Claude Code Command Reference

Every Claude Code command, flag, and slash command in one place — plus the 16 that work on v2.1.224 but never appear in the CLI's own help output.

A Claude Code command is one of three different things depending on where you type it, and no single source lists all three. This reference covers the shell subcommands, the CLI flags, and the in-session slash commands — and reconciles them against what the binary on this machine actually accepts, which turns out not to match its own help output. For what the features behind these commands actually do, the complete Claude Code guide is the place to start. Every figure below was measured against Claude Code v2.1.224 on 2026-08-07 with a script you can re-run.

Key takeaways

  • claude --help is not a complete reference. On v2.1.224 it advertises 65 flags and 13 subcommands; we found 16 documented entries it never mentions but the binary accepts.
  • Seven working subcommands are invisible to --help: attach, daemon, logs, respawn, rm, stop, and remote-control.
  • One documented flag does not exist in this build. --exec returns unknown option '--exec'.
  • The three surfaces are distinct: subcommands manage installation and sessions, flags configure a session at launch, slash commands act inside one.
  • /help is the only authority for your machine, because the slash command set varies by plan, platform, and installed plugins. A probe of every name is the next best thing — see our verified slash commands list.

What counts as a claude code command

Three surfaces, three different lifetimes.

SurfaceWhere it runsExample
SubcommandYour shell, before a sessionclaude mcp list
FlagYour shell, configures the sessionclaude --permission-mode plan
Slash commandInside a running session/context

The distinction matters because the three are documented in different places and behave differently. A flag applies for the life of one session. A subcommand usually does not start a session at all. A slash command only exists once you are inside one.

For authoring your own slash commands, skills and slash commands covers the merge that made them the same feature.

Shell subcommands

These run from your shell. Most do not start a session.

SubcommandWhat it does
claudeStart an interactive session
claude -p "query"Print a response and exit
claude -cContinue the most recent conversation here
claude -r "<id>"Resume a session by ID or name
claude agentsManage and monitor background agents
claude authlogin, logout, status
claude auto-modeInspect or reset the auto mode classifier
claude doctorInstallation and settings diagnostics
claude gatewayRun the enterprise auth/telemetry gateway
claude importImport config from codex or gemini
claude install [target]Install the native build
claude mcpConfigure MCP servers
claude pluginManage plugins and marketplaces
claude project purgeDelete all local state for a project
claude setup-tokenCreate a long-lived token for CI
claude ultrareviewCloud multi-agent review of a branch or PR
claude updateCheck for updates and install

Three are worth calling out. claude doctor reads settings files in the current directory without a trust prompt, which makes it the right first move on a machine you have just set up. claude project purge deletes transcripts, tasks, file history, and the config entry for a project; it takes --dry-run, and you should use it.

claude mcp has its own subcommands — list, get, add, add-json, login, remove — and get is the one to reach for first, because it prints the scope a server was defined in as well as its status. When a server is configured and not working, that status line is usually the whole diagnosis: troubleshooting an MCP server that will not connect walks the states it can report and what each one actually means.

Seven commands the help output omits

Anthropic's CLI reference states plainly that claude --help does not list every flag and that absence from help does not mean a flag is unavailable. That is easy to read past. It is also measurable, so we measured it.

The probe exploits how the argument parser reports errors. Invoking a value-taking flag with no value produces option '--x <v>' argument missing when the binary knows the flag, and unknown option '--x' when it does not. Neither starts a session, so the probe costs nothing and touches no API:

Terminal
claude --max-turns
# → error: option '--max-turns <turns>' argument missing
claude --exec
# → error: unknown option '--exec'

Running that across 40 documented flags and 20 documented subcommands:

Terminal
npm run check:cli
# → claude 2.1.224 (Claude Code)
# → --help advertises 65 flags and 13 commands.
# →
# → Documented and accepted, but absent from --help (16)
# →   --advisor
# →   --append-subagent-system-prompt
# →   --append-system-prompt-file
# →   --channels
# →   --max-turns
# →   --permission-prompt-tool
# →   --ref
# →   --system-prompt-file
# →   --teammate-mode
# →   attach
# →   daemon
# →   logs
# →   remote-control
# →   respawn
# →   rm
# →   stop
# →
# → Documented but rejected by this build (1)
# →   --exec
# →
# → 16/60 documented entries are invisible to --help (27%).

The seven hidden subcommands are a coherent set — they are the background-session controls:

Hidden subcommandWhat it does
claude attach <id>Attach to a background session in this terminal
claude logs <id>Print recent output from a background session
claude stop <id>Stop a background session
claude respawn <id>Restart one with its conversation intact
claude rm <id>Remove one from the list
claude daemonInspect or stop the background-session supervisor
claude remote-controlStart the Remote Control server

All seven print real usage when asked. claude respawn --help returns Usage: claude respawn <id>|--all, which is a flag combination the docs do not show either.

--exec is the one that goes the other way. The CLI reference documents it as running a shell command as a PTY-backed background job, paired with --bg. On v2.1.224 it is rejected outright. Either it landed after this build or it was withdrawn; the docs give no version gate, so treat documented-but-unlisted and documented-but-absent as two different risks.

Flags grouped by what they change

The full set is 65 in --help alone. These are the ones that change behaviour you will notice.

Starting and resuming. -c continues the most recent conversation in this directory; -r resumes a specific one by ID or name. --fork-session gives a resumed session a new ID instead of writing back to the original. -n names a session so /resume shows something readable.

Permissions and tools.

FlagEffect
--permission-modeStart in plan, auto, acceptEdits, dontAsk, bypassPermissions, or manual
--allowedToolsTools that run without prompting
--disallowedToolsDeny rules, including Agent(Explore)
--toolsRestrict the built-in tool set entirely
--add-dirGrant access to directories outside the working tree

Model and effort. --model takes an alias (sonnet, opus, haiku, fable) or a full ID. --effort takes low through max. --fallback-model accepts a comma-separated list tried in order when the primary is overloaded, and only works with --print.

System prompt. --system-prompt replaces the default entirely; --append-system-prompt adds to it. Both have -file variants that are absent from --help. This is the escape hatch when a rule must reach the model at system-prompt level rather than through a Claude Code instructions file, which is delivered as context and carries no compliance guarantee.

Print mode. -p prints and exits. A cluster of flags only works with it: --output-format (text, json, stream-json), --input-format, --json-schema for validated structured output, --max-turns, --max-budget-usd, and --forward-subagent-text.

Troubleshooting. Two flags disable configuration, and the difference matters.

FlagWhat it disables
--safe-modeAll customisations: CLAUDE.md, skills, plugins, hooks, MCP, agents, themes
--bareThe same discovery, plus keychain reads and OAuth; auth becomes API-key only

Reach for --safe-mode when a session behaves oddly and you suspect your own configuration. --bare is for scripted runs where you want to supply every input explicitly.

Slash commands inside a session

There are well over a hundred, and the set depends on your plan, platform, and plugins. /help lists what your session actually has. Everything below is from Anthropic's commands reference.

Correction, 2026-09-03. This section previously said /which <command> names the handler for a command. On Claude Code 2.1.259 /which answers Unknown command, as do /todos and /pr-comments — three names retired in the four weeks since this article was measured against v2.1.224. The evidence, and the three different replies the CLI gives, are in our verified Claude Code slash commands list.

Two of those slash commands are big enough to have their own measurement: /code-review and its effort levels, and /security-review and the empty report it can return.

Context and session state.

CommandPurpose
/contextVisualise context usage, including loaded memory files
/compactSummarise the conversation to free context
/clearStart fresh with empty context
/rewindRoll code and conversation back to a checkpoint
/resumeReturn to a previous conversation
/usageToken usage and cost for this session
/statusCurrent model, effort, and session info

The first three are a catalogue entry here and a workflow elsewhere: what each one actually reclaims is in Claude Code context window management, with a full benchmark of token reduction and prompt cache mechanics in our Claude Code /compact command guide. /clear is the bluntest of them and the most misread — what clearing context actually removes measures the floor it leaves you on and the bytes it does not touch. /rewind reads from a store you can audit directly; what rewind can and cannot restore counts it, including the 7,081 shell calls it never covered. For resuming, continuing, and forking sessions from the command line, see Claude Code session management.

Configuration.

CommandPurpose
/initGenerate a starting CLAUDE.md
/memoryEdit memory files, toggle auto memory
/configOpen the settings interface
/permissionsSet approval rules — see our guide to Claude Code permissions
/modelSwitch model and save as default
/effortSet the effort level
/hooksView hook configuration
/doctorSetup checkup, and it proposes CLAUDE.md trims

Delegation and parallel work.

CommandPurpose
/agentsManage subagent configurations
/subtaskHand a side task to a subagent, result returns here
/forkCopy the conversation into a new background session
/tasksList background tasks and subagents
/btwAsk a side question with no tool access, discarded after

Bundled skills. These are skills rather than built-ins, which is why they accept arguments and can be chained. /code-review, /security-review, /simplify, /test, /search, /debug, /doctor, and /web-search all run this way, and up to six can be chained in one message: /skill-a /skill-b do XYZ passes do XYZ to both.

Verify the reference against your own build

Any command reference is a snapshot. Claude Code shipped 30 versions between v2.1.195 and v2.1.224, and several behaviours in this article are gated on specific ones. So the artifact here is not the tables — it is scripts/check-claude-cli.mjs, which re-derives them.

It parses claude --help, probes every documented flag and subcommand, and reports two categories: accepted but undocumented in help, and documented but rejected. It exits non-zero on the second, because that is genuine drift between the docs and your binary.

Two bugs in it are worth repeating, because both produced confident wrong answers first. The flag parser used a lowercase-only pattern, so --allowedTools and --disallowedTools were reported as hidden when they are in --help in camelCase. The command parser required two spaces after the command name, so every row written as agents [options] was missed and the count came out at 8 instead of 13. A reference built on either would have been wrong in a way no reader could catch.

The script also runs three control probes before trusting any result: a known flag must be recognised, an invented flag must be rejected, and an invented subcommand must fall through to root help. If any control fails, it aborts rather than reporting numbers.

Common mistakes

  • Treating claude --help as the reference. It omits 16 of the 60 documented entries we probed, including every background-session control.
  • Assuming the docs match your binary. --exec is documented and absent on v2.1.224. Check before you script against a flag.
  • Using print-mode flags interactively. --output-format, --max-turns, and --max-budget-usd are silently irrelevant without -p.
  • Reaching for --dangerously-skip-permissions when --permission-mode would do. The mode flag has six values, and dontAsk or acceptEdits covers most of what people want bypass for.
  • Confusing --safe-mode with --bare. Both disable customisation, but --bare also drops OAuth and keychain auth, so an interactive session started with it may not authenticate.
  • Looking for a claudecode binary. The command is claude. Neither claudecode nor the transposed cluadecode resolves to anything.

Conclusion

Use /help for slash commands, because only your session knows what your plan and plugins provide, and probe the names you intend to script against — the verified slash commands list shows how, and which nine names have already stopped resolving. For the chords that drive the same surface, see Claude Code keyboard shortcuts. Use the CLI reference rather than claude --help for flags, since help omits more than a quarter of them — and verify anything you are about to script against, because at least one documented flag is missing from the current build. If you only remember three: /context when a session slows down or misbehaves, --safe-mode when your configuration does, and claude doctor before either. /context reports the session in front of you; for whether a release actually changed anything, the version-by-version join over your own transcripts is the measurement /context cannot give you. For the features these commands drive rather than their spelling, our full walkthrough of the tool is the better next read.

Frequently asked questions

How many Claude Code commands are there?
On v2.1.224 the binary accepts 20 shell subcommands, of which claude --help lists only 13. In-session slash commands number well over a hundred and vary by plan, platform, and installed plugins, which is why /help inside a session is the only complete list for your specific setup. This article originally recommended /which for that; on 2.1.259 that command no longer resolves, and a probe of 84 names is the reproducible alternative.
Why does claude --help not show every flag?
Anthropic's CLI reference states outright that claude --help does not list every flag and that absence from help does not mean a flag is unavailable. We measured this on v2.1.224: nine documented flags and seven documented subcommands are accepted by the binary but never appear in its help output, which is 16 of the 60 documented entries we probed.
What is the difference between a slash command and a skill?
There is no longer a meaningful difference. Custom slash commands were merged into skills, so a project skill and a custom command produce the same slash invocation. Several bundled commands are marked as skills in Anthropic's own command table, including /code-review, /doctor, and /security-review, and you can chain up to six of them in one message.
Is it claude code, claudecode, or cluadecode?
The product is Claude Code, two words, and the binary is claude. The single-word claudecode and the transposed cluadecode are both common search variants rather than real command names. Neither works in a shell. If you type claude with no arguments you get an interactive session; claude --help prints usage.
How do I run Claude Code non-interactively?
Use claude -p, or --print, which returns the response and exits. A group of flags only works alongside it, including --output-format, --json-schema, --max-turns, --max-budget-usd, and --forward-subagent-text. Piping also works: cat logs.txt | claude -p "explain" processes stdin as part of the prompt.

Muhammad Kashif

Founder and editor of Devventa, covering AI coding assistants, Next.js and the modern AI development stack.