Slash Commands
The built-ins worth memorizing: /init, /clear, /resume, /memory, /compact.
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.