Aider - AI Pair Programming Tool

repository·main·Indexed Apr 11, 2026

https://github.com/Aider-AI/aider

Aider is an AI pair programming tool that edits code by chatting with an LLM. It integrates with Git for automatic commits, supports multiple file edits, and works with ctags-based repository maps. The tool runs in the terminal or browser, supports 100+ programming languages, and connects to various LLMs including Claude 3.7 Sonnet, DeepSeek R1, OpenAI o1/o3-mini, GPT-4o, and AWS Bedrock models. Features include IDE integration (NeoVim, VS Code), voice-to-code, automatic linting, and a copy/paste workflow for web chat interfaces. Analytics are opt-in and anonymous.

Tokens
15.6K
Snippets
41
Records
95
Agent score
100%

What's inside Aider

  1. Understand and use Aider chat modes

    main

    Aider has four chat modes: code (makes changes), ask (discusses but doesn't edit), architect (uses two models for planning and editing), and help (answers questions about Aider). By default, Aider starts in "code" mode. You can switch modes using commands: /code, /ask, /architect, /help apply to just that message, while /chat-mode <mode> switches the active mode persistently. You can also launch Aider in a specific mode with --chat-mode <mode> or use --architect as a shortcut. The prompt indicates the active mode with prefixes like >, ask>, architect>.

    # Switch to ask mode for one message
    /ask What's the best way to implement this?
    
    # Switch to code mode for one message
    /code Add the function implementation
    
    # Make ask mode sticky for the session
    /chat-mode ask
    
    # Launch Aider in architect mode
    aider --architect

    Sources: aider/website/docs/usage/modes.md

  2. Understand Aider's analytics collection

    main

    Aider can collect anonymous analytics to help improve its ability to work with LLMs, edit code, and complete user requests. Analytics are opt-in only and never collect your code, chat messages, keys, or personal information. The data collected includes: which LLMs are used and token counts, which edit formats are used, how often features and commands are used, and information about exceptions and errors. Analytics are associated with an anonymous, randomly generated UUID4 user identifier.

    Sources: aider/website/docs/more/analytics.md

  3. Understand copy/paste mode Terms of Service compliance

    main

    Review the Terms of Service of any LLM web chat service before using these features. Don't use them in violation of any service's TOS.

    Most LLM web chat TOS prohibit automating steps (2) and (3) — copying from and pasting into the web chat. Aider's --copy-paste mode leaves these as manual steps. It only streamlines steps (1) and (4) that involve interactions with Aider itself, which are outside the scope of the LLM web chat TOS.

    If concerned about TOS compliance, manually use /copy-context and /paste commands instead of --copy-paste mode.

    Sources: aider/website/docs/usage/copypaste.md

  4. Enable or disable analytics for current session

    main

    Use the --[no-]analytics switch to control analytics for the current session. --analytics turns on analytics for the current session (but won't work if you've permanently disabled with --analytics-disable). --no-analytics turns off analytics for the current session. By default, if you don't specify either option, Aider may randomly select some users to prompt about opting in to analytics.

    Sources: aider/website/docs/more/analytics.md

  5. Aider Overview

    main

    Aider is an AI pair programming tool that runs in your terminal. It integrates with LLMs to help you start new projects or build on existing codebases. Key features include: codebase mapping for larger projects, Git integration with automatic commits, support for 100+ programming languages, IDE integration, voice-to-code capability, automatic linting and testing, and the ability to work with images and web pages. Aider works best with Claude 3.7 Sonnet, DeepSeek R1, OpenAI o1/o3-mini, and GPT-4o, but can connect to almost any LLM including local models.

    Sources: README.md

  6. Interrupt Aider with CONTROL-C

    main

    It is safe to use Control-C to interrupt Aider if it is not providing a useful response. The partial response remains in the conversation, allowing you to reference it when providing more information or direction to the LLM.

    Sources: aider/website/docs/usage/commands.md

  7. Use code formatters as linters

    main

    Many code formatters (like pre-commit, black, gofmt) return non-zero exit codes when they make changes, which can confuse Aider into thinking there are actual lint errors. To use formatters as linters, wrap them in a shell script that runs the formatter twice. The first run may reformat and exit non-zero; the second run will exit 0 unless there are real errors beyond formatting.

    #!/bin/bash
    # Run formatter twice to handle reformatting
    pre-commit run --files "$@" >/dev/null \
        || pre-commit run --files "$@"

    Sources: aider/website/docs/usage/lint-test.md

  8. Select and use a Bedrock model with Aider

    main

    Before using a model, enable it under the Model Access screen in AWS Management Console. Find the Model ID in the Model Catalog by selecting your desired model and looking for the modelId property under "Usage". To use Bedrock with Aider, run aider --model bedrock/<model-id>. Sometimes prefixing the model name with "us." helps (e.g., bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0). List available Bedrock models with aider --list-models bedrock/

    # Run Aider with a Bedrock model
    aider --model bedrock/anthropic.claude-3-5-sonnet-20240620-v1:0
    
    # Sometimes this format works better
    aider --model bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0
    
    # List available Bedrock models
    aider --list-models bedrock/

    Sources: aider/website/docs/llms/bedrock.md

  9. Enter multi-line chat messages

    main

    To enter multi-line messages in Aider, use the multiline mode feature. By default, pressing Enter sends the message and Meta+Enter creates a new line. You can toggle this behavior with /multiline-mode. Alternatively, use Ctrl+X Ctrl-E to open the current input in your external editor for multi-line composition.

    # Toggle multiline mode
    /multiline-mode
    
    # Or open in external editor
    Ctrl+X Ctrl-E

    Sources: aider/website/docs/usage/commands.md

  10. Install Aider with Docker

    main

    Aider is available as Docker images for easy installation without local dependencies. Two images are available:

    • paulgauthier/aider (core) - Smaller image with the essential Aider functionality. Optional features like Playwright and browser GUI can be installed on first use but won't persist between container launches.
    • paulgauthier/aider-full - Full image with all optional extras pre-installed, including interactive help, browser GUI, and Playwright support.

    To run Aider from Docker, use these commands from your git repository root:

    # Core version
    docker pull paulgauthier/aider
    docker run -it --user $(id -u):$(id -g) --volume $(pwd):/app paulgauthier/aider --openai-api-key $OPENAI_API_KEY [...other aider args...]
    
    # Full version
    docker pull paulgauthier/aider-full
    docker run -it --user $(id -u):$(id -g) --volume $(pwd):/app paulgauthier/aider-full --openai-api-key $OPENAI_API_KEY [...other aider args...]

    Prerequisites:

    • Run commands from your git repository root so the --volume flag maps your project into the container
    • Configure git user info before running (the container won't have your global git config):
      git config user.email "you@example.com"
      git config user.name "Your Name"

    Limitations:

    • The /run command executes inside the container, not your local environment — tests and commands won't have access to your local dependencies
    • The /voice command requires host audio device access; the container has libportaudio2 installed but you'll need to configure device mapping
    docker pull paulgauthier/aider
    docker run -it --user $(id -u):$(id -g) --volume $(pwd):/app paulgauthier/aider --openai-api-key $OPENAI_API_KEY

    Sources: aider/website/docs/install/docker.md