cd /news/ai-tools/claude-code-slash-commands-you-shoul… · home topics ai-tools article
[ARTICLE · art-15863] src=dev.to pub= topic=ai-tools verified=true sentiment=↑ positive

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

A developer has documented a set of slash commands for Claude Code that go beyond basic chatbot-style interactions, including `/resume` to continue previous sessions, `/branch` to fork conversations, and `/plan` to generate written plans before implementation. The commands also feature `/init` for project onboarding via a CLAUDE.md file, `/memory` for cross-session context, `/diff` for an interactive change viewer, and `/security-review` for auditing code before shipping.

read2 min publishedMay 27, 2026

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.

/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.

/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.

/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.

── more in #ai-tools 4 stories · sorted by recency
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/claude-code-slash-co…] indexed:0 read:2min 2026-05-27 ·