Codex CLI keyboard shortcuts
Codex CLI gives you a small TUI around a running coding task. The useful keys are the ones that steer the current turn, queue the next instruction, move through prompt history, and change reasoning effort.
Begin with the controls around the current turn. Once stopping, resuming, and editing feel familiar, the session and reasoning controls become much easier to use without breaking your train of thought.
Steering a running task
Enter injects instructions into the current turn while Tab queues work for the next turn instead of interrupting.
| Action | Windows | macOS | Linux |
|---|---|---|---|
| Send the message, or inject into the running turn | Enter | Enter | Enter |
| Queue a follow-up for the next turn | Tab | Tab | Tab |
| Interrupt the running task | Esc | Esc | Esc |
| Edit your previous messageKeep pressing to walk back through the transcript. The composer must be empty. | EscEsc | EscEsc | EscEsc |
Session control
Stop, resume, exit, or change the current Codex session without abandoning the terminal.
| Action | Windows | macOS | Linux |
|---|---|---|---|
| Cancel the current operationPress twice to quit the session. | CtrlC | CtrlC | CtrlC |
| Exit CodexPress twice to force quit. | CtrlD | CtrlD | CtrlD |
| Clear the terminal UI, keeping the conversation | CtrlL | CtrlL | CtrlL |
| Toggle the shortcut overlay | ? | ? | ? |
Input and history
Edit the prompt in progress and move through the instructions you have already entered.
| Action | Windows | macOS | Linux |
|---|---|---|---|
| Open the current draft in an external editorUses VISUAL, falling back to EDITOR. | CtrlG | CtrlG | CtrlG |
| Copy the last agent response to the clipboard | CtrlO | CtrlO | CtrlO |
| Reverse search command history | CtrlR | CtrlR | CtrlR |
| Next match in reverse search | CtrlS | CtrlS | CtrlS |
| Navigate draft historyDown moves forward. | Up | Up | Up |
| Fuzzy search files to attach to the conversation | @ | @ | @ |
| Run the line as a shell command | ! | ! | ! |
Reasoning effort
Change how much reasoning Codex spends on the current task before you send the next instruction.
| Action | Windows | macOS | Linux |
|---|---|---|---|
| Increase reasoning effort | ShiftUp | ShiftUp | ShiftUp |
| Decrease reasoning effort | ShiftDown | ShiftDown | ShiftDown |
| Edit the most recently queued message | ShiftLeft | ShiftLeft | ShiftLeft |
Make the useful keys stick
A coding agent should remain steerable. Learn the keys that stop or reshape a turn before you worry about the rest, because confidence comes from knowing you can change course.
You do not need this whole page in your head. Pick two shortcuts that remove a repeated hand movement, use them until they feel ordinary, and come back for the next pair.