Skip to content
Go back

How I use AI for programming

After experimenting with various AI code editors including Cursor, I have settled with Aider for most of my programming needs.

Aider is an open-source CLI program that works with any Large Language Model (LLM) via API keys. Its strong Git integration fits seamlessly into my existing workflow. Aider is feature-rich, capable of scraping web pages, processing image and PDF files, and analyzing the output of shell commands.

Installation

Installing Aider is straightforward.

Using pip:

python -m pip install aider-install
aider-install

Using one-liner script:

curl -LsSf https://aider.chat/install.sh | sh

Configuration

Aider can be configured in multiple ways including command-line switches, .aider.conf.yml file, environment variables and .env file.

I currently use Gemini 2.5 Pro as the primary model for most programming tasks. Previously, I used Claude Sonnet, but I’ve found Gemini to be more cost-effective while delivering comparable (if not superior) results.

Here’s my current configuration:

AIDER_MODEL=openrouter/google/gemini-2.5-pro-preview-03-25
AIDER_WEAK_MODEL=openrouter/openai/gpt-4o-mini
AIDER_AUTO_COMMITS=false
AIDER_CACHE_PROMPTS=true
AIDER_CACHE_KEEPALIVE_PINGS=12
AIDER_WATCH_FILES=true
AIDER_ANALYTICS_DISABLE=true
AIDER_DARK_MODE=true
AIDER_CODE_THEME="one-dark"

# API Keys
OPENAI_API_KEY=<openai_api_key>
GEMINI_API_KEY=<gemini_api_key>
ANTHROPIC_API_KEY=<anthropic_api_key>
OPENROUTER_API_KEY=<openrouter_api_key>
FIREWORKS_AI_API_KEY=<fireworks_api_key>

Usage

Within Aider, you can issue commands using the /<command> syntax directly in the chat.

Chat modes

Aider supports several chat modes. The ones I use most often are:

Ask-Code workflow

I frequently utilize the Ask-Code workflow. Use ask mode to discuss what you want to do, get suggestions or options from aider and provide feedback on the approach. Once aider understands the mission, switch to code mode to have it start editing your files. All the conversation and decision making from ask mode will help ensure that the correct code changes are performed.

Managing files and chat history

IDE mode / watch-files mode

I leverage the watch-files mode for an in-place editing experience, similar to using Cmd-K in Cursor. When Aider runs in this mode, it monitors all files in the repository for AI coding instructions added via any IDE or text editor. Specifically, Aider searches for single-line comments that start or end with AI, AI!, or AI?.

This feature offers significant flexibility. You can insert multiple AI comments (without the ! or ?) across various files before finally triggering Aider with a concluding AI! or AI?.

A workflow I use often is to start with the AI comments first and then switch to the terminal chat for follow-up questions or refinements. The chat history conveniently includes the context from these AI comments as well.

Other useful in-chat commands

Here are some other commands I frequently use:

Additional tools

Besides Aider, I utilize several other tools for my work:

Conclusion

Aider appeals to me because it is open-source, flexible, and CLI based, avoiding lock-in to any specific proprietary IDE.

While this combination suits my current needs, the main point is really about finding the tools and workflow that fit your own style. Everyone works differently, so it’s worth experimenting to see which AI tools help you be more productive.

Update (September 9, 2025)

I have since switched from Aider to Claude Code. You can read about the transition in this follow-up post.


Share this post on:

Previous Post
I replaced Cloudflare Tunnel with Pangolin
Next Post
The infrastructure behind my self-hosted projects (including this blog)