⌥+⌃AltPlusCtrl

Aider Keyboard Shortcuts

Aider runs in a terminal, so almost everything it offers is a slash command typed into the prompt rather than a key combination. The handful of genuine key bindings are concentrated on one problem — getting multi-line text into a single-line-oriented input — and that is where most new users get stuck first. What distinguishes Aider from other terminal coding assistants is its relationship with git. It commits after each change it makes, automatically, with a generated message. That sounds alarming until you see the consequence: every edit is a discrete revision, `/undo` reverses the last one cleanly, and reviewing what the tool did is an ordinary `git log` rather than an archaeology exercise. Several commands below only make sense in that light. `/undo` is not an editor undo, it reverses a commit. `/diff` shows what changed since your previous message rather than since you last saved. The git integration is the design, not a feature bolted on. The other concept worth understanding before the command list is the chat context. Aider only edits files you have explicitly added with `/add`, and it only reads those files in full. Everything else in the repository it knows about through a condensed map rather than the contents. This is a deliberate constraint that keeps the context window manageable on a large codebase, and it means `/add` and `/drop` are not housekeeping — they are how you tell the tool what the task is about. A vague result is more often a context problem than a prompting one. Modes are the third piece. `/code` makes changes, `/ask` answers questions without touching anything, and `/architect` plans an approach and then hands the implementation to a second model. Each can be used as a one-off by typing it with a prompt, or as a session state by typing it alone. Using `/ask` when you want to understand something, rather than asking in code mode and then reverting the edits it made, is the habit that saves the most friction.

Input Editing

ActionWindowsMacDescription
Add a line without sendingAlt+EnterOption+Enter (or Esc then Enter)Inserts a newline instead of submitting the message. On terminals that swallow the combination, pressing Escape and then Enter sends the same sequence, which is the reliable fallback.
Swap Enter and Alt+Enter/multiline-mode/multiline-modeInverts the two, so plain Enter adds a newline and Alt+Enter sends. Worth switching on for a session of long structured prompts, where the default ordering means every paragraph break is a modifier away.
Wrap a multi-line message in braces{ on its own line, } to close{ on its own line, } to closeEverything between an opening brace alone on a line and a closing brace alone on a line is one message. The route that works regardless of what your terminal does with modified Enter keys.
Compose in your external editor/editor (or Ctrl+X Ctrl+E)/editor (or Ctrl+X Ctrl+E)Opens your configured editor, and what you save becomes the message. The Ctrl+X Ctrl+E binding is the readline convention shells use for the same job, so it is already in the fingers of most terminal users.
Recall previous messagesCtrl+Up / Ctrl+DownCtrl+Up / Ctrl+DownSteps back and forward through messages you sent earlier, restoring them for editing and resending. Distinct from the shell's own history, which is not what you are navigating inside an Aider session.
Interrupt or exitCtrl+C / Ctrl+DCtrl+C / Ctrl+DCtrl+C stops the current response and returns to the prompt; Ctrl+D ends the session. Because Aider commits as it works, interrupting mid-edit leaves the repository in whatever state the last completed commit reached.

Context Files

ActionWindowsMacDescription
Add a file to the chat/add <path>/add <path>Puts a file in the editable set, which is the only set Aider will change. Accepts globs, so a whole directory of related files can be added at once — though restraint pays, since everything added consumes context.
Remove a file from the chat/drop <path>/drop <path>Takes a file back out of the editable set and frees the context it occupied. Used with no argument it drops everything, which is the reset when a session has accumulated files from an earlier task.
Add a file as reference only/read-only <path>/read-only <path>Makes a file visible to the model without permitting edits to it. The right choice for a specification, a schema, or an example you want followed rather than modified.
Run a shell command/run <command> (or !command)/run <command> (or !command)Executes a command and offers to add its output to the chat. The standard loop for test-driven work — run the tests, add the failures, let Aider fix them, repeat.
Show token usage/tokens/tokensReports how much of the context window each file and the conversation are consuming. The command to run when answers start losing precision, since context pressure degrades quality gradually rather than announcing itself.

Modes Git

ActionWindowsMacDescription
Code mode/code [prompt]/code [prompt]The default mode, in which Aider edits the files in the chat and commits the result. With a prompt it acts once; alone it switches the session's mode until changed.
Ask mode/ask [prompt]/ask [prompt]Answers questions about the code without changing anything. The mode to use for understanding an unfamiliar codebase — asking in code mode and reverting the edits afterwards is the common and avoidable mistake.
Architect mode/architect [prompt]/architect [prompt]Plans an approach with one model, then hands the implementation to a second. Useful on changes large enough that the reasoning and the editing benefit from different models — at roughly double the cost per turn.
Undo the last Aider commit/undo/undoReverses the commit Aider just made, restoring the previous state. This is a git operation rather than an editor undo, and it refuses to touch commits Aider did not create.
Show what changed/diff/diffDisplays the diff since your previous message, which is the unit that matters when reviewing an agent's work. Worth running after every substantive turn rather than trusting the summary.
Run a git command/git <args>/git <args>Runs git directly without leaving the session. Convenient given how much of working with Aider is reviewing, amending and occasionally reverting the commits it produced.
List commands/help/helpLists the slash commands your installed version supports. The authoritative reference, and worth checking after an upgrade — Aider releases frequently and commands have been added and renamed.

Frequently Asked Questions

How do I write a multi-line message in Aider?

Alt+Enter inserts a newline without sending — Option+Enter on macOS, or Escape followed by Enter in terminals that do not pass the modified combination through. Two alternatives avoid the terminal question entirely: put a brace alone on the first line and a closing brace alone on the last, and everything between is one message; or run /multiline-mode to swap the keys so plain Enter adds a newline and Alt+Enter sends. For anything genuinely long, /editor or Ctrl+X Ctrl+E hands the message to your real editor.

Does Aider really commit to git automatically?

Yes, after each change it makes, with a generated message. It is the design rather than an accident, and it is what makes the tool safe to use: every edit is a discrete revision, /undo reverses the last one cleanly, and reviewing the work is an ordinary git log. If you would rather it did not, --no-auto-commits disables the behaviour — at the cost of losing the granular history that makes selective reversal possible. Most people who dislike it initially come round once they have needed /undo.

Why does Aider not know about a file in my repository?

Because it only reads the files you have added to the chat with /add. Everything else it knows through a condensed repository map — names and signatures rather than contents. That is deliberate, since reading an entire codebase would exhaust the context window on anything non-trivial, but it does mean a vague or wrong answer is more often a context problem than a prompting one. Adding the relevant files is usually a better fix than rewording the request.

What is the difference between /code, /ask and /architect?

/code edits files and commits, and is the default. /ask answers questions without touching anything, which is what you want for understanding unfamiliar code — asking in code mode and then reverting the edits it made is a common and avoidable annoyance. /architect uses one model to plan and a second to implement, which helps on changes large enough that reasoning and editing benefit from different models, at roughly double the cost per turn. Each works as a one-off with a prompt or as a session mode on its own.

How do I undo something Aider did?

/undo reverses the commit it just made. Because this is a git operation rather than an editor undo, it restores the exact previous state of every file in that commit, and it deliberately refuses to touch commits Aider did not create — so your own work is never at risk from it. For something several commits back, /git gives you the full range of git commands without leaving the session.

Can I use Aider on a repository that is not in git?

It will run, but you lose most of the safety. Without git there are no automatic commits, /undo has nothing to reverse, and /diff cannot show what changed. Since the git integration is what makes an agent editing your files a reversible proposition rather than a leap of faith, running without it is not recommended. On an existing project without version control, `git init` and an initial commit before starting is a minute's work and changes the risk profile entirely.

How do I get Aider to fix failing tests?

/run followed by your test command executes it and offers to add the output to the chat. From there the loop is: add the failure, let Aider work, run the tests again. That cycle is what /run exists for, and it is considerably more reliable than describing the failure in prose, because the model gets the actual error text, file paths and line numbers rather than your summary of them. The ! prefix is a shorthand for the same command.

Which model does Aider use, and can I change it?

Aider works with a range of providers and models, selected with the --model flag at launch or through configuration, and architect mode can pair two different models for planning and editing. Because the tool is model-agnostic, the quality you get varies considerably with what you point it at, and its documentation publishes benchmark results comparing them. That is worth consulting before concluding the tool is not working well — the same session with a different model can behave quite differently.