Claude Code Keyboard Shortcuts
Keyboard shortcuts, slash commands, and input syntax for Claude Code on MacWindowsLinux.
Session Control
| Action | Shortcut |
|---|---|
| Start a Claude Code session in current directory | claudeclaudeclaude |
| Cancel current request or input | EscEscEsc |
| Interrupt running operation | CtrlCCtrlCCtrlC |
| Exit Claude Code | CtrlDCtrlDCtrlD |
| Exit Claude Code (alternate) | /exit/exit/exit |
| Clear the terminal screen | CtrlLCtrlLCtrlL |
| Resume the most recent session | claude--continueclaude--continueclaude--continue |
| Pick a past session to resume | claude--resumeclaude--resumeclaude--resume |
Input & Editing
| Action | Shortcut |
|---|---|
| Submit message | EnterEnterEnter |
| Insert a new line in your message | ShiftEnterShiftEnterShiftEnter |
| Insert a new line (alternate) | \Enter\Enter\Enter |
| Move cursor to start of line | CtrlACtrlACtrlA |
| Move cursor to end of line | CtrlECtrlECtrlE |
| Move cursor one word backward | OptionLeftAltLeftAltLeft |
| Move cursor one word forward | OptionRightAltRightAltRight |
| Delete word before cursor | CtrlWCtrlWCtrlW |
| Delete from cursor to start of line | CtrlUCtrlUCtrlU |
| Delete from cursor to end of line | CtrlKCtrlKCtrlK |
| Open input in external editor ($EDITOR) | CtrlXCtrlECtrlXCtrlECtrlXCtrlE |
History & Autocomplete
| Action | Shortcut |
|---|---|
| Previous message in history | UpUpUp |
| Next message in history | DownDownDown |
| Reverse-search through history | CtrlRCtrlRCtrlR |
| Autocomplete slash command or file path | TabTabTab |
| Cycle backward through completions | ShiftTabShiftTabShiftTab |
Plan Mode
| Action | Shortcut |
|---|---|
| Toggle plan mode on or off | ShiftTabShiftTabShiftTab |
| Approve plan and start execution | EnterEnterEnter |
| Reject plan and keep iterating | EscEscEsc |
Slash Commands
| Action | Shortcut |
|---|---|
| Show all available slash commands | /help/help/help |
| Clear the current conversation | /clear/clear/clear |
| Summarize conversation to free up context | /compact/compact/compact |
| Initialize a CLAUDE.md for this project | /init/init/init |
| View or edit project and user memory | /memory/memory/memory |
| Switch Claude models | /model/model/model |
| Open settings and preferences | /config/config/config |
| Manage subagents | /agents/agents/agents |
| Manage MCP servers and connectors | /mcp/mcp/mcp |
| Give Claude access to another directory | /add-dir/add-dir/add-dir |
| Show token cost for current session | /cost/cost/cost |
| Resume a previous session | /resume/resume/resume |
| Review code or a recent diff | /review/review/review |
| Pull review comments from a GitHub PR | /pr-comments/pr-comments/pr-comments |
| Sign out of your Anthropic account | /logout/logout/logout |
File & Code References
| Action | Shortcut |
|---|---|
| Reference a file or directory in your message | @path/to/file@path/to/file@path/to/file |
| Run a shell command directly (bash mode) | !command!command!command |
| Add a note to memory (project or user) | #your note#your note#your note |
| Paste an image from clipboard | CmdVCtrlVCtrlV |
| Drag and drop a file into the terminal | Drag file onto terminalDrag file onto terminalDrag file onto terminal |
Tool Permissions
| Action | Shortcut |
|---|---|
| Approve a single tool call | EnterEnterEnter |
| Approve and remember choice for this session | AAA |
| Reject the proposed tool call | EscEscEsc |
| Bypass all permission prompts (use with care) | claude--dangerously-skip-permissionsclaude--dangerously-skip-permissionsclaude--dangerously-skip-permissions |
No shortcuts found. Try a different search term.
Frequently Asked Questions
How do I enter plan mode in Claude Code?
Press Shift+Tab from the input prompt to toggle plan mode on or off. In plan mode Claude proposes a step-by-step plan before touching files. Press Enter to approve and execute, or Esc to reject and keep iterating on the plan.
How do I reference a file in Claude Code?
Type @ followed by the path — for example @src/app.tsx or @README.md. Claude Code expands the reference and reads the file before responding. Tab completes paths the same way your shell does.
What does the # prefix do in Claude Code?
Lines that start with # are added to memory instead of being sent as a normal message. Claude Code asks whether to save the note to project memory (CLAUDE.md in the repo) or user memory (your personal CLAUDE.md in ~/.claude). Use # for facts you want remembered across turns, like coding conventions or commands.
How do I run a shell command without leaving Claude Code?
Start the line with ! to run it in bash mode — for example !ls or !git status. The command runs in the same working directory as your session and the output is shared back to Claude, so you can ask follow-up questions about it.
How do I exit a Claude Code session?
Press Ctrl+D, type /exit, or type /quit. If a request is running, press Esc once to cancel it, or Ctrl+C to interrupt the underlying process. Sessions are saved automatically — use claude --continue to pick up where you left off.
How do I free up context without losing the session?
Type /compact. Claude Code summarizes the conversation so far and keeps the summary in context, freeing tokens for new work. Use /clear if you want a completely fresh slate instead.
Is Claude Code different from the Claude desktop app?
Yes. Claude Code is a command-line tool for agentic coding tasks — running in your terminal, reading and editing files in your project, executing shell commands, and using MCP tools. The Claude desktop and web apps are general-purpose chat interfaces with their own keyboard shortcuts.