Skip to content

Instantly share code, notes, and snippets.

@RobertKielty
Created September 19, 2026 12:29
Show Gist options
  • Select an option

  • Save RobertKielty/bd755e2254d0e108f5f3214cb2192bcf to your computer and use it in GitHub Desktop.

Select an option

Save RobertKielty/bd755e2254d0e108f5f3214cb2192bcf to your computer and use it in GitHub Desktop.
Doom Emacs agent-shell shortcuts

Doom Emacs agent-shell shortcuts

This list is for my Doom config, which installs agent-shell, acp, and shell-maker without custom agent-shell bindings. The keys below are the package's defaults. C- means Ctrl, M- means Alt/Meta, and S- means Shift. Use M-x for commands without a default shortcut.

Start and compose

Action Shortcut or command
Start or reuse an agent session M-x agent-shell
Force a new session SPC u M-x agent-shell (Doom's universal argument)
Start a Codex session directly M-x agent-shell-openai-start-codex
Submit a prompt at the shell prompt RET
Insert a newline in the shell prompt S-RET
Compose in a separate viewport buffer M-x agent-shell-prompt-compose
Switch between shell and viewport C-c C-o
Interrupt an active request in the shell C-c C-c

Navigate the shell transcript

Action Shortcut or command
Move to next interactive item TAB
Move to previous interactive item S-TAB
Move up from the current item C-M-u
Recall previous prompt M-p or C-<up>
Recall next prompt M-n or C-<down>
Search prompt history M-r
Copy the last agent output M-x agent-shell-copy-last-output

Change session settings

These options appear only when the active agent supports them.

Action Shortcut
Select model C-c C-v
Select session mode C-c C-m
Cycle session mode C-<tab>
Set thought level / reasoning effort C-c C-t
Select another session option C-c C-s

In the viewport

C-c C-c has a different meaning in viewport edit mode: it sends or queues the composed prompt. In viewport view mode, it interrupts the agent.

Action Shortcut
Send or queue prompt from viewport edit mode C-c C-c
Send or queue, keeping the compose buffer open C-u C-c C-c
Peek at latest interaction without losing draft C-c C-p
Cancel draft C-c C-k
Show edit-mode help C-c C-h
Reply from view mode r
Quote response in a reply R
Previous / next interaction b / f
Previous / next item p / n or S-TAB / TAB
Select model / mode / thought level v / s / t
Return to shell o or C-c C-o
Show view-mode help ?
Bury viewport q

More useful commands without default shortcuts

Action Command
Queue a prompt for after the current turn M-x agent-shell-prompt-queue
Steer a running turn, if the agent supports it M-x agent-shell-prompt-steer
Send selected text or an error at point M-x agent-shell-send-dwim
Insert a file as context M-x agent-shell-send-file
Switch among agent-shell buffers M-x agent-shell-switch-buffer
Resume an existing session M-x agent-shell-resume-session
Show session usage M-x agent-shell-show-usage

In Doom's Evil states, some single-letter keys can be intercepted by Evil. If a key behaves differently, check it in the relevant buffer with SPC h k followed by the key. The C-c bindings and M-x commands above are the most reliable starting points.

Source: agent-shell upstream README.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment