Claude Code has dozens of built-in commands, but a small set of them handles most of what you’ll actually need day to day.
If you’re new to Claude Code or still typing out full requests for things a slash command could handle in seconds, this guide walks through 14 commands worth learning first. Each one comes straight from Claude Code’s official documentation, so you can trust these are accurate and current.
Start Every Project With /init
Running /init generates a starter CLAUDE.md file for your project. This file acts as project memory, giving Claude context about your codebase, conventions, and preferences every time you start a new session.
It’s worth running this the very first time you open Claude Code in a new repository. Once it’s created, you can refine it further using the /memory command below.
For example, say you’re starting work on an e-commerce app built with React and a Node backend. Running /init lets Claude scan the project structure and generate a CLAUDE.md that already knows your folder layout and tech stack, instead of you explaining it from scratch every session.
Refine Project Memory With /memory
The /memory command lets you edit your CLAUDE.md files directly, along with managing auto memory, a feature that lets Claude remember details across sessions without you having to write everything down manually.
Think of this as maintaining a living document. As your project evolves, your CLAUDE.md should evolve with it.
If your team decides all new components must use a specific naming convention, running /memory lets you add that rule permanently, so Claude follows it automatically in every future session, not just the current one.
Think Before You Code With /plan
/plan puts Claude into planning mode before it starts making changes. Instead of jumping straight into edits, Claude lays out its approach first, so you can review and adjust the plan before any code gets touched.
You can also add a description right after the command, like /plan fix the login bug, to jump straight into planning that specific task.
This matters most on larger changes. If you’re refactoring how your app handles authentication, seeing the plan first means you can catch a wrong assumption before Claude touches a single file, rather than after.
Switch Models Instantly With /model
Different tasks call for different levels of reasoning power. The /model command lets you switch the active model and even set it as your default for future sessions.
Running it without any argument opens a picker, making it easy to compare options without memorizing exact model names.
You might use a faster, lighter model for simple tasks like renaming variables, then switch to a more capable model with /model right before tackling a genuinely tricky bug, without restarting your session.
Adjust Reasoning Depth With /effort
Beyond just switching models, /effort controls how much reasoning effort Claude applies to a given task. Options range from low up through xhigh, giving you a dial between speed and depth depending on how complex the problem is.
For a quick file rename, low effort is plenty. For debugging a gnarly production issue, dialing it up can make a real difference.
Picture debugging a race condition that only shows up occasionally in production. Setting /effort to high before diving in gives Claude more room to reason through edge cases, rather than settling for the first plausible explanation.
Check Your Context Usage With /context
Long sessions eventually fill up the context window, the space Claude uses to hold your entire conversation and codebase understanding. Running /context shows a visual breakdown of what’s using that space, along with suggestions for freeing it up.
This is especially useful when responses start feeling slower or less focused than usual. It’s often a sign your context window needs attention.
If you’ve been working in the same session for hours across multiple files, running /context can reveal that a single large file read is eating most of your available space, something you’d never guess just from the conversation itself.
Free Up Space With /compact
Once you know your context is getting full, /compact summarizes the conversation so far to reclaim space, without losing important details. You can even pass specific instructions about what to prioritize when Claude creates the summary.
This is different from /clear, which wipes the conversation entirely. Compacting keeps the thread going while trimming the fat.
For instance, if you’ve spent an hour exploring three different approaches to a problem before settling on one, running /compact with instructions to keep only the final approach clears out the dead ends while preserving what actually matters.
Start Fresh With /clear
Sometimes you genuinely want a clean slate. The /clear command starts a brand new conversation with empty context, while still keeping your project’s memory intact.
This is the right move when you’re switching to a completely unrelated task and don’t want old context influencing Claude’s next response.
If you just finished a deep debugging session on your payment system and now need to write documentation for an unrelated feature, /clear prevents any leftover debugging context from bleeding into that new task.
Jump Back Into Old Conversations With /resume
Closed a session and need to pick up where you left off? The /resume command reopens a previous conversation by ID or name, or opens a picker if you’re not sure which one you want.
This alone can save you from re-explaining context you already established in an earlier session.
Say you were mid-way through building a new API endpoint yesterday and had to stop. Running /resume brings back that exact conversation, including everything Claude already understood about the endpoint’s requirements, instead of starting over today.
Try a Different Direction With /branch
If you want to experiment with an alternate approach without losing your current progress, /branch creates a branch of the conversation at that exact point. You can explore freely, and the original conversation stays intact, ready to return to with /resume.
This mirrors how git branching works, just applied to your conversation with Claude instead of your codebase.
Imagine you’re unsure whether to solve a performance issue with caching or by rewriting the query itself. Branching lets you explore the caching approach fully, and if it doesn’t pan out, you can return to your original conversation without losing any of that earlier progress.
Review Changes Before Committing With /diff
Before you commit anything, /diff opens an interactive viewer showing everything that’s changed, both your current uncommitted work and the changes from individual turns in the conversation.
Being able to scroll through changes turn by turn, rather than just seeing one giant diff, makes it much easier to catch something that shouldn’t be there.
After a long session where Claude touched a dozen files, /diff lets you scroll through each change individually, rather than trying to make sense of an overwhelming single block of modifications.
Catch Bugs Automatically With /code-review
Running /code-review checks your current changes for correctness bugs and cleanup opportunities. You can pass a PR number, a branch, or even a specific effort level depending on how thorough you want the review to be.
Adding the –fix flag takes it a step further, applying the fixes it finds directly, rather than just listing them for you to handle manually.
Before opening a pull request, running /code-review on your branch can catch an off-by-one error or an unhandled edge case that might otherwise slip past a quick human glance.
Undo Mistakes With /rewind
Everyone makes a change they regret eventually. The /rewind command rolls both your code and the conversation back to an earlier checkpoint, essentially giving you an undo button for an entire session.
This has saved plenty of people from a messy manual cleanup after Claude goes down the wrong path on a task.
If Claude misunderstands a request and starts refactoring the wrong module entirely, /rewind lets you jump back to the checkpoint right before that happened, rather than manually reverting a dozen file changes by hand.
Diagnose Setup Issues With /doctor
When something feels off with your Claude Code installation, /doctor runs a full checkup. It checks for installation problems, unused skills or MCP servers eating up context, slow hooks, and a handful of other common issues, then offers to fix what it finds.
Running this occasionally, even when nothing seems wrong, is a good habit for keeping your setup clean.
If Claude Code suddenly feels sluggish for no obvious reason, running /doctor might reveal an old, unused MCP server still quietly consuming context on every single request.
Editor’s Note
Most people only ever learn a handful of Claude Code commands through trial and error, usually the hard way. Commands like /plan and /rewind alone can save hours of cleanup work once they become part of your regular workflow. Instead of typing full sentences for things a slash command already handles, it’s worth spending ten minutes actually reading through what’s available. That small investment tends to pay for itself within the first week.
We aim to provide accurate, reliable, and current information. Since Claude Code commands and features are regularly updated, please check the official documentation for the most current details. If you spot an error in this article, please contact us at support@digieh.com or read our Corrections Policy and we’ll correct it as soon as possible.













