AI Coding CLI Keyboard Shortcuts Compared
Terminal AI coding agents have gone from a curiosity to a daily tool in barely a year. Instead of a chat box in a browser, these run directly in your terminal: you point them at a project, type a request, and they read files, write code, and run commands. The five biggest — Claude Code (Anthropic), Gemini CLI (Google), Codex CLI (OpenAI), Grok Build (xAI), and Aider (open source) — all share a common shape, which means most of what you learn in one carries over to the next.
This guide puts their keyboard shortcuts and slash commands side by side: what is identical, what looks identical but behaves differently, and what is unique to each. For a complete reference, every tool has its own page linked at the bottom.
The shared DNA of terminal AI agents
All five are text user interfaces (TUIs) built on the same decades-old terminal conventions, so the fundamentals are remarkably consistent. Across every tool: you submit with Enter, you reach commands by typing /, and the classic readline editing keys (Ctrl + A for start of line, Ctrl + R to search history) mostly work. The differences are smaller than the similarities — but a few of them will trip you up if you switch tools, especially the meaning of Shift + Tab.
Core actions compared
The actions you reach for in every session. Note the two genuine divergences: how you insert a newline without sending, and how you interrupt a running task.
| Action | Claude Code | Gemini CLI | Codex CLI | Grok Build | Aider |
|---|---|---|---|---|---|
| Start in current project | claude |
gemini |
codex |
grok |
aider |
| Submit message | Enter | Enter | Enter | Enter | Enter |
| New line (no send) | Shift + Enter | Ctrl + J | Ctrl + J | /multiline |
Alt + Enter |
| Interrupt running task | Ctrl + C | Ctrl + C | Esc | — | Ctrl + C |
| Clear the screen | Ctrl + L | Ctrl + L | Ctrl + L | — | — |
| Exit | Ctrl + D / /exit |
Ctrl + D / /quit |
Ctrl + C / /quit |
/quit |
/exit |
A dash (—) means the tool does not document a single-key shortcut for that action — use the equivalent slash command, or your terminal's default. On Mac, Aider's new-line is Meta + Enter.
The Shift+Tab trap: modes work differently
This is the single most confusing difference between these tools. Three of them use Shift + Tab to switch modes — but the modes themselves are different, and the other two do not use the key at all. If you switch tools and muscle-memory Shift + Tab, you will not get what you expect.
| Tool | Shift + Tab does… | Modes available |
|---|---|---|
| Claude Code | Toggles plan mode on and off | Normal ↔ Plan (read-only planning) |
| Gemini CLI | Cycles approval modes | Default → Auto-Edit → Plan |
| Grok Build | Cycles session modes | Code → Plan → Ask |
| Codex CLI | Nothing — use a command | /plan, /permissions |
| Aider | Nothing — use a command | /code, /ask, /architect |
The throughline: every tool has a way to switch between "just plan / answer, don't touch my files" and "go ahead and make changes." Claude Code, Gemini CLI, and Grok Build expose it on Shift + Tab; Codex CLI and Aider expose it as slash commands.
Slash commands compared
Typing / opens a command menu in all five. The vocabulary overlaps heavily, but the exact names drift — especially for compacting context and for project memory files.
| What you want | Claude Code | Gemini CLI | Codex CLI | Grok Build | Aider |
|---|---|---|---|---|---|
| Show help | /help |
/help |
/help |
/help |
/help |
| Switch model | /model |
/model |
/model |
/model |
/model |
| New / clear conversation | /clear |
/clear |
/new |
/new |
/clear |
| Compact context to save tokens | /compact |
/compress |
/compact |
/compact |
— |
| Resume a past session | /resume |
/resume |
/resume |
/resume |
/load |
| Generate a project memory file | /init |
/init |
/init |
— | — |
| Manage long-term memory | /memory |
/memory |
— | /memory |
— |
| Manage MCP servers | /mcp |
/mcp |
/mcp |
/mcps |
— |
| Review code / diff | /review |
— | /review |
— | /diff |
Note the memory-file naming: Claude Code writes a CLAUDE.md, Gemini CLI a GEMINI.md, and Codex CLI an AGENTS.md — same idea, three filenames.
Line editing: the readline keys
Because these are terminal apps, they inherit the standard Emacs-style line-editing keys. Claude Code and Gemini CLI document the fullest set; Codex CLI and Aider document a subset and otherwise fall back to your terminal's defaults.
| Action | Claude Code | Gemini CLI | Codex CLI | Aider |
|---|---|---|---|---|
| Start of line | Ctrl + A | Ctrl + A | Ctrl + A | — |
| End of line | Ctrl + E | Ctrl + E | Ctrl + E | — |
| Delete previous word | Ctrl + W | Ctrl + W | — | — |
| Delete to end of line | Ctrl + K | Ctrl + K | — | — |
| Search history | Ctrl + R | Ctrl + R | Ctrl + R | Ctrl + R |
| Open in external editor | Ctrl + X Ctrl + E | Ctrl + G | Ctrl + G | Ctrl + X Ctrl + E |
Referencing files and running shell commands
Two patterns recur: an @ prefix to pull a file into context, and a ! prefix to run a shell command. Claude Code, Gemini CLI, and Codex CLI all use @file; Aider uses an explicit /add command instead.
| Action | Claude Code | Gemini CLI | Codex CLI | Aider |
|---|---|---|---|---|
| Add a file to context | @path |
@path |
@ (fuzzy) |
/add |
| Run a shell command | !command |
!command |
!command |
/run (alias !) |
| Add a note to memory | #note |
/memory |
— | — |
What makes each one different
Beyond the shared basics, each tool has a few signature shortcuts worth knowing.
- Claude Code — the richest inline syntax:
@fileto reference,!bashto run a command, and#noteto drop a line into memory, all without leaving the prompt. Shift + Tab toggles plan mode. - Gemini CLI — the most complete documented keymap (it is autogenerated from source). Standouts: Ctrl + Y for YOLO mode (auto-approve everything), Ctrl + T to toggle the TODO list, and a built-in
/vimmode. - Codex CLI — interrupts with Esc, not Ctrl + C (the one to remember). It also lets you tune reasoning effort live with Shift + Up / Down, and remap keys with
/keymap. - Grok Build — the most multimedia:
/imaginegenerates an image and/imagine-videoa video, right from the agent./btwasks a side question without derailing the task. xAI publishes no full keybinding table, so its documented keys are limited to Shift + Tab and Enter. - Aider — the most git-native:
/commit,/undo(reverts Aider's last commit), and/diffare first-class. It also has explicit chat modes (/code,/ask,/architect) and can pull a web page into context with/web.
Which shortcuts should you actually learn?
If you bounce between these tools, four habits cover almost everything: submit with Enter, type / to find any command, search history with Ctrl + R, and check how each tool handles modes before you trust Shift + Tab. The rest you can look up — each tool's full reference is below.