Claude Code Keybindings
Slash commands and keyboard shortcuts are the primary interface for controlling Claude Code sessions, managing context, and invoking workflows.
Think of them as a command palette: type
/to access built-in commands and skills, press keyboard shortcuts for quick actions, and use@for file references.
Routing
| Syntax | What it does |
|---|---|
/skill-name | Invoke a skill (e.g., /pdf, /tech-doc-writer) |
@file-path | Reference a file in your prompt |
!command | Run bash command directly (bash mode) |
Session management
| Command | What it does |
|---|---|
/clear | Reset conversation and context (aliases: /new, /reset) |
/compact [instructions] | Compress conversation to free context window |
/memory | Edit memory files (CLAUDE.md) and auto-memory |
/context | Visualize context usage with optimization tips |
/cost | Show token usage and estimated cost |
/resume [session] | Resume a conversation by ID or name |
/branch [name] | Create a branch at current point (alias: /fork) |
Code workflows
| Command | What it does |
|---|---|
/diff | Interactive diff viewer for uncommitted changes |
/rewind | Restore code/conversation to previous point (alias: /checkpoint) |
/copy [N] | Copy last (or Nth-last) assistant response to clipboard |
/export [filename] | Export conversation as plain text |
Model & configuration
| Command | What it does |
|---|---|
/model [model] | Switch AI model (Opus, Sonnet, Haiku) |
/effort [level] | Set effort level (low, medium, high, max, auto) |
/fast [on|off] | Toggle fast mode |
/config | Open settings interface (alias: /settings) |
/doctor | Health check for installation |
Utilities
| Command | What it does |
|---|---|
/btw <question> | Ask side question without adding to history |
/init | Generate CLAUDE.md for current project |
/skills | List available skills |
/agents | Manage agent configurations |
/mcp | Manage MCP server connections |
/help | Show all available commands |
Account
| Command | What it does |
|---|---|
/login | Authenticate or switch account |
/logout | Sign out |
Keyboard shortcuts
| Key | What it does |
|---|---|
↑ / ↓ | Navigate prompt history |
Escape | Cancel operation or clear input |
Esc + Esc | Rewind or summarize from selected message |
Shift+Tab | Cycle permission modes (default, plan, auto, etc.) |
Ctrl+C | Interrupt running operation |
Ctrl+O | Toggle verbose output (detailed tool usage) |
Common workflows
| Scenario | Command sequence |
|---|---|
| Start fresh task | /clear → describe task |
| Free up context on long task | /compact with optional focus instructions |
| Review uncommitted changes | /diff |
| Onboard new project | /init → review generated CLAUDE.md |
| Use faster model | /model → select Haiku or /fast on |
| Preview before risky changes | Shift+Tab → review plan → Shift+Tab to execute |
| Ask quick question | /btw <question> (doesn't affect conversation) |
| Undo recent changes | /rewind → select checkpoint |
Tips
- Use
/clear(not/compact) between unrelated tasks to avoid context pollution - Run
/contextto see optimization suggestions before compacting - Enable plan mode (
Shift+Tab) before destructive operations - Press
?in terminal to see platform-specific shortcuts