4 Claude Code Slash Commands Most People Skip: /rewind, /compact, /context, /init
TL;DR
Four slash commands built into Claude Code fix the most common headaches. /rewind rolls your code and chat back to an earlier checkpoint. /compact summarizes a long conversation to free up context. /context shows what is filling your context window. /init writes a starter CLAUDE.md for your project. Below is what each one does according to Anthropic's docs (checked October 3, 2026), when to use it, what it does not do, and six more commands worth knowing.
👉 https://www.skool.com/claudecodeclub
Type / in Claude Code and a menu of commands opens. Most people only ever use one or two. These four are the ones from the video. Every description below comes from Anthropic's official Claude Code docs, which we checked on October 3, 2026. Your exact menu can vary by version, so type / to see what your install has.
Anthropic's full list of every built-in command, with arguments and aliases.
1. /rewind: undo Claude's last move
bash/rewindWhat it does: opens the rewind menu so you can roll the conversation, your code, or both back to an earlier point. Claude Code saves a checkpoint of your files before each prompt you send. You can also open the same menu by pressing Esc twice with an empty prompt. Aliases: /checkpoint and /undo.
Pick a message, then pick an action: Restore code and conversation, Restore conversation (keep the current code), Restore code (keep the conversation), Summarize from here, or Summarize up to here.
How checkpoints work, every rewind option and the full list of limitations.
2. /compact: shrink a long chat to free up space
bash/compact
/compact focus on the auth bug fix and the API decisions we madeWhat it does: frees up context by summarizing the conversation so far. You can add instructions so the summary keeps what you care about instead of what Claude guesses is important.
When to use it: in the middle of one long task, when you still need the history but the context window is getting full. Claude Code also compacts on its own as you approach the limit, so running it yourself with a focus line just gives you control over what is kept.
3. /context: see what is filling your context window
bash/context
/context allWhat it does: shows your current context usage as a colored grid, with optimization suggestions for context-heavy tools, memory bloat and capacity warnings. Pass all to expand the per-item breakdown.
When to use it: when Claude starts feeling slow or forgetful, or before a big task. If MCP servers, a huge CLAUDE.md or old file reads are eating the space, this is where you see it.
4. /init: teach Claude your project
bash/initWhat it does: generates a starting CLAUDE.md for your project. Per Anthropic's docs, Claude analyzes your codebase and writes down the build commands, test instructions and project conventions it finds. If a CLAUDE.md already exists, /init suggests improvements instead of overwriting it.
When to use it: the first time you open Claude Code in a project. Then read the file it wrote, cut anything wrong, and add the rules Claude could not discover on its own, like how you want commits written or which folders never to touch. Use /memory to edit it later.
Want the guided version? Set CLAUDE_CODE_NEW_INIT=1 before you run /init and it walks you through CLAUDE.md files, skills and hooks.
6 more slash commands worth knowing
- /clear: start a new conversation with empty context. Use it between unrelated tasks. Aliases /reset and /new.
- /usage: session cost, plan usage limits and activity stats. Aliases /cost and /stats.
- /plan: enter plan mode before a big change, for example /plan fix the auth bug.
- /btw: ask a side question about the session without adding it to the conversation.
- /memory: edit your CLAUDE.md files and turn auto memory on or off.
- /diff: review the changes in your working tree, including the edits Claude has made so far.
Copy this cheat sheet
cheatsheetCLAUDE CODE SLASH COMMANDS: CHEAT SHEET
(source: code.claude.com/docs/en/commands, checked Oct 3, 2026)
/rewind Roll code and/or chat back to a checkpoint (or Esc Esc)
Does NOT undo Bash changes (rm, mv, cp). Keep using Git.
/compact [focus] Summarize the chat to free up context
/context See what is filling the context window (/context all for detail)
/init Write a starter CLAUDE.md for this project
/clear Fresh conversation for an unrelated task
/usage Cost, plan limits and stats (/cost, /stats)
/plan [task] Plan mode before a big change
/btw [question] Side question that stays out of the history
/memory Edit CLAUDE.md, toggle auto memory
/diff Review what changed
/help Show every command your version hasA simple routine that uses all four
- 1New project: run /init, then read and fix the CLAUDE.md it writes.
- 2Long task: check /context now and then. When it is filling up, run /compact with a one-line focus.
- 3Claude broke something: run /rewind (or Esc Esc), pick the message before it went wrong, and choose Restore code.
- 4Switching to something unrelated: run /clear so old context does not confuse the next job.
Want the full list of shortcuts and symbols too? Our Claude Code Cheat Sheet covers keyboard shortcuts and the @, # and ! symbols.
Now you just type a slash and work faster. Inside the Claude Code Club we share the commands, skills and setups we use every day and help each other when something breaks. It's nine dollars a month at https://www.skool.com/claudecodeclub/about. Everything on this page works without it.
👉 https://www.skool.com/claudecodeclub
Common questions
Does /rewind undo everything Claude did?
No. It restores edits made by Claude's file editing tools, saved as a checkpoint before each prompt. Files changed by Bash commands like rm or mv, edits from most subagents, and changes made outside Claude Code are not restored. Keep using Git for real history.
What is the difference between /compact and /clear?
/compact keeps the same conversation but replaces the history with a summary to free up space. /clear starts a new conversation with empty context. Use /compact in the middle of a long task and /clear when you switch to something unrelated.
Does /context show my usage limits?
No. /context shows how full the context window of the current conversation is and what is filling it. For plan usage limits and session cost, run /usage (aliases /cost and /stats).
Will /init overwrite my CLAUDE.md?
No. According to Anthropic's docs, if a CLAUDE.md already exists, /init suggests improvements rather than overwriting it.
Why don't I see a command in my menu?
Commands change between versions, and a few are hidden until you type the full name. Type / to see what your install has, run /help, and update Claude Code if something from the docs is missing.
Keep going
Want the setups we use with these commands every day?
Get the other 19 in the starter stack, plus 8,000+ members - $9/mo, cancel anytime.
Join the Club