NEW: Claude Code Security — research preview →

Cheatsheet

100+ slash commands - the ones that change your workflow

POPULARRead time: 6 min

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

CommandWhat 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
/clearStart a new conversation with empty context (the old one stays in /resume)
/contextVisualize context usage as a colored grid, with optimization suggestions
/usageSession cost, plan usage limits, and activity stats (/cost and /stats are aliases)
/rewindRewind code and/or conversation to an earlier prompt (also Esc Esc; aliases /checkpoint, /undo)
/initGenerate or improve a CLAUDE.md for the project
/memoryEdit CLAUDE.md files and manage auto memory
/modelSwitch model (arrow keys adjust effort where supported)
/effort [level]Set effort: low, medium, high, xhigh, max, or auto
/resumeResume a previous conversation by ID or name, or open the picker
/diffReview working-tree changes, including Claude's edits
/btw [question]Ask a side question without adding it to the conversation
/permissionsManage 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):

CommandPurposeExample
/batchPlan 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
/simplify4 parallel review agents (reuse, simplification, efficiency, abstraction level) clean up changed code - not a bug hunt/simplify or /simplify src/auth
/code-reviewReview the current diff, PR, or branch for correctness bugs (/review is an alias)/code-review high --fix
/debugTurn on debug logging for the session and troubleshoot by reading the debug log/debug MCP server won't connect
/loopRun a prompt repeatedly on an interval while the session is open/loop 5m check if the deploy finished
/claude-apiLoad Claude API / Managed Agents reference for your project's language/claude-api (in-session docs)
/fewer-permission-promptsScan transcripts and add an allowlist for common read-only calls/fewer-permission-prompts
/update-configDescribe 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:

  1. default (shown as Manual) - Reads run freely; asks before edits, shell commands, and network access
  2. acceptEdits - Auto-approves file edits and common filesystem commands (mkdir, touch, mv, cp); asks about other commands
  3. plan - Research and propose a plan without editing source files
  4. auto - A classifier model reviews actions in the background instead of prompting you
  5. 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)
  6. 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

FlagPurposeExample
--continue, -cContinue the most recent conversation in this directoryclaude -c
--resume, -rResume a session by ID or name, or open a pickerclaude --resume auth-refactor
--fork-sessionWhen resuming, branch into a new session ID instead of reusing the originalclaude --resume abc123 --fork-session
--name, -nName the session so you can resume it by nameclaude -n "my-feature-work"
--from-prOpen the session picker filtered to sessions linked to a PRclaude --from-pr 42
--effortSet the effort level for this session (low to max)claude --effort high "complex refactor"
--worktree, -wStart in an isolated git worktreeclaude -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.md files (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.