Esc
Cheatsheet Claude Coding

Claude Code commands worth knowing

The slash commands that save the most time, from your first CLAUDE.md to reviewing a diff before it ships.

Tested on Claude Sonnet · 5 ·

AI Place Hub 44
CommandWhat it doesWorth knowing
/init Writes a starting CLAUDE.md from the repo, so project rules do not have to be typed into every new session Run /memory afterwards to trim what it guessed wrong
/memory Opens the CLAUDE.md files for editing directly Keep it short. Every line in it loads on every turn, long or short
/permissions Sets which tools run without asking, which ask, and which are blocked outright Worth doing once per project instead of clicking Allow through every session
/model Switches the model and saves it as the default for new sessions With no name it opens a picker, and a switch-this-session-only option leaves the saved default alone
/effort Sets how much reasoning the model applies, from low up to max Higher effort is slower and costs more tokens - raise it for a hard bug, not for routine edits
/context Shows a breakdown of what is filling the context window right now Check this before blaming a wrong answer on carelessness - it is often just full
/compact Summarises the conversation so far to free up space, optionally around a focus you give it Loses detail on purpose, so do it between tasks rather than mid-debugging
/clear Starts a new conversation with empty history but keeps project memory The old conversation is not gone, /resume brings it back
/rewind Rolls the code and the conversation back to an earlier point Faster than asking the model to undo its own change
/diff Shows everything changed in the working tree so far, including edits the model just made Read this before agreeing to a rewrite you have not actually seen
/code-review Reviews the current diff for bugs, or pass a pull request number to review that instead Add --fix and it applies what it finds instead of only listing it
/background Detaches the session to keep running and frees the terminal Good for a long job you do not want to sit and watch
/plan Switches into plan mode before a large change, optionally with a task description Cheaper than reviewing an unplanned rewrite line by line afterward
/resume Reopens an earlier conversation from a picker Pairs with /clear - start fresh for a new task, resume when you need the old one back
/mcp Manages MCP server connections and their sign-in state Run it with no argument first if a tool seems missing - it lists what is actually connected
/hooks Shows the hook configuration for tool events Check here before digging through settings files to see why an action was blocked or auto-approved
/agents Points you at creating or editing subagents, in .claude/agents or by asking directly Worth it once a task repeats - a code reviewer or a test runner you can call by name
/usage Shows session or account usage and cost Alias /cost does the same thing

Claude Code has far more commands than anyone types on a normal day. This is the subset that actually gets used, roughly in the order a session needs them: set up, work, then check before you ship.

Full reference, including everything left out here: Commands - Claude Code Docs.

Notes from the author

Build one habit early: run /permissions once per project before the first session, and stop approving the same tool call over and over.

For information only, not professional advice. You use it at your own risk and we are not liable for any loss or damage. See the disclaimer.

Fork

Did this work for you?

Sign in to flag it

Related