Aider's Architect Mode: Plan Before You Code
Use Aider's architect mode to separate planning from implementation. Get better results on complex refactoring by letting AI propose changes before making them.
The Problem
When you ask AI to make complex changes, it often rushes to implementation. The result: changes that technically work but miss the bigger picture, or worse, require multiple rounds of “no, I meant…” corrections.
The Solution
Aider’s architect mode separates planning from implementation:
aider --architect
In this mode, Aider first proposes changes as a plan, shows you what it intends to do, and only implements after you approve.
How It Works
Normal Mode
You: Refactor this service to use dependency injection
Aider: [immediately starts editing files]
Architect Mode
You: Refactor this service to use dependency injection
Aider (Architect): I'll refactor to use dependency injection. Here's my plan:
1. Create an interfaces/IUserService.ts file defining the contract
2. Extract UserRepository as a separate dependency
3. Modify UserService constructor to accept dependencies
4. Update the service factory to wire dependencies
5. Adjust tests to use mock dependencies
Files to modify:
- src/services/UserService.ts (major changes)
- src/interfaces/IUserService.ts (new file)
- src/repositories/UserRepository.ts (new file)
- src/factories/serviceFactory.ts (dependency wiring)
- tests/services/UserService.test.ts (mock setup)
Shall I proceed with this plan?
You: Yes, but skip the factory—we're using a DI container
Aider (Architect): Updated plan: [revised approach]...
Why This Matters
- Catch misunderstandings early: Review the plan before any code changes
- Iterate on approach: Refine the strategy without undoing work
- Learn AI’s reasoning: See how it breaks down problems
- Better results: Planning leads to more coherent implementations
Pro Tips
Combine with Specific File Addition
aider --architect src/services/*.ts src/tests/services/*.ts
Scope the architect’s attention to relevant files for better plans.
Use for Learning
Architect mode is great for learning codebases. Ask:
Explain how you would add rate limiting to this API
You get a detailed plan without any changes—pure documentation.
Review Mode
Use architect mode just for code review:
Review this service for potential improvements. Don't make changes, just propose.
When to Use
- Complex refactoring (multiple files, architectural changes)
- Unfamiliar codebases (learn before you change)
- High-stakes changes (production code, critical paths)
- Teaching (show your approach before implementing)
When Not to Use
- Quick fixes (single file, obvious change)
- Routine tasks (formatting, simple additions)
- Exploratory coding (when you want fast iteration)
Architect mode transforms AI from a eager junior dev into a thoughtful senior engineer. Use it.