Slash Commands, Bang and Backslash
The prompt box takes more than requests for Claude. A slash talks to Claude Code itself, an exclamation mark talks to your shell, and a backslash lets you keep typing on a new line. Knowing which one you need saves turns and tokens.
The rule
Slash talks to the tool, bang talks to the shell, words talk to Claude.
Slash commands control the session instead of asking the model anything. Type / to see the full list. Everyday ones:
| Command | Use it to |
|---|---|
/help |
See the commands and help |
/clear |
Start a fresh conversation |
/compact |
Summarise the conversation to free space |
/context |
See what is filling the context window |
/model |
Switch model |
/status |
Check version, account, model and settings |
/cost or /usage |
Check spending or plan usage |
/export |
Save the conversation to a file or the clipboard |
/doctor |
Check the installation for problems |
/exit |
Leave the session |
The same menu also lists custom commands added by your project, your skills or your plugins.
Bang runs a shell command directly. ! pytest -q runs the tests in your shell straight away, without asking Claude to do anything, and the output lands in the conversation so Claude can see it too. It is the fastest way to show Claude real output. Because you typed the command yourself, you own it; Claude is not the one running it.
A backslash, then Enter, starts a new line without sending, for multi-line prompts. Pasting multi-line text works too, and some terminals support other key combinations.
> ! git status
> ! pytest -q
> The failing test above is in the pause feature.\
Fix it in orders.py only, then run pytest again.
> /context
> /clearThe shortcut
The first character decides who hears you. / goes to Claude Code, the app. ! goes to your shell. Anything else goes to Claude, the model.
! git status
Confirms the tree is clean. You and Claude both see the result, and no model turn was spent.
The trap is asking Claude "please run the tests" when ! pytest -q would do. The request costs a model turn and a permission prompt; the bang costs neither.
Drills
Answer fast — trust the rule.
What does ! pytest -q do?
Which prefix speaks to Claude Code itself, for its settings and session?
How do you continue a prompt on a new line without sending it?
You want to save the whole session so you can share it with a teammate. Which command?
Remember
/talks to Claude Code,!to your shell, plain words to Claude.- Shortcut: the first character decides who hears you.
- Trap: spending a model turn on "run the tests" when
! pytest -qis instant.
