The prompt is a control surface. Learn the slash commands and keyboard shortcuts that steer a session — clearing context, rewinding, switching modes, and dropping into bash.
Why: slash commands run actions instead of prompting the model — manage context, cost, config, and more. When: type / at the start of the prompt to see them all. Where: these are the ones you reach for daily.
/clear # wipe the conversation and start fresh (frees context)
/compact # summarize the conversation to reclaim context, keep the gist
/context # show how much context window is in use, and by what
/cost # tokens and dollar cost so far this session
/rewind # undo back to an earlier point (conversation and/or files)
/model # switch model
/config # open settingsWhy: a single leading character changes what the prompt does — quick memory, shell, or file reference without leaving the input. When: use # to jot a rule into CLAUDE.md, ! to run a shell command, @ to pull a file into context. Where: these work mid-sentence too.
# at line start — Add the line to memory (CLAUDE.md) so Claude remembers it in future turns.! at line start — Run the rest as a bash command without asking the model.@path/to/file — Pull a file (or directory listing) into the prompt context./ at line start — Run a slash command instead of prompting the model.# Always run tests with pnpm, never npm
!git status
Review @src/payment.ts for race conditionsWhy: the keys are how you interrupt, rewind, and switch modes without typing a command. When: press Esc the moment Claude heads the wrong way — interrupting early saves time and tokens. Where: Shift+Tab is the one to memorize: it cycles permission modes including Plan Mode.
Esc — Interrupt Claude immediately (stop the current action).Esc Esc — Rewind — edit a previous message and branch from there.Shift+Tab — Cycle permission modes: normal → auto-accept edits → Plan Mode.Ctrl+R — Expand truncated tool output to see the full detail.Ctrl+C / Ctrl+D — Cancel the current input / exit the session.↑ / ↓ — Walk through your prompt history.Press Shift+Tab a few times and watch the mode indicator change:
normal -> asks before edits and commands
auto-accept -> applies edits without asking
plan mode -> read-only; proposes a plan first