GitHub Copilot + Claude via Aider
Aider configuration that routes Claude 3.7 Sonnet (with extended thinking) through GitHub Copilot's API, optimized for diff-based editing with vim integration.
What This Does
This configuration sets up Aider to use:
**Main model**: Claude 3.7 Sonnet with extended thinking via GitHub Copilot API**Weak model**: Claude 3.5 Sonnet for simpler tasks**Edit format**: Diff-based editing for both regular and editor modes**UI preferences**: Dark mode with GitHub Dark code theme**Workflow**: Vim keybindings, auto-attribute commits, no auto-commits**Performance**: 2048 map tokens, model warnings disabledInstructions
Prerequisites
1. You must have an active GitHub Copilot subscription
2. GitHub Copilot must support Claude model routing
3. Aider must be installed in your environment
Configuration
Create or update your `.aider.conf.yml` file in your home directory or project root with:
```yaml
model: openai/claude-3.7-sonnet-thought
openai-api-base: https://api.githubcopilot.com
edit-format: diff
weak-model: openai/claude-3.5-sonnet
editor-edit-format: diff
show-model-warnings: false
map-tokens: 2048
dark-mode: true
code-theme: github-dark
auto-commits: false
dirty-commits: false
attribute-author: true
vim: true
yes-always: true
editor: nvim
```
Key Settings Explained
**model**: Uses Claude 3.7 Sonnet with extended thinking capability (note: availability depends on GitHub Copilot API support)**openai-api-base**: Routes requests through GitHub Copilot's API endpoint**edit-format**: `diff` mode generates minimal, focused changes**weak-model**: Falls back to Claude 3.5 Sonnet for simpler operations to save costs**editor-edit-format**: Uses diff format even in editor mode**show-model-warnings**: Disabled to reduce noise**map-tokens**: 2048 tokens for repository map context**auto-commits**: Disabled - you manually control when to commit**dirty-commits**: Disabled - won't commit with uncommitted changes**attribute-author**: Attributes AI-generated commits to Aider**vim**: Enables vim keybindings**yes-always**: Auto-confirms prompts for smoother workflow**editor**: Uses `nvim` for file editingUsage
Once configured, launch Aider in any project:
```bash
aider
```
Aider will automatically:
1. Connect to GitHub Copilot API
2. Use Claude 3.7 Sonnet for main reasoning
3. Fall back to Claude 3.5 Sonnet for simpler tasks
4. Generate diff-based edits
5. Respect your vim workflow preferences
When to Use This
You have GitHub Copilot access and want to use Claude modelsYou prefer diff-based editing over full file rewritesYou use vim/nvim and want consistent keybindingsYou want manual control over commitsYou want to attribute AI contributions in git historyNotes
Check GitHub Copilot's current model availability - `claude-3.7-sonnet-thought` may be preview/experimentalIf the thought model is unavailable, fall back to `openai/claude-3.5-sonnet`The `openai/` prefix is required when routing through GitHub Copilot APIAdjust `map-tokens` based on your repository size (larger repos may benefit from more tokens)