Slash Commands
The built-ins worth memorizing: /init, /clear, /resume, /compact, /rewind, /model.
Slash commands are first-class shortcuts in Claude Code. Each one fires a specific behavior — write a memory file, clear context, summarize the session. Knowing them is the difference between fighting the chat and steering it.
Try /init
Generates or updates CLAUDE.md by reading your repo. Use it once per project, then prune the output.
/initVerifyA CLAUDE.md is written or updated at the project root.Use /clear when context drifts
/clear wipes the conversation but keeps your project memory. Run it when you switch tasks — fresh context produces sharper plans.
/clearVerifyThe chat starts a new session; CLAUDE.md is still loaded.Resume a long session with /resume
If you closed Claude Code and want to pick up where you left off, /resume loads the previous session.
/resumeVerifyThe agent restates the goal of the prior session before you continue.Compact when you must keep going
/compact summarizes the conversation so far so context doesn't blow up. Less destructive than /clear when you need continuity.
/compactVerifyThe session continues with a much smaller context window than before.Rewind when a change goes sideways
Claude Code checkpoints your files before each change. /rewind (or double-tap Escape) opens the checkpoint picker — restore the code, the conversation, or both. It's the undo button that makes bold experiments cheap.
/rewindVerifyA picker lists recent checkpoints; selecting one restores that state without touching your git history.Match the model to the task
/model switches models mid-session. Reach for the frontier tier (Opus 4.8, or the Claude 5 family where available) on hard refactors and planning; drop to Haiku 4.5 for fast, cheap iteration on simple edits.
/modelVerifyThe picker shows the active model; the status line reflects your choice on the next turn.