Buy Sumizeit infographics

The 15 Claude Code Commands That Actually Change How You Work

Posted on 8/7/2026, 10:11:35 PM

Most Claude Code users are prompting when they should be managing state. Here are 15 slash commands for memory, context, review, and rollback that fix that.

Share this article

For 15-minute non-fiction book summaries of best-selling books, check out sumizeit.com.

TL;DR

Most people using Claude Code are typing prompts into it like it's a chat window and wondering why the results degrade after an hour. The difference between a frustrating session and a productive one usually comes down to about fifteen slash commands that handle memory, context, review, and rollback. /init and /memory teach the tool your project once instead of every session. /context and /compact keep it sharp when a long session starts to drift. /code-review, /security-review, and /simplify turn it into its own first reviewer. And /plan and /rewind give you the two things people most often wish they had: a look before the leap, and an undo button.

Why the Slash Commands Matter More Than the Prompts

There's a predictable arc to how developers use AI coding tools. Week one is amazement. Week two is a long, messy session where the model forgets the conventions it followed an hour ago, rewrites a file it shouldn't have touched, and produces something that technically runs but that nobody wants to merge. Week three is either quitting or figuring out the controls.

The controls are the slash commands. They're not shortcuts in the "saves you typing" sense — they're the interface for the things a language model can't manage on its own: what it remembers, what's currently in front of it, when it should stop and think before acting, and how you undo it when it goes sideways.

That framing is worth sitting with, because it's the same lesson that shows up in almost every book about working with powerful tools. Leverage comes from the setup, not the effort. You don't get better output by prompting harder. You get it by giving the tool a better standing brief, a cleaner working memory, and a tighter feedback loop. The commands below are how you do each of those.

One housekeeping note before the list: Claude Code ships updates frequently, and the exact command set varies by version and by what your team has added. Some of these are built in, some are project-level custom commands you or your team define. Run /help in your own install to see what's actually available to you, and check the official Claude Code docs for current behavior.

Project Setup and Memory: Teach It Once, Not Every Session

The single biggest waste in AI-assisted coding is re-explaining your project. Every session, the same paragraph: we use pnpm not npm, tests live in __tests__, don't touch the migrations folder, we're on the app router. Memory commands exist to end that.

/init explores your codebase and generates a starter CLAUDE.md file — a memory document that gets loaded automatically at the start of every session. It reads your structure, your package manifest, your existing conventions, and writes down what it found. Think of it as onboarding: instead of a new contractor asking where the bathroom is every morning, they get the handbook once.

The generated file is a starting point, not a finished artifact. It's usually too generic on the first pass. That's what the next command is for.

/memory opens those project guidelines for editing so you can refine them. This is where the real value lives, and where almost nobody spends enough time. The instructions that pay off aren't the obvious ones ("write clean code"). They're the specific, hard-won ones you'd give a new hire on day three: never modify files in /legacy without asking, our API responses always wrap in a data envelope, prefer composition over inheritance in the components directory, when you add a dependency, tell me why. Every time you find yourself correcting the same mistake twice, that correction belongs in memory.

/mcp configures and checks your Model Context Protocol servers. MCP is how Claude Code connects to things outside your repo — a database, an issue tracker, a documentation source, a design tool. Without it, the model is reasoning about your system through the narrow window of your source files. With it, it can look at the actual schema instead of guessing from your ORM models. If you've ever watched an AI confidently invent a column name, this is the command that fixes the root cause.

Context Management: The Skill Nobody Tells You About

Here's the failure mode almost everyone hits and almost nobody diagnoses correctly. You've been working for ninety minutes. The responses get vaguer. It starts contradicting decisions from earlier in the session. You assume the model got worse. It didn't — you filled its context window with the debris of the last ninety minutes, and the signal is drowning.

/context shows you current token consumption and how much of the context window you're using. This is the diagnostic. Run it when things start feeling off, and run it occasionally when they don't, just to build intuition for how fast a session fills up. Most people are shocked the first time: a couple of large file reads and a long debugging detour can eat the majority of the window before lunch.

/compact summarizes older conversation history to free up active space. It keeps the substance — decisions made, the shape of the problem, what you've already ruled out — and discards the verbose middle. Use it when you're deep in a task you don't want to abandon but the window is filling. It's the difference between a colleague who remembers the gist of this morning and one who's still reciting it word for word.

/clear (also written /reset in some setups) wipes conversation history while keeping your project memory and files intact. This is the underused one. When you finish a task and move to an unrelated one, clear. The instinct to preserve the session is misplaced — old context about the checkout flow does nothing but add noise while you're fixing an unrelated caching bug. Compact when you want continuity within a task; clear when you're switching tasks entirely.

/btw lets you ask a quick side question without polluting the main conversation history. It's for the small detours that would otherwise cost you: what's the flag for that again?, does this library support streaming? You get the answer without permanently spending context on it. Small command, disproportionate effect on long sessions.

Code Review and Analysis: Make It Check Its Own Work

Generated code that nobody reviews is technical debt with better formatting. These commands close the loop before a human ever opens the pull request.

/code-review (or /review) checks your current changes or a pull request for bugs and cleanups. What makes it useful is that it's a genuinely different pass than generation. When the model is producing code, it's optimizing for something that works. When it's reviewing, it's looking for what's fragile. The two mindsets catch different things, and running both is closer to how a real team operates than a single generate-and-ship step.

/security-review scans the active diff specifically for security vulnerabilities. Separating this from general review is deliberate — a general review pass tends to surface style issues and obvious bugs, and security problems hide underneath. This looks for the specific classes of failure that matter: injection points, unvalidated input, secrets in the wrong place, auth logic that doesn't fail closed, dependencies that shouldn't be there. It's not a substitute for real security tooling, but it catches the things that get shipped because everyone assumed someone else was looking.

/simplify cleans up and optimizes generated code. This one addresses a real tendency: AI-generated code is often more defensive and more abstract than it needs to be. Extra null checks, a helper function used exactly once, a layer of indirection that exists because it seemed like good practice. Simplify strips that back toward the version a thoughtful human would have written. Run it before review, not after — reviewing simpler code is faster and produces better feedback.

/diff shows every modification made during the current session. This sounds redundant if you have git open, and it isn't. Sessions sprawl. You asked for one change, then a follow-up, then a fix to the follow-up, and forty minutes later you're not entirely sure what's been touched. /diff is the audit trail. Run it before you commit anything, every time.

Execution and Control: Steering, Not Just Prompting

The last group is about intervention — deciding how work happens, and undoing it when the answer is "not like that."

/plan switches into a dedicated planning mode before making large architectural changes. Instead of immediately editing files, the model lays out what it intends to do and waits. You read the plan, argue with it, change it, and only then let it execute. For anything touching more than two or three files, this is the highest-leverage command in the entire set. Ten seconds of reading a plan routinely saves twenty minutes of unwinding a wrong one.

/model changes the active model. Different tasks genuinely want different tradeoffs. Heavy architectural reasoning, a gnarly bug, a refactor across many files — reach for the most capable model available. Renaming variables, writing straightforward tests, mechanical edits across a directory — a faster model does it just as well and costs less. Knowing when to switch is a small optimization that compounds across a workday.

/rewind rolls back recent code changes or conversation turns. This is the safety net that makes everything else less scary. Because you can undo, you can let it try the ambitious version. Once you trust that a bad outcome costs you one command rather than an afternoon of git checkout archaeology, you experiment more, and experimenting more is where the actual productivity gain lives.

/debug runs local diagnostic tools for runtime issues. Rather than pasting a stack trace into a chat and hoping, this points the model at the actual state of the running system. The gap between "here's an error message" and "here's the environment that produced it" is enormous, and it's where most wasted debugging time goes.

A Working Loop You Can Steal

Put together, a good session looks something like this. Start a new project: run /init, then spend real time in /memory writing down the things you'd tell a new hire. Beginning a substantial task: /clear first so you start clean, then /plan and read what it proposes before approving. Mid-task, when it starts feeling foggy: /context to check, /compact to recover. Small side questions along the way: /btw. Before committing: /diff to see the full scope, /simplify to cut the excess, then /code-review and /security-review. When something goes wrong: /rewind and try a different approach rather than trying to patch a bad one.

None of that is complicated. It's just deliberate, in the way that any craft becomes deliberate once you stop treating your tools as magic.

The Real Skill Is Knowing What to Delete

If there's one theme running through all fifteen commands, it's that most of them are about removing things rather than adding them. Clear the history. Compact the noise. Simplify the code. Rewind the mistake. Keep the side question out of the main thread.

That's not a coincidence — it's the same principle that shows up in every serious book on focus and systems thinking. Performance improves less from adding capability than from removing interference. A model with a clean context and a good standing brief outperforms the same model buried under ninety minutes of accumulated clutter, and it isn't close.

The people getting outsized results from AI coding tools aren't writing better prompts. They're managing state better. Learn these commands, and the tool stops being a slot machine and starts being an instrument.

For 15-minute non-fiction book summaries of best-selling books, check out sumizeit.com.

Great books in a fraction of the time

Get the key insights from top nonfiction books in text, audio, and video format in less than 15 minutes.

Get 3 FREE sample summaries!