Cheatsheet
100+ slash commands - the ones that change your workflow
title: "Cheatsheet" description: "100+ slash commands - the ones that change your workflow" section: "Getting Started" readTime: "6 min" badge: "POPULAR"
Claude Code Cheatsheet
100+ slash commands and bundled skills. Most people know 5. Here are the ones that change your workflow. Type / in a session to see everything available to you.
Essential Commands
| Command | What It Does |
|---|---|
/plan [task] | Enter plan mode; optionally start straight away with a task (/plan fix the auth bug) |
/compact [instructions] | Summarize the conversation so far to free context; optional focus instructions |
/clear | Start a new conversation with empty context (the old one stays in /resume) |
/context | Visualize context usage as a colored grid, with optimization suggestions |
/usage | Session cost, plan usage limits, and activity stats (/cost and /stats are aliases) |
/rewind | Rewind code and/or conversation to an earlier prompt (also Esc Esc; aliases /checkpoint, /undo) |
/init | Generate or improve a CLAUDE.md for the project |
/memory | Edit CLAUDE.md files and manage auto memory |
/model | Switch model (arrow keys adjust effort where supported) |
/effort [level] | Set effort: low, medium, high, xhigh, max, or auto |
/resume | Resume a previous conversation by ID or name, or open the picker |
/diff | Review working-tree changes, including Claude's edits |
/btw [question] | Ask a side question without adding it to the conversation |
/permissions | Manage allow, ask, and deny rules |
Bundled Skills
Pre-loaded skill commands (they ship with Claude Code, and Claude can also invoke them on its own when relevant):
| Command | Purpose | Example |
|---|---|---|
/batch | Plan a large change, split it into 5-30 units, run one background subagent per unit in its own git worktree | /batch migrate src/ from JavaScript to TypeScript |
/simplify | 4 parallel review agents (reuse, simplification, efficiency, abstraction level) clean up changed code - not a bug hunt | /simplify or /simplify src/auth |
/code-review | Review the current diff, PR, or branch for correctness bugs (/review is an alias) | /code-review high --fix |
/debug | Turn on debug logging for the session and troubleshoot by reading the debug log | /debug MCP server won't connect |
/loop | Run a prompt repeatedly on an interval while the session is open | /loop 5m check if the deploy finished |
/claude-api | Load Claude API / Managed Agents reference for your project's language | /claude-api (in-session docs) |
/fewer-permission-prompts | Scan transcripts and add an allowlist for common read-only calls | /fewer-permission-prompts |
/update-config | Describe a settings change and Claude edits settings.json | /update-config allow npm test |
Permission Modes
Cycle with Shift+Tab. The default cycle is default → acceptEdits → plan → auto:
- default (shown as Manual) - Reads run freely; asks before edits, shell commands, and network access
- acceptEdits - Auto-approves file edits and common filesystem commands (
mkdir,touch,mv,cp); asks about other commands - plan - Research and propose a plan without editing source files
- auto - A classifier model reviews actions in the background instead of prompting you
- dontAsk - Only pre-approved tools run; anything that would prompt is denied. Never in the Shift+Tab cycle - set it with the flag (good for CI)
- bypassPermissions - Skips permission prompts entirely (isolated containers/VMs only). Joins the cycle only if you start with
--dangerously-skip-permissions,--allow-dangerously-skip-permissions, or this mode
Deny rules still apply in every mode, including bypassPermissions.
Set with:
claude --permission-mode auto "your task"Session Management
| Flag | Purpose | Example |
|---|---|---|
--continue, -c | Continue the most recent conversation in this directory | claude -c |
--resume, -r | Resume a session by ID or name, or open a picker | claude --resume auth-refactor |
--fork-session | When resuming, branch into a new session ID instead of reusing the original | claude --resume abc123 --fork-session |
--name, -n | Name the session so you can resume it by name | claude -n "my-feature-work" |
--from-pr | Open the session picker filtered to sessions linked to a PR | claude --from-pr 42 |
--effort | Set the effort level for this session (low to max) | claude --effort high "complex refactor" |
--worktree, -w | Start in an isolated git worktree | claude -w feature-auth |
Inside a session, /branch forks the conversation at the current point so you can try a different direction.
Compaction Strategy
Claude Code compacts automatically as the context window approaches its limit, so a full window doesn't end your session. The exact trigger point depends on your model and configuration. You can act earlier:
Watch usage → /context
Before a big task → /compact focus on <what matters>
Compact earlier → /autocompact 500k (set how full the window gets first)
Partial compact → /rewind → "Summarize from here" / "Summarize up to here"
Switching tasks → /clear
What survives compaction:
- System prompt and output style
- Project-root
CLAUDE.md, unscoped rules, and auto memory (re-injected from disk) - The plan written in plan mode
- Up to five recently edited/read files (re-read from disk)
- Invoked skill bodies (capped per skill and in total)
What gets summarized away:
- Conversation history and intermediate steps
- Path-scoped rules and nested
CLAUDE.mdfiles (reloaded on demand when Claude touches matching files) - Context that hooks injected earlier
Anti-Patterns to Avoid
❌ Task without recent CLAUDE.md update
❌ Task without clear scope
❌ Using /clear mid-implementation
❌ Running agent teams without git commits to fall back on (checkpoints don't capture subagent or Bash changes)
❌ Bypassing permissions in complex work
Pro Tip: Explore with /plan (or --permission-mode plan) at a lower --effort, then hand the approved large-scale change to /batch for parallel implementation - raise /effort first if the units are tricky.