20 Claude Code Slash Commands Most Developers Never Use
Claude Code slash commands are not the same as prompt keywords like ELI5 or ULTRATHINK. Type / at the start of a message and Claude Code runs a built-in command or skill—session control, parallel agents, reviews, and more (official commands reference).
Most people learn /clear and stop. These 20 are the ones that change how you work: finish goals, fork sessions, rewind mistakes, loop checks, diagnose installs, then plan, compact, branch, batch, and ship.
Related: prompt trigger words live in 10 secret Claude codes. This post is only about
/commands inside Claude Code.
Quick Reference
| # | Command | What it does |
|---|---|---|
| 1 | /goal | Keep working across turns until a condition is met |
| 2 | /fork | Copy the chat into a new background session |
| 3 | /rewind | Roll conversation and/or code back to a checkpoint |
| 4 | /loop | Repeat a prompt on an interval while the session stays open |
| 5 | /doctor | Diagnose setup issues and offer fixes |
| 6 | /plan | Enter plan mode before a large change |
| 7 | /compact | Summarize history to free context |
| 8 | /context | See what is filling the context window |
| 9 | /branch | Fork the conversation and switch into the branch |
| 10 | /subtask | Background subagent inherits full context; result returns here |
| 11 | /batch | Split a large change into parallel worktree subagents |
| 12 | /background | Detach this session as a background agent |
| 13 | /btw | Ask a side question without adding it to history |
| 14 | /permissions | Manage allow / ask / deny tool rules |
| 15 | /diff | Interactive viewer for uncommitted and per-turn diffs |
| 16 | /code-review | Review the current diff (optionally apply fixes) |
| 17 | /simplify | Parallel cleanup review of changed code |
| 18 | /security-review | Scan the branch diff for security risks |
| 19 | /teleport | Pull a Claude Code web session into this terminal |
| 20 | /remote-control | Continue this local session from another device |
Availability can depend on plan, platform, and Claude Code version. Type / to see what your build exposes (commands docs).
1. /goal — Work Until the Condition Is Met
What it does: Registers a session-level completion condition. Claude keeps working across turns until it is met. /goal clear (or stop / off / cancel) removes it early. With no argument, shows the current or last achieved goal (commands docs).
When to use it: Long refactors, “make tests green,” or any outcome you do not want to restate every turn.
/goal all unit tests in packages/api pass
/goal clear
2. /fork — Background Copy of This Conversation
What it does: Copies the current conversation into a new background session and keeps you in this one. The copy starts with everything so far; the two sessions are independent. Pass a prompt and the copy starts working immediately. Needs Claude Code v2.1.212+ for this behavior (older versions used /fork differently) (commands docs).
When to use it: Explore a risky approach in parallel without losing your main thread. For a subagent whose result returns here, use /subtask instead. To switch into a copy yourself, use /branch.
/fork try the auth fix on a separate branch and open a PR
3. /rewind — Undo Conversation and/or Code
What it does: Rewinds conversation and/or code to a previous checkpoint, or summarizes from a selected message. Aliases: /checkpoint, /undo (commands docs, checkpointing).
When to use it: Claude went the wrong way, a bad edit landed, or you want a clean restore point without abandoning the project memory.
/rewind
4. /loop — Repeat a Prompt on a Schedule
What it does: Runs a prompt repeatedly while the session stays open. Optional interval (example 5m). Omit the interval and Claude self-paces. Omit the prompt and it may run an autonomous maintenance check or .claude/loop.md. Alias: /proactive (commands docs).
When to use it: Wait for deploy, watch CI, poll a job, or nudge a long-running check.
/loop 5m check if the deploy finished and summarize the status
5. /doctor — Install and Config Checkup
What it does: Diagnoses installation and configuration issues and can fix them: PATH, duplicate installs, settings, unused skills/MCP/plugins vs context cost, slow hooks, version checks, and more. Alias: /checkup. From the shell, claude doctor is a read-only install check without starting a session (commands docs).
When to use it: Weird tool failures, bloated context from plugins, or “something feels broken” after an upgrade.
/doctor
claude doctor
6. /plan — Think Before You Edit
What it does: Enters plan mode from the prompt. Optional description starts the plan immediately (commands docs).
When to use it: Multi-file features, migrations, or anything where wrong edits are expensive.
/plan migrate the auth middleware to the new session helper without breaking tests
7. /compact — Free Context Without Starting Over
What it does: Summarizes the conversation so far to free context. Optional instructions focus the summary. Prefer this over /clear when you still need continuity (commands docs, sessions).
When to use it: Long debugging threads where the early noise is done but the conclusion matters.
/compact keep the failing test name, root cause, and the last two attempted fixes
8. /context — See What Is Eating the Window
What it does: Visualizes context usage as a colored grid, with suggestions for heavy tools, memory bloat, and capacity warnings. Pass all to expand the per-item breakdown (commands docs).
When to use it: Before /compact, or when Claude suddenly “forgets” mid-task. Pairs well with Token Weather if you use mods.
/context
/context all
9. /branch — Try Another Direction Yourself
What it does: Creates a branch of the conversation at this point, switches you into it, and keeps the original for /resume. Unlike /fork, you move into the copy (commands docs).
When to use it: “What if we rewrite this in TypeScript?” without throwing away the current path.
/branch rewrite-in-zod
10. /subtask — Side Agent That Reports Back
What it does: Spawns a forked subagent that inherits the full conversation, works in the background, and returns its result to this conversation. Needs v2.1.212+ (commands docs).
When to use it: Research, test runs, or a side fix while you keep editing. Use /fork when you want a fully separate background session instead.
/subtask find every call site of deprecated getUserSession and list files + line counts
11. /batch — Parallel Worktrees for Large Changes
What it does: Bundled skill/workflow: researches the codebase, splits work into 5–30 independent units, then (after approval) runs one background subagent per unit in an isolated git worktree, each opening a PR. Requires a git repo (commands docs).
When to use it: Migrations and mechanical refactors too big for one agent.
/batch migrate src/ from Solid to React
12. /background — Free the Terminal, Keep Working
What it does: Detaches the current session as a background agent. Optional prompt sends one more instruction before detaching. Alias: /bg. Monitor with claude agents. /fork copies into a new background session while this one keeps running (commands docs).
When to use it: Long installs, slow reviews, or overnight tasks.
/background finish the remaining test failures and summarize when done
13. /btw — Side Question, No History Pollution
What it does: Asks a quick aside that does not add to the main conversation. Without a question (v2.1.212+), reopens the last side-question overlay (commands docs).
When to use it: “What does this acronym mean?” without derailing the agent’s plan.
/btw what does HSTS mean in this nginx config?
14. /permissions — Control What Claude May Touch
What it does: Interactive dialog for allow / ask / deny rules, working directories, and recent auto-mode denials. Alias: /allowed-tools (commands docs, permissions).
When to use it: After a noisy session of prompts, or before giving more autonomy. Pair with /doctor and safer shell guards from Claude Code mods.
/permissions
15. /diff — See Exactly What Changed
What it does: Interactive diff viewer for uncommitted changes and per-turn Claude diffs. Arrow keys switch views; Enter opens a file diff (commands docs).
When to use it: Before commit, or after a multi-file turn when /replay-style review is not enough.
/diff
16. /code-review — Catch Bugs Before You Push
What it does: Reviews the current diff for correctness bugs and cleanups. Pass --fix to apply findings, --comment for GitHub PR comments, or ultra for a deep cloud review. Effort levels: low | medium | high | xhigh | max | ultra (commands docs).
When to use it: End of a feature branch, before asking a human for review.
/code-review high --fix
/code-review 1234
17. /simplify — Cleanup Pass, Not Bug Hunt
What it does: Four parallel agents review changed code for reuse, simplification, efficiency, and abstraction level, then apply fixes. From v2.1.154 it does not hunt correctness bugs—use /code-review for that (commands docs).
When to use it: After the feature works and you want less duplication.
/simplify
/simplify packages/api
18. /security-review — Branch Diff Security Pass
What it does: Analyzes changes on your current branch vs origin’s default branch for risks like injection, auth issues, and data exposure. Needs an origin remote (commands docs).
When to use it: Auth, payments, uploads, or any PR that touches trust boundaries.
/security-review
19. /teleport — Bring a Web Session Into the Terminal
What it does: Opens a picker and pulls a Claude Code on the web session (branch + conversation) into this terminal. Alias: /tp. Requires a claude.ai subscription (commands docs).
When to use it: Started on the web, finish with local tools, MCP, and your full repo.
/teleport
20. /remote-control — Continue From Another Device
What it does: Makes this local session available for Remote Control from claude.ai so you can continue from another device. Alias: /rc. Needs a claude.ai subscription (commands docs).
When to use it: Kick off work at the desk, nudge or review from phone/laptop elsewhere.
/remote-control
How to Use These Without Memorizing 20
- Type
/and filter by a few letters (go,fo,re,lo,do). - Learn the session set first:
/goal,/fork,/rewind,/loop,/branch,/subtask. - Learn the context set next:
/context,/compact,/btw. - Learn the ship set last:
/diff,/code-review,/simplify,/security-review. - Run
/doctorafter upgrades or when plugins feel heavy.
For MCP-powered workflows after commands are solid, see 5 Claude Code MCPs.
FAQ
Are these the same as the “secret Claude codes”?
No. Secret codes are prompt prefixes (ELI5, RED TEAM, …). These are Claude Code / commands from the product (commands reference).
Do all 20 appear for everyone?
No. Some need a subscription, platform, or minimum version (for example /fork / /subtask on v2.1.212+, /teleport / /remote-control with claude.ai). Your / menu is the source of truth.
/fork vs /branch vs /subtask?
/fork: copy → new background session; you stay here/branch: copy → you switch into it; original stays for/resume/subtask: background subagent; result returns to this chat
What to Try Today
Start a session and run this sequence once:
/doctor
/context
/plan fix the flaky auth test without changing production config
Then, when Claude proposes risky shell, you already know /rewind. When the job is “keep going until green,” use /goal. When you need two paths at once, use /fork or /subtask.
Twenty commands. Most of them are already in your Claude Code—you just had to type /.
Related articles
- 3 Claude Code Mods That Change How the Agent BehavesAnthropic's three sample Claude Code mods—Token Weather, Blast Radius, Replay Theater—change context UI, risky shell, and edit review. Needs v2.1.287+.
- ElevenLabs MCP Claude Code: Hosted Install, OAuth, and Creative ToolsInstall the hosted ElevenLabs MCP in Claude Code with one HTTP command, complete OAuth via /mcp, then generate speech, music, images, and video—or manage voice agents—without a local server or API key.
- Find LinkedIn Jobs with Claude + Apify (Free Credits)Connect Apify in Claude Connectors, paste one prompt with your resume, and get a ranked LinkedIn jobs table—fit score, salary, date, apply link, plus resume tweaks per listing.