The Claude Code commands worth learning first, and the ones you can leave for later

Type / in Claude Code and the menu scrolls for a long time. The official command reference now lists well over a hundred entries, including built-in commands, bundled skills, aliases, and a few that have been removed but are still documented so older guides make sense. Nobody needs all of them. Most people who search for Claude Code commands already use the tool and want to know which handful actually changes how a session goes, and which ones can wait until a specific problem comes up.

This guide sorts them by when they matter: the commands that shape every session, the ones that keep a long session healthy, the shell-level flags that sit outside the session, and the long tail.

How commands work before you learn any

A few rules apply to every command, and knowing them avoids confusion later.

A command is only recognized at the start of a message. Anything typed after the name becomes its arguments, so /plan fix the login redirect enters plan mode and starts on that task. A slash in the middle of a sentence is just text.

Commands sent while Claude is working are queued. They run after the current turn finishes. A few, such as /status, /tasks, and /usage, run immediately without interrupting.

Commands and skills share one menu. Custom commands were merged into skills. A file at .claude/commands/deploy.md and a skill at .claude/skills/deploy/SKILL.md both create /deploy, and existing command files keep working. Many entries in the menu, such as /code-review and /doctor, are skills bundled with Claude Code rather than hard-wired commands.

There are three separate layers. Slash commands run inside a session. Keyboard shortcuts and prefixes like ! and @ also work inside a session. CLI flags such as claude -c apply before the session starts. Mixing them up is a common reason a command "does not work": claude -c typed inside a session is just a message.

With that in place, the useful set is small.

The six to learn in your first week

These cover setup, planning, and cleanup, which is where most of a session's quality is decided.

Command What it does When to reach for it
/init Generates a starter CLAUDE.md from the codebase First session in a repository
/memory Opens CLAUDE.md files and auto memory settings When the agent repeats a mistake
/plan Enters plan mode before any edits Before a change that touches several files
/clear Starts a new conversation with empty context When switching to an unrelated task
/compact Summarizes the conversation to free space When a long task is still going
/diff Shows changes in the working tree Before committing anything

/init and /memory go together. /init analyzes the project and writes a CLAUDE.md with the build and test commands it finds. If the file already exists, it suggests improvements instead of overwriting. /memory is where you refine it afterward and where you can toggle auto memory, the notes Claude writes for itself from your corrections.

/plan makes the biggest difference on larger work. In plan mode, the agent reads and proposes before it edits. Reviewing a plan takes less time than reviewing a diff that went in the wrong direction. Shift+Tab cycles through permission modes, including plan mode, if you prefer a key.

/clear and /compact solve different problems. /clear throws away the conversation and starts fresh while keeping project memory, which is right when the next task has nothing to do with the last one. /compact keeps going but summarizes what came before, and it accepts instructions about what to keep, such as /compact keep the list of failing tests. The project root CLAUDE.md is re-read from disk after compaction, so project rules survive it.

/diff shows everything that changed, including edits the agent made. Checking it before a commit is cheaper than finding a stray change in code review.

Commands that keep a long session healthy

Once sessions run for an hour or more, a second group becomes useful.

/context shows what is filling the context window as a colored grid, with suggestions when something is taking an unusual share. It is also the quickest way to confirm which CLAUDE.md files loaded. If the agent seems to have forgotten an instruction, check here before rewriting the instruction.

/model and /effort change which model runs and how much reasoning it applies. /model saves the choice as the default for new sessions, so switching once for a hard task changes later sessions too unless you switch back.

/rewind rolls the conversation, the code, or both back to an earlier checkpoint. It is the answer to "the last three edits made things worse". Its aliases are /checkpoint and /undo, and pressing Esc twice opens the same idea from the keyboard.

/resume returns to an earlier conversation by name or through a picker. Pairing it with /clear [name], which labels the previous conversation as you leave it, makes the picker easier to read later.

/btw asks a side question without adding it to the conversation history. It suits "what does this flag mean" questions that would otherwise clutter the context for the main task.

/usage shows session cost and plan limits. /cost and /stats are aliases for it.

/doctor runs a setup checkup: duplicate or leftover installs, PATH problems, unparseable settings files. It is the first thing to run when Claude Code itself misbehaves, before assuming the model is at fault.

Shortcuts and prefixes that save more time than commands

Several of the most used controls are not slash commands at all.

! at the start of the input runs a shell command directly and adds its output to the session, so the agent can respond to it. ! npm test puts the test output in front of Claude without asking it to run the command. This keeps your own quick checks visible to the agent.

@ followed by a path triggers file path autocomplete and points the agent at a specific file. It is faster and more precise than describing a file in words.

Esc interrupts Claude mid-turn. Messages typed while it works are queued rather than sent immediately, and Esc sends what you queued right away.

Ctrl+R searches your prompt history. Ctrl+G opens the current prompt in your default text editor, which helps when a prompt runs to several paragraphs.

Shift+Tab cycles permission modes, as mentioned above.

On a Mac, one small setup step helps: in Apple Terminal, /terminal-setup enables Option+Enter for new lines in a prompt. In some other terminals it installs a Shift+Enter binding instead.

Flags you type before the session starts

These run from the shell, before Claude Code starts, and they cover resuming, scripting, and maintenance.

Command What it does
claude "query" Starts an interactive session with a first prompt
claude -c Continues the most recent conversation in the current directory
claude -r "<session>" "query" Resumes a specific session by ID or name
claude -p "query" Runs one query non-interactively and exits
cat file | claude -p "query" Sends piped content with the query
claude update Updates to the latest version

The detail that trips people up is in the second row: claude -c continues the most recent conversation in the current directory. Launching from a different folder finds a different, or no, conversation. The same directory logic decides which CLAUDE.md files and which locally scoped MCP servers load, so opening the terminal in the correct project folder matters more than it first appears.

claude -p is the entry point for scripts and automation. It prints the answer and exits, which makes it usable in shell pipelines and scheduled jobs.

A working loop that uses them together

Commands are easier to remember as part of a sequence than as a list. A loop that covers most single-task sessions looks like this.

Start in the right place. Open a terminal in the project folder and run claude, or claude -c if you are picking up yesterday's work. Starting anywhere else loads the wrong CLAUDE.md and the wrong conversation history.

Plan before editing. For anything beyond a one-line fix, begin with /plan and a short description of the goal. Read the plan, correct it in plain language, and only then let the agent edit. If the plan references a file you are unsure about, @ the file so the agent reads it rather than guessing.

Check as you go. Use ! to run the test or lint command yourself so the output lands in the conversation. When something goes wrong after a few edits, /rewind to the last good point instead of asking the agent to undo its own work step by step.

Keep the context lean. If the session runs long, check /context. When the window is mostly old back-and-forth, /compact with a note about what to keep. When the next request is unrelated, /clear instead.

Finish deliberately. Run /diff to see every change, run /code-review if the change is large, and commit. If a correction came up more than once during the session, add it to CLAUDE.md through /memory so the next session starts with it.

That loop uses about ten commands and prefixes. Everything else in the menu is an extension of one of these steps.

The long tail you can leave for later

The rest of the menu is real and useful, but each item solves a specific situation. Learn them when that situation arrives.

Review before shipping. /code-review checks the current diff for correctness bugs and can apply fixes with --fix. /security-review looks at the branch diff for vulnerabilities such as injection or data exposure. Both are worth adopting once the basic loop is steady.

Parallel work. /tasks lists background work in the session. /background detaches the whole session to keep running, and /batch splits a large change into independent units that each run in their own worktree. These matter once single sessions feel too slow, not before.

Integrations and setup. /mcp manages MCP servers, /permissions edits allow and deny rules, /hooks shows hook configuration, and /ide manages editor integrations. Each is a one-time setup task for most projects.

Personal preference. /theme, /config, /statusline, /keybindings, and /output-style change how the tool looks and feels. None affects results.

A handful of commands in older guides no longer exist. /vim was removed, and Vim editing mode now lives in /config. /pr-comments was removed, and asking Claude directly replaces it. If a command from a tutorial is missing from your menu, check the reference before assuming the install is broken.

What to practice first

Use /plan before your next multi-file change, /clear when you switch to an unrelated task, and /diff before every commit, and launch Claude Code from inside the project folder so claude -c and your CLAUDE.md work as expected. The features page and the comparison with other file managers show how Atriens keeps that folder and the terminal in the same window.

Frequently asked questions

How do I see every command available in Claude Code?

Type / at the start of the input to open the command menu, and keep typing to filter it. The menu includes built-in commands, bundled skills, and any custom commands or skills in your project and home folder. /help also lists the available commands.

What is the difference between /clear and /compact?

/clear starts a new conversation with empty context while keeping project memory such as CLAUDE.md. /compact keeps the current conversation but replaces the earlier part with a summary to free space. Use /clear between unrelated tasks and /compact when one long task is still in progress.

How do I make my own slash command in Claude Code?

Create a skill at .claude/skills/<name>/SKILL.md in the project, or at ~/.claude/skills/<name>/SKILL.md for every project, and the folder name becomes the command. Older Markdown files in .claude/commands/ still work and create commands the same way.

Why does claude -c not find my previous conversation?

claude -c continues the most recent conversation in the current directory. If you launch from a different folder than last time, it looks at a different conversation history. Change into the project folder first, or use claude -r or /resume to pick the session by name.

Can I run a shell command without leaving Claude Code?

Yes. Start the input with !, for example ! git status, and the command runs directly in your shell. Its output is added to the session so Claude can see and respond to it.

Back to all posts