Aider + Promptster: Model-Aware AI Coding From the Terminal
By Promptster Team · 2026-05-07
If Cursor, Claude Code, and Windsurf are the IDE-native AI coding tools, Aider is the terminal-native one. It's open source, model-agnostic, and lives in a tmux pane instead of an Electron app. For engineers who prefer terminal workflows and want to stay close to git, it's the cleanest AI coding experience available in 2026.
Aider's superpower is that it works across every major model — Claude, GPT, Gemini, DeepSeek, local Llama via Ollama. Which is also its hardest ongoing question: which model should I use for this session?
This post walks through connecting Aider to Promptster so model choice stops being a guess.
What You'll Build
By the end of this tutorial:
- Aider is installed and authenticated against two or more model providers.
- You've set up a Promptster saved test that regression-tests your project's prompts.
- You have a shell alias that picks the best model for the task you're about to start.
Total time: ~20 minutes.
Step 1 — Install Aider
pip install aider-install
aider-install
Aider auto-configures based on the API keys in your environment. Export at least two:
export ANTHROPIC_API_KEY=sk-ant-...
export OPENAI_API_KEY=sk-proj-...
export GEMINI_API_KEY=AIza... # optional but recommended
Verify:
aider --list-models | head -20
You should see anthropic/claude-sonnet-4-5, openai/gpt-4o, gemini/gemini-2.5-flash, etc.
Step 2 — Set Up Project-Scoped Model Defaults
Create .aider.conf.yml in your project root:
model: anthropic/claude-sonnet-4-5
editor-model: openai/gpt-4o-mini
weak-model: gemini/gemini-2.5-flash-lite
# Use the weak model for commit messages, summaries, and small edits.
# Use the editor-model for code edits.
# Use the main model for reasoning-heavy changes.
This three-tier setup is informed directly by our task-type decision framework:
- Main model (Sonnet): gets the hardest reasoning, worth the $3/M input.
- Editor model (GPT-4o-mini): handles edit application, patching, and simple refactors. Our cheap-fast-smart triangle post showed it's the most consistent budget-tier OpenAI option.
- Weak model (Gemini 2.5 Flash Lite): generates commit messages, summaries, index lookups — tasks where cost matters and quality is plateaued.
Under a reasonable monthly coding load, this configuration runs 3-10x cheaper than defaulting every call to Sonnet.
Step 3 — Install the Promptster MCP Server for Code-Context Queries
Aider itself doesn't speak MCP natively, but you can run Promptster's MCP server alongside it in a separate pane and use it for pre-flight model comparisons — the thing Aider can't do on its own.
# Add Promptster MCP to Claude Desktop or Cursor for ambient access
# (see /docs/api/mcp-integration for full setup)
If you're already in a Promptster account, the MCP server works out of the box. Then, before starting a complex refactor in Aider, you can ask your Claude Code or Cursor session:
"Compare how GPT-4o, Sonnet, and Gemini would handle the following refactor. Return the cost, latency, and a quality rubric." (paste the proposed change)
You get a three-way benchmark in ~15 seconds, pick the best, then run Aider with --model <chosen>.
For direct shell access, use the Promptster API:
# pick-model.sh — pipe a task description in, get a recommended model out
curl -s -X POST https://www.promptster.dev/v1/prompts/test \
-H "Authorization: Bearer $PROMPTSTER_API_KEY" \
-H "Content-Type: application/json" \
-d "{
\"provider\": \"openai\",
\"model\": \"gpt-4o-mini\",
\"prompt\": \"Classify this coding task as one of: simple-edit, complex-refactor, bug-hunt, architecture. Task: $(cat -)\"
}" | jq -r '.response'
Pipe the output to a local routing function that maps each label to an aider --model value. Now your terminal workflow is:
echo "Refactor this O(n²) loop to use a hash-set; 200 lines across 3 files" | ./pick-model.sh
# → complex-refactor → anthropic/claude-sonnet-4-5
aider --model anthropic/claude-sonnet-4-5
Step 4 — Regression-Test Your Prompt Templates
If you have internal prompt templates (for commit message generation, PR summaries, code review comments), save them to Promptster and schedule a weekly regression test across your three-tier model fleet.
- In Promptster, create a saved test for each template.
- Set up a scheduled comparison that runs every Monday at 09:00.
- Point the schedule at a curated reference-answer set.
- Alert when quality drops below threshold (model drift).
Model providers silently change behavior between versions. A scheduled cross-provider comparison catches those regressions before your aider --commit starts producing "chore: refactor code" for everything.
We covered this pattern in depth in automating prompt testing for production.
Step 5 — Git Integration
Aider's killer feature is tight git integration: every change is a commit you can revert. Compose this with Promptster's prompt version history for a full auditable chain:
- Aider commits code changes locally.
- Promptster logs every prompt test you ran before making the change.
- Your PR description can link to both: the commit and the Promptster share URL of the comparison that decided the model choice.
Example git hook (.git/hooks/post-commit):
#!/bin/bash
# Append last Promptster test URL to commit trailer
LAST_TEST=$(curl -s https://www.promptster.dev/v1/history?limit=1 \
-H "Authorization: Bearer $PROMPTSTER_API_KEY" | jq -r '.[0].share_url')
if [ -n "$LAST_TEST" ]; then
git commit --amend --trailer "Model-Comparison: $LAST_TEST" --no-edit
fi
Now every commit in the repo has a trailer pointing at the evidence you used to pick the model.
Why This Combination Works
Aider without Promptster: great terminal UX, endless guesses about which model to use.
Promptster without Aider: great cross-model comparison, but no shell-native coding loop.
Together: Aider does the coding; Promptster decides and audits the model choice. Both are open-to-inspection (Aider source, Promptster test records). Both play well with git. Neither locks you into a single provider.
For more on MCP-connected coding workflows, see our MCP server with Cursor tutorial, Claude Code custom templates, and Windsurf + Promptster debugging.
Tested with Aider 0.73+ and Promptster API v1 as of 2026-04-19. Aider docs: https://aider.chat/docs.