The Essential Commands

Two kinds of input exist in a session: anything starting with / is a command to the tool itself, everything else is a message to Claude. Add a couple of keyboard controls and a special prefix or two, and this is the entire cockpit:

The twelve controls

ControlWhat it doesWhen
/initScans your project and auto-generates CLAUDE.mdOnce per project, day one
Shift+TabCycles modes → Plan Mode: Claude proposes a plan before touching filesAny task affecting 3+ files
EscInterrupts Claude mid-actionThe moment it goes the wrong direction
/clearWipes the session — fresh contextBetween unrelated tasks (after committing)
/compactSummarizes the session, keeps goingMid-task when it's getting long or slow
/modelSwitch modelA faster model for routine work, the strongest for hard problems
/usageShows token/usage statusGlance occasionally; learn what tasks cost
claude --continueReopens your most recent session"Oops, closed the terminal"
/resumePick any past session to reopenReturning to yesterday's thread
/rewindRestore code/conversation to an earlier checkpointUndo an AI change without git surgery
@filenameAttaches a specific file to your messagePointing Claude at exactly the right file
# your noteQuickly appends a memory to CLAUDE.md# always use pnpm, not npm

The five to learn on day one

1. /init — run it before anything else

It scans your project and writes a first draft of CLAUDE.md — the file that briefs Claude about your project at the start of every session. It's so important it gets its own chapter; for now, just run it once in each project.

2. Shift+Tab — Plan Mode

Makes Claude show you the plan before it touches a file. The single best habit for avoiding wrong turns — the next chapter is all about it.

3. Esc — the brake pedal

Stops Claude mid-action. Watch it work; the moment it heads somewhere you didn't intend, press Esc and redirect. Interrupting is normal, not rude — cheaper than letting a wrong idea finish.

4. /clear — the fresh start

Wipes the session so the next task starts with clean, cheap context. The habit is: finish a task, commit it, /clear, next task. Why that matters so much is chapter six.

5. @filename — point, don't describe

Typing @ lets you attach a specific file to your message. "Fix the mobile menu in @Header.astro" beats a paragraph describing where the menu code might live — Claude reads exactly the right file instead of hunting.

Four more worth knowing

  • /permissions — control what Claude may do without asking you first.
  • /mcp — manage and authenticate MCP servers (chapter 15).
  • /plugin — the plugin manager (chapter 14).
  • !command — a ! prefix runs a shell command yourself, inside the session, with the output visible to Claude.

The official reference: every command, flag and shortcut is documented at code.claude.com/docs under "Interactive mode" and "Slash commands". Bookmark it — this chapter is the working subset, not the encyclopedia.

Up next: Plan Mode deserves more than a table row — when to use it, how to review a plan properly, and why interrupting early is a superpower.

FAQ

Frequently Asked Questions

What is the difference between a slash command and a normal message?
Anything starting with / (like /clear or /init) is an instruction to the Claude Code tool itself. Everything else you type is a message to Claude — plain English, no syntax required.
Which Claude Code commands should I learn first?
Five cover day one: /init (generate CLAUDE.md, once per project), Shift+Tab (Plan Mode), Esc (interrupt), /clear (fresh session between tasks) and @filename (point Claude at the exact file).
How do I run a normal shell command inside a session?
Prefix it with ! — for example !npm run build runs the command yourself, right in the session, and the output lands where Claude can see it too.
How do I quickly save a permanent instruction for Claude?
Start the line with # — e.g. # always use pnpm, not npm — and it's appended to CLAUDE.md, the memory file Claude reads at the start of every session.