DEV Community

Cover image for Claude Code Slash Commands You Should Know (I wasn't either)
Lizzie Siegle
Lizzie Siegle

Posted on

Claude Code Slash Commands You Should Know (I wasn't either)

Most people (myself included) mainly use Claude Code like a chatbot — type a request, get some code, repeat. But there's a whole layer of slash commands that make it significantly more powerful. Here's a rundown of the ones worth knowing.


Session Management

/resume
Closed your terminal last night? This picks up exactly where you left off, letting you reopen and continue a previous coding session without losing your context.

/branch
This forks your current conversation into a new, separate session. Want to try a risky refactor without blowing up your current progress? Branch it. Think of it like git branch, but for your conversation.

/clear
Context getting bloated and Claude going in circles? Wipe it and start fresh. Sometimes a clean slate is the fastest fix.


Before You Write a Single Line of Code

/init
Run this first in any new project. It sets up your CLAUDE.md file — the place where Claude learns about your stack, your conventions, and your project structure. Think of it as onboarding Claude to your codebase.

/plan
Don't just say "build this." Ask Claude to plan first. Slowing down to get a written plan before implementation leads to noticeably better output — especially on complex features.

/memory
This is what Claude remembers about your project across sessions. Read it regularly, edit it when things change, and keep it accurate. Garbage in, garbage out.


During and After Development

/diff
Launches an interactive viewer showing all the changes made in the current session. You can toggle between a full git diff, view per-turn changes, and navigate between files. It's a quick sanity check: what exactly has changed since my last commit?

/compact
Conversation going back and forth? Session getting slow? This compresses your context while keeping the important parts — faster responses without losing the thread.

/security-review
Self-explanatory. Run this before you ship anything that touches auth, payments, APIs, or user data. Better to catch it here than in production.


Did you already know some of these? Drop a comment with how you're using Claude Code — always curious what workflows people have built around it.

Top comments (0)