explainx / blog
Claude Code Keyboard Shortcuts: The Complete Reference (2026)
A complete, bookmark-worthy reference for every Claude Code keyboard shortcut, slash command, @ reference, and keybinding customization option. Updated for 2026.
explainx / blog
A complete, bookmark-worthy reference for every Claude Code keyboard shortcut, slash command, @ reference, and keybinding customization option. Updated for 2026.

Jun 24, 2026
Claude Code automatically appends a "Co-Authored-By: Claude Opus <[email protected]>" trailer to every git commit it creates. The debate is live on X: some engineers call it dishonest to remove it, others call it inappropriate to credit a tool. Here is where it comes from, why other AI coding tools do the same thing, and the exact steps to turn it off — including a one-line settings.json fix and a Claude Code skill that prevents it permanently.
Jun 22, 2026
CLAUDE.md loads at session start and stays forever. Skills load only when invoked. Hooks run deterministically outside the context window. Subagents return only a summary to the main thread. Anthropic's new guide maps all seven instruction methods — here is the practical breakdown with decision rules for each.
Jun 12, 2026
Claude Sonnet 4.6 has a 1 million token context window, but long sessions fill it faster than you expect. Learn what triggers the limit, how automatic compaction works, and the exact commands (/clear, /compact, --fork-session) to manage context like a pro.
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.
These shortcuts work in the Claude Code prompt box at all times.
| 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 | Clear the current input without submitting |
Ctrl+L | Clear the terminal display (conversation history is preserved) |
When Claude is actively running a tool call or generating a response, these signals control how it stops.
| Action | Effect |
|---|---|
Ctrl+C (once) | Sends interrupt signal; Claude finishes the current tool call, then stops |
Ctrl+C (twice, quickly) | Force-stops immediately, mid-tool-call |
| Any key during tool execution | Claude Code may prompt you to confirm the interrupt |
Use a single Ctrl+C when you want a clean stop. Double-tap when you need it to halt right now.
| 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 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 |
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 |
@url | Fetch a URL and include its content in the prompt |
@ (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.
! Shell PrefixPrefix 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.
Claude Code stores custom keybindings in ~/.claude/keybindings.json. Edit it directly or run /keybindings from the prompt.
| Command | Default key | Description |
|---|---|---|
submit | Enter | Submit the current message |
newline | Shift+Enter | Insert a newline |
interrupt | Ctrl+C | Interrupt Claude |
history-previous | Up Arrow | Previous history item |
history-next | Down Arrow | Next history item |
clear-input | Escape | Clear the input box |
To make Ctrl+Enter submit (and Enter insert a newline), set ~/.claude/keybindings.json to:
[
{
"key": "ctrl+enter",
"command": "submit"
},
{
"key": "enter",
"command": "newline"
}
]
This is a popular configuration for developers who frequently write multi-line prompts and want Enter to behave like a normal text editor.
| 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.
| 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 |
| Force stop | Ctrl+C twice | Immediate halt |
| Clear display | Ctrl+L | Clear terminal (not history) |
| Clear input | Escape | Wipe the prompt box |
| Shell command | ! <command> | Run shell inline |
| Attach file | @filename | Add file context |
| Fetch URL | @url | Add URL content |
| 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.