A field guide to the terminal companion

The art of
claude code

Every slash command, keyboard shortcut, and special syntax that makes Claude Code feel less like a tool and more like an instrument. Organised by how often you'll actually reach for it.

~/your-project claude
✦ Welcome back. Press / for commands, ? for shortcuts.
↓ scroll · the essentials are first40+ commands · 12 shortcuts · 8 secrets · 3 face-offs
01 / Commands

Slash commands

Type / inside an active session to see them all. The most-used commands sit at the top — these are the muscle memory you want to build first. Hover any card for emphasis.

Daily essentialFrequentOccasionalPower user
/help
#1 · ESSENTIAL
Shows every available command in your current install — built-ins, skills, plugins, and MCP prompts together.
When you forget anything, this is where you start. Filterable by typing letters after the /.
/clear
#2 · ESSENTIAL
Wipes the chat history and context window. Same effect as quitting and restarting Claude Code.
Use it whenever you switch to a totally different task — fresh context beats fighting context drift.
/compact
#3 · ESSENTIAL
Compresses the conversation into a dense summary so you reclaim tokens without losing the thread.
Run it proactively around 80% context use. Pass a focus: /compact keep the auth refactor.
/init
#4 · ESSENTIAL
Analyses your repo and generates a CLAUDE.md — the project memory file loaded on every future session.
Always your first move in a new project. Pays back in every session afterwards.
/plan
Shift+Tab
MODE · ESSENTIAL
Claude proposes a full plan before touching any files — no edits, no bash, just thinking out loud. Enter via /plan or cycle modes with Shift+Tab: Normal → Auto-accept → Plan.
Reach for it before risky refactors. You approve the plan, then drop back to Normal to execute.
/model
Opt+P
#5 · ESSENTIAL
Swap the active model mid-session. opus for deep reasoning, sonnet for general work, haiku for quick edits.
Default flows: start with Sonnet, switch to Opus only when you need genuine planning depth. Opt+P opens the picker instantly.
/context
#6 · ESSENTIAL
Shows the breakdown of what's currently filling the context window — files, system, history, tools.
If Claude is "forgetting" things, check this first. Tells you when autocompact will kick in.
/resume
#7 · FREQUENT
Browse and rejoin a previous session. Use claude -c from the shell to leap straight back into the most recent one.
You never have to re-explain context. Combine with /rename so sessions are findable later.
/review
#8 · FREQUENT
Targeted code review of recent changes. More reliable than asking "review my changes" in freeform.
Pass a PR number — /review 42 — to review a specific GitHub PR.
/usage
#9 · FREQUENT
The canonical dashboard for plan limits, rate limits, cost, and daily session stats. /cost and /stats are aliases.
Keeps you honest about token spend. Especially useful before kicking off a long Opus task.
/mcp
#10 · FREQUENT
List, add, and authenticate Model Context Protocol servers — your gateway to GitHub, Slack, Linear, databases, and more.
MCP is what turns a smart CLI into an integrated workspace. Worth investing an evening to set up well.
/memory
#11 · FREQUENT
Opens the CLAUDE.md editing interface to add, update, or remove the project rules Claude reads every session.
Ten minutes here pays back forever. Add your build commands, test commands, and naming conventions.
/agents
#12 · FREQUENT
Manage subagents — specialised personas Claude can delegate to. Up to 10 can run in parallel for big refactors.
Define your own in .claude/agents/. A "security reviewer" agent triggered proactively is gold.
/terminal-setup
#13 · OCCASIONAL
Configures your terminal so Shift+Enter gives a newline instead of submitting the message.
One-time fix. Restart the terminal afterwards. Works in iTerm2, WezTerm, Ghostty, Kitty.
/ide
#14 · OCCASIONAL
Connects to the VS Code or JetBrains extension. Git diffs and selections open in your IDE, not the terminal.
If you review diffs all day, this is the upgrade. Side-by-side beats terminal scroll every time.
/permissions
#15 · OCCASIONAL
Review and edit the allow/deny list of tools Claude can run without asking — written to .claude/settings.local.json.
Use wildcards: Bash(pnpm *) permits any pnpm command without per-call approval.
/hooks
#16 · OCCASIONAL
Configures automation that fires on tool events — pre-edit, post-edit, session start. Hooks guarantee execution where prompts only suggest.
Run Prettier after every write. Run typecheck before every commit. The right place for "always do X".
/rename
#17 · OCCASIONAL
Gives the current session a meaningful name so you can find it later. Without arguments it auto-generates one from context.
Without it, session history is timestamps. With it, you find "auth-refactor" weeks later instantly.
/fork
#18 · OCCASIONAL
Branches the current conversation at its current state. Try one approach, jump back to the fork point, try another.
The conversational equivalent of a git branch. Genuinely underused. Alias: /branch.
/export
#19 · OCCASIONAL
Exports the conversation as plain text — for documentation, postmortems, or sharing what happened with a teammate.
Great after a debugging session: export → paste into the ticket → future-you thanks present-you.
/plugins
#20 · POWER
Install community plugins to extend Claude Code with new slash commands, skills, and agents from a marketplace.
Browse before you build. Someone has likely solved your workflow already.
/doctor
#21 · POWER
Verifies your installation, MCP servers, hooks, and config layers. Tells you what's broken and where to look.
First stop when something feels off. Save support hours.
/keybindings
#22 · POWER
Customise your shortcuts. Changes write to ~/.claude/keybindings.json and take effect immediately.
First match wins. Enterprise-locked bindings cannot be overridden.
/release-notes
#23 · POWER
Read what shipped in recent versions without leaving the terminal. The CLI moves fast — this is how you keep up.
Skim weekly. New commands appear all the time.
02 / Shortcuts

Keyboard shortcuts

These are the keystrokes that separate a slow session from a flowing one. Most users never learn them. Memorise the first four — they pay back every single session you'll ever run.

Esc
Interrupt Claude
Stop generation mid-stream. Type "go" to resume, or rephrase your prompt.
Esc×2Esc
Rewind mode
Scroll back through conversation history with ↑. Restore code, conversation, or both.
Shift+Tab
Cycle permission modes
Normal → Auto-accept → Plan mode. Current mode shows below the prompt.
Opt+T
Extended thinking
Toggle reasoning visibility — see how Claude is working through the problem.
Opt+P
Model picker
Quick switch between Opus / Sonnet / Haiku without leaving the prompt.
Shift+Enter
Newline in prompt
Write multi-line prompts. Requires /terminal-setup first.
Previous prompts
Cycle through prompts you've sent in this session — like bash history.
Ctrl+G
External editor
Open the current prompt in $EDITOR. Built for long, careful prompts.
Ctrl+C
Cancel input
Clear the current prompt without sending. Press twice to quit Claude Code entirely.
Ctrl+D
Exit session
Clean exit from Claude Code. Returns you to your shell prompt.
?
Shortcut overlay
See every shortcut available in your current terminal environment.
Tab
Autocomplete
Complete file paths, command names, and arguments. Works anywhere in input.
03 / Syntax

Special syntax

Four prefix characters that unlock most of Claude Code's interactive power. Learning these is the difference between describing your context and just dropping it in.

@
@file.ts · reference
Inline a file, directory, or URL into your prompt. Better than pasting — tokenises cleanly and shows in the audit log.
#
# · remember
Start a message with # to append the rest to CLAUDE.md as a durable project memory. Skips the conversation entirely.
!
!cmd · bash passthrough
Run a shell command and inject its output into context — !git status, !npm test. No approval prompt, no interpretation.
/
/cmd · slash command
Invoke any built-in command, skill, plugin command, or MCP prompt. Type / alone to discover everything available.
05 / Thinking

The thinking ladder

Drop one of these phrases anywhere in your prompt and Claude Code cranks up the reasoning budget. No slash command. No flag. Just words — read straight out of the message and mapped to a token budget before the model even sees the prompt.

saythink
Light extended reasoning. The everyday gear — sanity checks, "is this right?", small judgement calls before Claude commits to an answer.
4 blocks · 1,000 tokens each
0
thinking tokens
Light burn
baseline ·
saythink hard think deeply megathink
Substantial thinking. Reach for it on complex refactors, design choices with real trade-offs, or multi-file changes where the plan matters as much as the code.
10 blocks · 1,000 tokens each
0
thinking tokens
Mid burn
vs baseline · 2.5×
saythink harder ultrathink
Maximum thinking budget — eight times the baseline. Architecture decisions, hairy debugging, anything where solution quality genuinely justifies the extra computation. The headline magic word: ultrathink.
32 blocks · 1,000 tokens each
0
thinking tokens
Max burn
vs baseline ·
Modern alternative: /effort xhigh or /effort max sets the thinking budget for the whole session — persistent, predictable, no magic words required. Combine /effort max with /plan (or Shift+Tab) for the deepest planning intelligence Claude Code can offer.
06 / Versus

What to reach for

Three places where two or more features overlap enough to confuse — and the small differences that decide which one to pull. Look for the ★ daily driver tag when in doubt.

A

When you want Claude to think harder

Magic words, persistent settings, and modes — each suited to a different shape of problem. The classic confusion: ultrathink vs /effort max.

OptionReach for it whenCost / turnCatch
say "think"
Magic word
You want a quick sanity check before Claude commits to an answer.
4K tokens
One-off — applies only to this prompt, won't carry over.
ultrathink
Magic word
One-off high-stakes prompt: tricky bug, architecture decision, ambiguous spec.
32K tokens
Easy to forget you typed it. Re-type every prompt that needs it.
/effort max
Slash command
Daily driver
Whole session needs deep work — a big refactor, a long debug, a hard design.
32K / turn
Persistent — lower it back with /effort medium when you switch tasks.
/plan
Slash command · Shift+Tab
You want a plan reviewed before any files get touched.
Variable
Orthogonal to /effort — combine them for the deepest planning.
B

When the session is getting heavy

Four ways to free up context, each loses something different. The most-used button is /compact, but it's not always the right one.

OptionReach for it whenCostCatch
/compact
Slash command
Daily driver
Long session, you want to keep working in the same thread.
Runs a summary
Fine detail is lost. Pass focus: /compact keep the auth refactor.
/clear
Slash command
Switching to a completely different task with no shared context needed.
Instant
Total reset. Previous thread is gone from this session.
Rewind
Esc · Esc
Claude went the wrong direction and you want to back up to a checkpoint.
Instant
Only file edits are tracked. Bash side effects (migrations, DB) aren't reversed.
/fork
Slash command
You want to try an alternate approach without losing the current one.
Instant
Now you have two threads to keep straight in your head.
C

When you need a quick aside

Side questions, exploratory branches, parallel work — picking the right gear for "wait, one more thing" without derailing the main task.

OptionReach for it whenCostCatch
/btw
Slash command
Daily driver
Quick side question — "what does this flag do?" — while Claude is mid-task.
Light
Answer lives in the overlay only. Doesn't persist to the main thread.
/fork
Slash command
Exploring a real alternative path you might genuinely come back to.
Light
Two threads to manage. Use /rename so you can tell them apart later.
New session
Different task
Truly separate task. No shared context needed at all.
Free
CLAUDE.md re-loads but recent conversation context doesn't carry.
Parallel session
Second terminal
Long-running task (/loop, /batch) + you want to keep coding in another window.
2× tokens
Two sessions burning tokens at once. Watch your /usage.