Skip to content
Back to AI Coding

Aider Terminal Pair Programming

Git-native AI pair programmer that edits files and commits with you in the terminal.

AI Coding ToolsIntermediate

Why

Stack Overflow's 2024 survey found 62% of developers currently use AI tools (up from 44% in 2023), with 82% of them using AI to write code. Aider is a CLI tool that edits files in your repo and auto-commits each change with a conventional message.

It supports many models via LiteLLM and tracks a per-file token budget, making it ideal for developers who live in the terminal and want AI changes as real git history.

When

Use Aider when you want AI commits in your git log, when you prefer the terminal, or when you need to swap models per task (cheap model for boilerplate, strong model for hard logic). Avoid adopting a new AI tool mid-sprint — evaluate it in a spike first to avoid disrupting in-flight work.

How

1. Install: pip install aider-chat 2. Set model: export OPENAI_API_KEY=... ; run "aider --model gpt-4o" 3. In the REPL: "/add src/api.ts" then "add input validation with zod" 4. Aider edits the file, runs any tests you named, and commits with a message. 5. "/undo" reverts the last AI commit. "/diff" shows pending changes. 6. Use .aider.conf.yml for persistent settings (model, auto-commits, edit format).

Example

$ aider --model claude-3-5-sonnet > /add src/auth/login.ts > refactor login to use the new session store; keep the response shape; commit Aider edits src/auth/login.ts, runs: git commit -m "refactor(auth): use new session store" > /undo # revert if the diff is wrong

Common Problems

  • ⚠Error: Cannot find module 'xxx' → run `npm install xxx` and restart the editor/extension host.
  • ⚠Error: "Extension not activated" / greyed-out AI features → check the API key setting and network; run the extension's "Check Connection" command.
  • ⚠Error: Rate limit 429 → upgrade plan or reduce request frequency; check the tool's usage dashboard for quota.

Best Practices

  • ✓Add only the files relevant to the task with /add to scope context and edits.
  • ✓Use a strong model for logic and a cheap model for docs/tests to control cost.
  • ✓Measure the outcome with a concrete metric (time saved, defect rate, test coverage) so the practice can be justified and improved.

FAQ

What is Aider Terminal Pair Programming?

Git-native AI pair programmer that edits files and commits with you in the terminal. It helps developers quickly grasp the core value and use cases of Aider Terminal Pair Programming.

How do I get started with Aider Terminal Pair Programming?

To get started with Aider Terminal Pair Programming, focus on these points first: Install: pip install aider-chat

What are common mistakes with Aider Terminal Pair Programming?

Common mistakes when using Aider Terminal Pair Programming include: Error: Cannot find module 'xxx' → run `npm install xxx` and restart the editor/extension host.; Error: "Extension not activated" / greyed-out AI features → check the API key setting and network; run the extension's "Check Connection" command.; Error: Rate limit 429 → upgrade plan or reduce request frequency; check the tool's usage dashboard for quota..

What are the best practices for Aider Terminal Pair Programming?

Best practices for Aider Terminal Pair Programming include: Add only the files relevant to the task with /add to scope context and edits.; Use a strong model for logic and a cheap model for docs/tests to control cost.; Measure the outcome with a concrete metric (time saved, defect rate, test coverage) so the practice can be justified and improved..

How do I learn more about Aider Terminal Pair Programming?

Start with the official docs, then search real-world examples on GitHub. Validate patterns in a small scratch repo before applying them to production code.