/Slash Command Reference

All built-in commands, shortcuts, and prefixes โ€” with examples and outputs ยท July 2026
v2.1.205+
๐Ÿ’พ

Session & Memory

/init
Initialize project with CLAUDE.md. Creates your project's persistent instruction file read at every session start.
โ–ธ example
/init
โ—ˆ output
โœ“ CLAUDE.md created (18 lines) Detected: Node.js ยท TypeScript ยท Jest Added: project structure, test cmds, style notes Claude will read this at every session start.
/memory
View and manage auto-memory files. Use # prefix in the REPL to add things to memory without editing files.
โ–ธ example
/memory
โ—ˆ output
Memory: ~/.claude/projects/.../memory/ user_role.md senior fullstack dev feedback_testing.md run tests before commit project_context.md auth refactor (compliance) [E]dit [D]elete [N]ew
/resume
Resume a previous session. /resume 1 for most recent, /resume name by name. Sessions are resumable up to 7 days.
โ–ธ example
/resume auth-refactor
โ—ˆ output
Resuming: "auth-refactor" (2h ago ยท 34 msgs) Last action: edited src/auth/middleware.ts Context restored. Continue where you left off.
/rename
Name the current session for easy resuming later.
โ–ธ example
/rename auth-refactor
โ—ˆ output
Session renamed โ†’ "auth-refactor" Resume later with: /resume auth-refactor
/clear
Clear conversation history. Keeps files and memory intact โ€” only the chat context is wiped.
โ–ธ example
/clear
โ—ˆ output
Conversation cleared (47 messages removed). Files, memory, and tool state are intact.
/compact
Condense conversation history to free up context. Optionally focus: /compact focus on tests
โ–ธ example
/compact focus on the failing tests
โ—ˆ output
Compacted: 112 messages โ†’ 14 (87% reduction) Summary anchored on: test failures in auth.test.ts Context freed: ~82k tokens
/context
View context window usage with actionable suggestions on when to compact.
โ–ธ example
/context
โ—ˆ output
Context window: โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘ 58% Used: 116,842 / 200,000 tokens System + tools: 18k Conversation: 74k Files in scope: 24k โšก Suggestion: /compact when above 75%
/export
Export the conversation transcript to a file.
โ–ธ example
/export
โ—ˆ output
โœ“ Transcript exported File: claude-session-2026-07-18-14-32.md Messages: 47 ยท Code blocks: 12
/rewind
Return to a prior checkpoint. Also triggered by pressing Esc Esc.
โ–ธ example
/rewind
โ—ˆ output
Reverted to checkpoint before last response. 3 file edits undone: src/auth/middleware.ts src/auth/types.ts tests/auth.test.ts
/branch
Branch the conversation for parallel exploration without affecting your main session.
โ–ธ example
/branch
โ—ˆ output
Branched from turn 23. Branch ID: br_a4f2c9 Explore freely โ€” main session is unaffected. Merge back or discard when done.
โšก

Model & Effort

/model
Switch model mid-session. Options: sonnet (default), opus, haiku, fable. Also Alt+P while typing.
โ–ธ example
/model opus
โ—ˆ output
Model โ†’ claude-opus-4-8 Effort: medium Best for: complex reasoning, agentic tasks
/effort
Set reasoning effort: low, medium, high, xhigh. Use xhigh with Opus for hardest agentic work.
โ–ธ example
/effort xhigh
โ—ˆ output
Effort โ†’ xhigh Claude will reason more deeply before responding. Recommended pairing: /model opus
/fast
Toggle fast output mode โ€” uses Opus with optimized output speed.
โ–ธ example
/fast
โ—ˆ output
Fast mode ON Using Opus 4.8 with optimized output speed. Toggle off: /fast
/usage
View token usage, cost, and plan limits. /cost and /stats are shortcuts that open specific tabs here.
โ–ธ example
/usage
โ—ˆ output
Session usage Input tokens: 142,330 Output tokens: 18,440 Cache hits: 89,200 (63%) Estimated cost: $0.38 Plan: Pro ยท Resets: Aug 1
/status
View current session state: active model, permission mode, and settings summary.
โ–ธ example
/status
โ—ˆ output
Model: claude-sonnet-4-6 Mode: acceptEdits Effort: medium ยท Fast: off Session: "auth-refactor" (2h 14m) Working dir: /Users/me/my-project
๐Ÿ”

Autonomous Work

/loop agentic
Run a prompt or command on a repeating interval. /loop 3h check PRs, /loop 5m /my-skill, or bare /loop for self-paced maintenance. Stop with /loop stop.
โ–ธ example
/loop 5m check for new failing tests
โ—ˆ output
Loop started โ†บ Interval: every 5 minutes Task: check for new failing tests Wakeup #1: 14:47 Stop with: /loop stop or Ctrl+C
/goal v2.1.139+
Set a completion condition; Claude keeps going autonomously until the condition is met. Uses a fast model to evaluate after each turn.
โ–ธ example
/goal all tests pass
โ—ˆ output
Goal set: "all tests pass" Running autonomously... โœ— Turn 1: 3 tests failing in auth.test.ts โ†’ Fixing middleware null check... โœ“ Turn 2: All 47 tests passing Goal reached in 2 turns. Stopping.
/plan
Enter plan mode โ€” Claude outlines the approach before touching any files. Best before large refactors.
โ–ธ example
/plan refactor the auth module
โ—ˆ output
Plan: Refactor auth module Phase 1 โ€” Audit (read-only) โ€ข Read src/auth/*.ts (6 files) โ€ข Identify session token issues Phase 2 โ€” Restructure โ€ข Split middleware.ts โ†’ validator + session โ€ข Update imports in 4 consumers Phase 3 โ€” Test: jest --testPathPattern=auth Approve to begin โ†’ [Y/n]
/batch
Run batch operations across multiple files or targets in parallel.
โ–ธ example
/batch add JSDoc to all files in src/utils/
โ—ˆ output
Batch: 8 files in src/utils/ โœ“ formatDate.ts โ€” 3 functions documented โœ“ validators.ts โ€” 7 functions documented โœ“ http.ts โ€” 4 functions documented ... (5 more) Completed in 12s ยท 0 errors
/tasks
List all background agents currently running in this session.
โ–ธ example
/tasks
โ—ˆ output
Background agents (2 running) [1] โ— pr-reviewer Running 1m 34s [2] โ— test-watcher Running 4m 02s /tasks stop 1 to stop agent #1
/bashes
List background bash tasks spawned by Claude.
โ–ธ example
/bashes
โ—ˆ output
Background bash tasks (1 running) [1] โ— npm run build Running 0m 48s PID 83421 Output: /tasks output 1 Stop: /tasks stop 1
Tip: /loop vs /goal โ€” use /loop when you want Claude to wake up on a schedule. Use /goal when you want Claude to keep working until a condition is true.
๐Ÿ”

Code Quality

/code-review
Find correctness bugs. Supports effort levels: /code-review medium, /code-review ultra. Use --fix to auto-apply, --comment to post inline GitHub PR comments.
โ–ธ example
/code-review --fix
โ—ˆ output
Reviewing diff (14 files, +342/-89 lines)... โ— HIGH src/api/users.ts:42 SQL injection via userId โ— MED src/auth/session.ts:18 Missing null check โ—‹ LOW src/utils/format.ts:7 Unnecessary re-render Applying 2 fixes (HIGH + MED)... โœ“ Fixed. Review LOW finding manually.
/security-review
Review code specifically for security vulnerabilities โ€” OWASP Top 10, secrets in code, injection risks.
โ–ธ example
/security-review
โ—ˆ output
Security review: 23 files on current branch CRITICAL src/api/upload.ts:31 Path traversal HIGH src/auth/tokens.ts:14 Token in localStorage HIGH .env.example Real API key โ€” rotate! LOW src/utils/log.ts:8 Email in plaintext logs 4 findings ยท 1 critical ยท 2 high ยท 1 low
/claude-api
Get help building apps with the Anthropic SDK โ€” tool use, batch processing, MCP integration, streaming, prompt caching.
โ–ธ example
/claude-api
โ—ˆ output
Claude API Reference loaded. Ask me about: โ€ข Model IDs, pricing, rate limits โ€ข Tool use / function calling โ€ข Streaming responses โ€ข MCP server setup & tool definitions โ€ข Batch API & prompt caching
๐Ÿค–

Parallel & Agents

/agents
Open Agent View โ€” an operations screen for running, blocked, and completed Claude Code sessions. Up to 10 subagents can run in parallel.
โ–ธ example
/agents
โ—ˆ output
Agent View โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ [1] โ— pr-reviewer Running 2m 11s [2] โ— test-watcher Running 8m 03s [3] โ—‹ docs-builder Complete -- [S]top [V]iew output [N]ew agent
/skills
List installed skills with a type-to-filter search box. Skills are prompt-based commands stored in .claude/skills/.
โ–ธ example
/skills
โ—ˆ output
Installed skills (6) /deep-research Multi-source cited research report /code-review Review diff at configurable effort /security-review OWASP-focused security audit /run Launch and test the app live /verify Verify a change works in the app /pr-review Review open PRs [custom]
/add-dir
Expand file access by adding additional working directories to the session.
โ–ธ example
/add-dir ../shared-utils
โ—ˆ output
โœ“ Added to session scope: /Users/me/shared-utils (47 files ยท 12.3k lines) Claude can now read and edit files here.
โš™๏ธ

Config & Permissions

/config
Open the full settings interface interactively.
โ–ธ example
/config
โ—ˆ output
Settings โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ Model claude-sonnet-4-6 Effort medium Theme dark Permission acceptEdits Auto-memory enabled Hooks 3 configured MCP servers 2 active [Tab] navigate [Enter] edit [Q] quit
/permissions
Manage permission settings interactively โ€” what Claude can read, edit, and execute.
โ–ธ example
/permissions
โ—ˆ output
Permissions โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ โœ“ Read files all paths โœ“ Edit files all paths โœ“ Bash: git * allowed โœ“ Bash: npm test allowed โœ— Bash: rm -rf blocked [A]dd [R]emove [M]ode [Q]uit
/hooks
View current hook configuration. Hooks fire on events like PreToolUse, PostToolUse, Stop, etc.
โ–ธ example
/hooks
โ—ˆ output
Hooks (3 configured) PreToolUse โ†’ lint check before file edits PostToolUse โ†’ run tests after Bash(git commit *) Stop โ†’ notify Slack #dev-alerts Source: .claude/settings.json
/mcp
Configure MCP servers. /mcp enable, /mcp disable. MCP expands Claude's tool access to external services.
โ–ธ example
/mcp enable github
โ—ˆ output
MCP server "github" enabled. Tools added: list_repos, create_pr, get_issue (+12 more) Auth: OAuth (already connected) Active MCP servers: github, slack
/doctor
Full setup checkup โ€” diagnoses and fixes environment issues. Alias: /checkup
โ–ธ example
/doctor
โ—ˆ output
Claude Code Health Check โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ โœ“ CLI version 2.1.205 (latest) โœ“ Node.js v20.11.0 โœ“ Auth logged in (anandhu-eng) โœ“ Git 2.43.0 โœ— MCP: jira unreachable (timeout) โœ“ CLAUDE.md found (18 lines) 1 warning ยท fix: /mcp disable jira
/bug
Report a bug directly to Anthropic from within your session.
โ–ธ example
/bug
โ—ˆ output
Report a bug to Anthropic Session ID: sess_7f3a2b Version: 2.1.205 Describe the issue: > _ [Submit] [Attach transcript] [Cancel]
/login & /logout
Authenticate or sign out mid-session without restarting Claude Code.
โ–ธ example
/logout
โ—ˆ output
Signed out of claude.ai (anandhu-eng). Token cleared from keyring. Sign back in: /login Or restart: claude --login
โŒจ๏ธ

Keyboard Shortcuts

Ctrl+CCancel current operation
Ctrl+DExit session (EOF)
Ctrl+LClear screen (keeps history)
Ctrl+BBackground current operation
Ctrl+X Ctrl+KStop all agents
Ctrl+SStash prompt draft
Ctrl+GOpen external editor
Ctrl+VPaste image from clipboard
Ctrl+OToggle verbose output
Ctrl+RSearch command history
Esc EscRewind last change
Shift+TabCycle permission modes
Alt+PSwitch models while typing
Alt+TToggle thinking mode
TabAccept prompt suggestion
! TabBash history autocomplete
?Show all shortcuts
โŒจ๏ธ

Quick Prefixes

#
Persistent Memory
# Always use TypeScript
/
Slash Command
/code-review --fix
!
Execute Bash
! git status
@
Reference File
@src/index.ts
&
Send to Cloud
& Build the API
๐Ÿ› 

Custom Commands

Create a .md file in .claude/commands/ (project) or ~/.claude/commands/ (personal) and invoke it with /filename. Use $ARGUMENTS for arguments.
--- # .claude/commands/pr-review.md description: Review open PRs and post GitHub comments allowed-tools: Bash(gh pr list *), Bash(gh pr diff *), Bash(gh pr review *) model: opus --- 1. Run `gh pr list --state open --json number,title` 2. For each PR, run `gh pr diff <number>` 3. Review for: breaking API changes, missing error handling, security issues 4. Post: `gh pr review <number> --comment -b "<feedback>"`
Usage: /pr-review โ€” or schedule it: /loop 3h /pr-review
๐Ÿ”

Permission Modes

manual (default)
Prompts on first use of each tool
Normal development
acceptEdits
Auto-approves file edits, prompts for bash
Trusted projects
auto
Safety classifier reviews each action automatically
Autonomous with guardrails
plan
Read-only โ€” no edits or execution
Analysis only
bypassPermissions
Skips all prompts entirely
CI/CD automation
Cycle modes with Shift+Tab. Set at startup: claude --permission-mode auto