
Prompt Caching
Faster, Cost-Effective Coding
Optimize with Prompt Caching
Aider supports prompt caching for cost savings and faster responses:
Enable Caching:
aider --cache-prompts
Currently supported by:
- Anthropic (Claude Sonnet and Haiku)
- DeepSeek Chat
What Gets Cached:
- System prompt
- Read-only files
- Repository map
- Editable files
Prevent Cache Expiration:
aider --cache-keepalive-pings 5
This keeps the cache warm by pinging every 5 minutes (up to 5 times).
When enabled, you'll see "prompt cache" noted in the model announcement line at startup.