Aider Mastery
Architecture
Open-source, CLI-based AI pair programmer with deep git integration. Terminal-native, works with any LLM.
Git-first: Every AI change auto-committed with descriptive messages. Full undo via git revert.
Repo Map: tree-sitter parses source → NetworkX graph models relationships → PageRank ranks relevance → binary search fits token budget.
Chat Modes
| Mode | Command | Purpose |
|---|---|---|
| Code | /code |
Direct code editing (default) |
| Architect | /architect |
Two-model: architect proposes, editor implements |
| Ask | /ask |
Q&A without editing |
| Help | /help |
Aider usage help |
Architect Mode
Best for complex refactoring:
- Architect model (o1-preview, Claude Sonnet) proposes solution
- Editor model (DeepSeek, o1-mini) converts to file edits
- o1-preview + DeepSeek achieved 85% on SWE-bench
Configuration
.aider.conf.yml
model: claude-3-5-sonnet-20241022
architect: true
editor-model: deepseek-chat
editor-edit-format: diff
map-tokens: 1024
map-refresh: auto
auto-commits: true
dirty-commits: true
attribute-author: true
auto-lint: true
lint-cmd: "eslint --fix"
auto-test: false
test-cmd: "npm test"
read:
- CONVENTIONS.md
- docs/architecture.md
stream: true
pretty: true
CONVENTIONS.md
## Style
- Use 2-space indentation
- Prefer const over let
- Use async/await over .then()
## Architecture
- Services in src/services/
- One class per file
- All public methods must have JSDoc
## Testing
- Co-locate tests: foo.test.ts next to foo.ts
- Use vitest for unit tests
- Minimum 80% coverage for new code
Load: aider --read CONVENTIONS.md or in .aider.conf.yml.
Model Settings (.aider.model.settings.yml)
- name: deepseek/deepseek-chat
edit_format: diff
use_repo_map: true
weak_model_name: deepseek/deepseek-chat
extra_params:
max_tokens: 8192
Key Features
| Feature | Description |
|---|---|
| Watch mode | Monitors files, responds to AI comments in any IDE |
| Lint-and-fix | Auto-runs linter, sends errors back for correction |
| Auto-test | Runs tests after changes, feeds failures back |
/add, /drop |
Manage files in chat context |
/diff, /undo |
Review and revert changes |
Best Practices
- Use architect mode for complex refactoring
- Keep
CONVENTIONS.mdcommitted for team sharing - Enable
auto-lint+auto-testfor self-correcting workflows - Use
--map-tokensto control repo map context size /addrelevant files;/readfor reference-only files- Watch mode lets you work in preferred IDE while Aider handles AI