headroom.walls.sh · keyboard
Claude Code keyboard shortcuts
Every key that changes Claude Code's behavior — interrupting, navigating, referencing files, and running shell commands inline.
The most important keys
| Key | What it does |
|---|---|
| Escape | Interrupt the current Claude Code response mid-generation. Claude Code stops and shows what it had so far. Use this when it's going in the wrong direction — faster than waiting for it to finish. |
| Ctrl+C | Cancel the current operation immediately — stops generation, aborts tool use, exits any confirmation prompt. Also exits Claude Code when pressed on an empty input line. |
| Ctrl+D | Exit Claude Code cleanly (same as typing /quit). |
| Tab | Autocomplete file paths and directory names after @. Type @src/ then Tab to browse. |
| ↑ / ↓ | Navigate your prompt history within the session. Up goes to previous prompts; Down returns toward the current empty input. |
Special input prefixes
These aren't keyboard shortcuts per se, but they change how Claude Code interprets your input:
| Prefix | What it does |
|---|---|
| / | Slash command — /help, /clear, /compact, /model, /memory. See the full command list. |
| @ | Reference a file or directory — adds its contents to context. @README.md, @src/. Tab-completes paths. |
| ! | Run a shell command directly without sending it to Claude Code. ! git log --oneline -5 outputs to your terminal; Claude Code doesn't see it. Useful for quick lookups mid-session. |
| # | Add a file or note to the conversation memory for the session (depends on version — check /help for availability). |
Line editing shortcuts
Claude Code uses standard readline-style line editing at the prompt:
| Key | What it does |
|---|---|
| Ctrl+A | Jump to the beginning of the line |
| Ctrl+E | Jump to the end of the line |
| Ctrl+K | Delete everything from cursor to end of line |
| Ctrl+U | Delete everything from cursor to beginning of line |
| Ctrl+W | Delete the previous word |
| Ctrl+R | Reverse search through prompt history (type to filter) |
| Alt+← / Alt+→ | Move cursor one word left / right |
| Ctrl+L | Clear the terminal screen (keeps session context) |
Multi-line input
For long prompts — a detailed spec, a block of code to paste, a multi-paragraph question — Claude Code supports multi-line input:
| Key | What it does |
|---|---|
| Shift+Return | Insert a newline without submitting — continue writing on the next line |
| Return | Submit the prompt (even if it spans multiple lines) |
This is useful when you want to paste a code block or write a structured prompt with numbered steps before Claude Code starts working.
During tool use
When Claude Code is executing a tool (running a bash command, reading files, editing code), the interaction model changes slightly:
| Key | What it does |
|---|---|
| Escape | Request Claude Code to stop after the current tool call completes. It won't interrupt mid-file-write but will pause before starting the next action. |
| Ctrl+C | Hard-interrupt the current operation. If Claude Code is running a bash command, this sends SIGINT to the subprocess. |
VS Code extension shortcuts
If you use Claude Code through the VS Code extension, additional keybindings are available. Open the Keyboard Shortcuts editor (Cmd+K Cmd+S) and search for "Claude" to see and customize them. The extension adds bindings for opening the Claude Code panel, inserting the selected code into context, and accepting suggestions.
Tips for faster sessions
Escape early and often — the moment a response looks wrong, hit Escape and redirect. Waiting for a 50-tool-call sequence to finish before correcting is the main source of wasted quota.
Use ! git diff or ! cat file.txt with the ! prefix when you need to quickly check something yourself without burning a Claude Code turn.
The Up arrow restores your last prompt for editing — useful when you want to repeat a task with a small variation.
Every Claude Code session runs against a 5-hour token budget. Knowing when to hit Escape and redirect (rather than letting a wrong path run to completion) is one of the best ways to stretch it. Headroom shows that budget as a live % in your menu bar so you always know where you stand.
brew install patwalls/tap/headroom
→ Slash commands reference
→ Claude Code tips and tricks
→ /compact and context management
→ Session (5h) window explained