Walkthrough

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.

Steps · 0 / 6 done
  1. Try /init

    Generates or updates CLAUDE.md by reading your repo. Use it once per project, then prune the output.

    /init
    VerifyA CLAUDE.md is written or updated at the project root.
  2. 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.

    /clear
    VerifyThe chat starts a new session; CLAUDE.md is still loaded.
  3. 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.

    /resume
    VerifyThe agent restates the goal of the prior session before you continue.
  4. 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.

    /compact
    VerifyThe session continues with a much smaller context window than before.
  5. 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.

    /rewind
    VerifyA picker lists recent checkpoints; selecting one restores that state without touching your git history.
  6. 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.

    /model
    VerifyThe picker shows the active model; the status line reflects your choice on the next turn.
Check your understanding
Q1. What's the difference between /clear and /compact?
Q2. What does /rewind restore?
· Tick off the 6 step(s) above.
· Score 100% on the quiz.