Update — September 24, 2026: New coverage — Will Claude Code kill plan mode?.
Claude Code has a compact but powerful set of keyboard shortcuts, slash commands, and input conventions. This page is designed to be bookmarked — tables first, prose minimal.
Input & Navigation Shortcuts
Claude Code keyboard shortcuts diagram: a few glowing labeled keys highlighted on a dimmed keyboard
Shortcut behavior depends on the active context and terminal; consult the installed help panel before remapping keys.
| Shortcut | Action |
|---|---|
Enter | Submit your message |
Shift+Enter | Insert a newline (multi-line input) |
Up Arrow | Cycle backward through previous messages/commands |
Down Arrow | Cycle forward through history |
Ctrl+C | Interrupt/cancel the current operation |
Escape | Interrupt the current response or close a dialog; double Escape clears a draft |
Ctrl+L | Clear the terminal display (conversation history is preserved) |
Interrupting Claude During Tool Execution
Press Ctrl+C to interrupt a running operation. When nothing is running, the first press clears input and a subsequent press can exit the session. Escape can also interrupt the response or close the active dialog. Read the visible prompt before repeating a key.
Interruption preserves work already done; review files and external operations before starting again. The official interactive reference documents these context-dependent controls.
Multi-Line Input
| Method | How it works |
|---|---|
Shift+Enter | Adds a newline in the prompt box |
| Paste multi-line text | Claude Code accepts it directly; no special steps needed |
@filename for long inputs | Write your prompt to a temp file, then reference it with @filename |
For very long prompts (hundreds of lines), write them to a file and use @filename to include them. This avoids terminal input limitations.
Slash Commands
Slash commands are typed into the prompt box. They are not keyboard shortcuts, but they are part of daily Claude Code operation and belong in any shortcut reference.
| Command | Description |
|---|---|
/help | Show all available commands |
/config | Open the settings editor |
/model | Switch the model for the current session |
/clear | Clear conversation history |
/compact | Summarize and compact conversation history (saves tokens) |
/resume | Open the session picker to resume a previous session |
/init | Generate a CLAUDE.md file for the current project |
/cost | Show token usage and estimated cost for the current session |
/mcp | List connected MCP servers |
/doctor | Run diagnostics to check Claude Code setup health |
/bug | Report a bug to Anthropic |
/review | Trigger the code review skill |
/<skill-name> | Invoke any installed skill by name |
@ References in Messages
Type @ inside any message to attach context directly to your prompt.
| Syntax | Effect |
|---|---|
@filename.ts | Attach a file by name (searches project root) |
@/path/to/file | Attach a file by absolute or relative path |
| A URL in your request | Ask the agent to fetch the page; this is separate from file autocomplete |
@ (alone) | Opens an autocomplete picker listing project files |
Combining @ references with your question is the fastest way to give Claude precise context without copying and pasting code.
Power User: The ! Shell Prefix
Prefix any message with ! to run it as a shell command directly in the conversation.
| Example | What happens |
|---|---|
! git status | Runs git status, output appears in the conversation |
! ls -la | Lists directory contents inline |
! cat package.json | Prints file contents into the conversation |
The output is visible to Claude and can be referenced in follow-up messages. This avoids a round-trip tool call when you just need to check something quickly.
Customizing Keybindings
Claude Code stores custom keybindings in ~/.claude/keybindings.json. Edit it directly or run /keybindings from the prompt.
Example: change one binding in the Chat context
The current configuration uses context blocks and namespaced actions:
{
"bindings": [
{
"context": "Chat",
"bindings": {
"ctrl+e": "chat:externalEditor"
}
}
]
}
This example assigns a shortcut to the external prompt editor. Consult the official action list before changing submit, newline, or dialog behavior. Some controls are reserved, and the terminal may intercept a combination before Claude Code receives it.
macOS vs. Linux Differences
| Scenario | macOS | Linux |
|---|---|---|
| Interrupt Claude | Ctrl+C | Ctrl+C |
| Copy selected text in terminal | Cmd+C | Ctrl+Shift+C (most terminals) |
| Clear terminal | Ctrl+L or Cmd+K (iTerm2) | Ctrl+L |
| Shortcut conflicts | iTerm2, Warp, or Alacritty may intercept keys | Check terminal keybinding settings |
If a shortcut is not working on macOS, check your terminal emulator's settings first. iTerm2 and Warp both have their own keybinding layers that can shadow Ctrl+ combinations.
Quick Reference Card
| Category | Shortcut / Command | Effect |
|---|---|---|
| Submit | Enter | Send message |
| Newline | Shift+Enter | Add line in prompt |
| History | Up / Down Arrow | Navigate history |
| Interrupt | Ctrl+C | Stop Claude |
| Draft reset | Escape twice | Clear draft; empty input can open rewind |
| Clear display | Ctrl+L | Clear terminal (not history) |
| Close / interrupt | Escape | Context-dependent cancellation |
| Shell command | ! <command> | Run shell inline |
| Attach file | @filename | Add file context |
| Fetch URL | URL in request | Ask for web context explicitly |
| Settings | /config | Open settings |
| Model | /model | Switch model |
| Token cost | /cost | Show usage/cost |
| Diagnostics | /doctor | Health check |
| Custom keys | ~/.claude/keybindings.json | Remap any command |
Bookmark this page or copy the quick reference card into your CLAUDE.md so it is always one / away.
Update — September 11, 2026: Claude Code desktop also shipped flexible pane pop-out and a persistent /diff pane (scroll, click, real-time updates) — layout + review beyond keyboard shortcuts: flexible panes + /diff. Full command map: slash commands reference.
A shortcut is interpreted by several layers
The key you press passes through the operating system, terminal emulator, and sometimes a multiplexer before Claude Code receives it. That is why a shortcut can work in a standalone terminal but fail inside an editor terminal. Diagnose the layer rather than repeatedly changing Claude Code settings.
Begin with a harmless prompt draft. Type two short lines, move between them, and try the newline method you intend to use. Do not use a shell command as the test text: accidental submission should produce an ordinary conversation, not an operation on your project. After the draft behaves correctly, try history recall with another harmless message.
If the terminal opens a menu, copies text, or changes tabs, it consumed the shortcut before the application received it. Check that terminal's key mappings. If the application receives the key but performs the wrong action, inspect custom bindings and the active context. A confirmation dialog and the main prompt are different contexts, so success in one does not establish behavior in the other.
The official interactive-mode reference documents terminal-dependent multiline input. When Shift+Enter is unavailable, try Ctrl+J or the backslash followed by Enter method. Keep one fallback written down for remote sessions where you cannot change the terminal configuration.
Stopping an operation does not undo its effects
Treat an interruption as a change in execution, not a rollback. If an agent has already written a file, started a process, or called an external service, stopping the conversation does not automatically reverse that action. The useful follow-up is to inspect what completed and decide what should happen next.
For a code-editing task, review the diff after interrupting. Ask the agent to describe the files it changed and which checks ran. For a long command, inspect whether the process is still running before starting a replacement. Otherwise the second attempt can compete with the first or make the resulting logs harder to interpret.
An interruption also changes the context of your next prompt. "Continue" can be ambiguous after you have rejected part of a plan. State the intended correction explicitly: preserve the CSS changes, stop editing the database layer, and inspect the failing build before doing more work. Keyboard fluency is useful when paired with a clear next instruction.
Keep your first customization small
Back up the existing keybindings file before editing it. Change one nonessential action first, then confirm that the normal submit and interrupt behavior still works. A sweeping remap creates several possible causes when the next key behaves unexpectedly.
Use the action identifiers and contexts in the official keybinding reference. The configuration is an object containing binding blocks, and actions use names such as chat:submit and chat:newline. A short action name copied from another terminal application's configuration is not interchangeable.
If you share a customization with teammates, include the terminal and operating system you used, the purpose of the change, and the original binding. A teammate should be able to restore the default without reverse-engineering your entire configuration. Avoid making personal typing preferences a repository requirement when they do not affect the project's output.
Use history as a draft, then inspect it
History recall is convenient for repeated checks, but the old prompt may name a different file, branch, or destination. Read it before submitting. This matters especially when you reuse a request that included deployment, deletion, or publication instructions.
A better reusable prompt contains the stable intent and asks the agent to identify the current target. For example, "Inspect the current diff and explain the unresolved build error" is easier to reuse than a message naming a temporary branch from last week's incident. Store longer task instructions in a project document when they need review and versioning.
For file references, be deliberate about scope. Attaching a single relevant source file often gives a clearer answer than attaching an entire directory. When a response misses an important dependency, add that dependency and explain its relationship to the original file. More context helps only if it is the context the question actually needs.
A five-minute practice session
Create an ordinary prompt, add a second line without submitting, move to the start and end of a line, and correct one word. Recall a previous harmless message and edit its target before sending it. Open the command menu and inspect the commands your installation actually exposes.
Then ask a small explanatory question and interrupt the response. Check that the conversation remains usable, and ask a follow-up that states what you want changed. Finish by opening your custom configuration and identifying how to remove your trial binding. Those exercises teach recovery as well as speed, which is what makes a shortcut reference useful during real work.
