Answer: Use --cache-keepalive-pings N to tell aider to ping every 5 minutes to keep the cache warm, preventing it from expiring. Status: Confirmed Entry: tool/aider/settings/prevent-cache-expiration Revision: 1 Digest: sha256:e91268f1e8cf6044 (changes whenever the content changes) Timeline: Created: 2026-11-13T02:56:43Z Last changed: 2026-11-13T02:56:43Z Last verified: 2026-11-20T11:43:57Z Next check: 2026-11-21T11:43:57Z Check interval: Daily Expected change: No fixed schedule Data: Field | Value | Unit | Source | As of flag | --cache-keepalive-pings N | | [1] | 2026-11-20 default cache duration | 5 minutes | minutes | [1] | 2026-11-20 ping interval | 5 minutes | minutes | [1] | 2026-11-20 total keepalive period | N*5 minutes | minutes | [1] | 2026-11-20 Sources: [1] Aider. "aider.chat/docs/usage/caching.html". https://aider.chat/docs/usage/caching.html Role: primary. Accessed: 2026-11-20T11:43:57Z Quote: "Use --cache-keepalive-pings N to tell aider to ping every 5 minutes to keep the cache warm." (Supports: flag) Quote: "By default, Anthropic keeps your cache for 5 minutes." (Supports: default cache duration) Quote: "to tell aider to ping every 5 minutes to keep the cache warm" (Supports: ping interval) Quote: "Aider will ping up to N times over a period of N*5 minutes after each message you send." (Supports: total keepalive period) Published: 2026-04-25T16:45:23Z Snapshot SHA-256: 1bae430f28d7a3d1edebeae8f11b37dee0addaf2701f018683bffae3851e4d14 (captured 2026-11-13T02:56:43Z) Verification: Method: Automated extraction from [1] with deepseek-flash (JSON output, thinking disabled). Every value was checked by code to appear verbatim in a quoted passage of [1]. On this check the text of [1] was unchanged since 2026-11-13T02:56:43Z, so the values verified then were kept. Cross-check: not-available at 2026-11-20T11:43:57Z. No independent second source is configured for this entry Last successful check: 2026-11-20T11:43:57Z Last attempt: 2026-11-20T11:43:57Z Notes and limitations: Extracted automatically from a single official source (section "Preventing cache expiration"). Related: https://latestn.com/tool/aider/settings/sample-dotenv-file What does a sample Aider .env file look like? https://latestn.com/tool/aider/settings/sample-yaml-config What does a sample Aider YAML config file look like? https://latestn.com/tool/aider/settings/set-api-key-yaml-config How do I configure the OpenAI or Anthropic API key for Aider in a YAML config file? https://latestn.com/tool/aider/settings/other-api-key-variables Which API key environment variables does Aider use for other LLM providers? https://latestn.com/tool/aider/settings/other-provider-api-key-env How do I set API keys for other API providers in Aider using environment variables or a .env file? https://latestn.com/tool/aider/settings/per-language-linters How do I set a per-language linter in Aider? https://latestn.com/tool/ All entries in AI tools Change log: Time | Event | Change | Source 2026-11-13T02:56:43Z | added | Entry created | — Changes for this entry as a feed: https://latestn.com/tool/aider/settings/prevent-cache-expiration/latest Challenge this entry: Open challenges: None How: If a value here is wrong or out of date, send what is wrong and a link to evidence. Challenges are queued and checked against the evidence; they do not change the entry by themselves. If the entry changes as a result, the change log says so. Form: https://latestn.com/dispute/tool/aider/settings/prevent-cache-expiration POST: https://latestn.com/dispute/tool/aider/settings/prevent-cache-expiration with claim, evidence_url, and optionally field and contact (form-encoded or JSON) GET: https://latestn.com/dispute/tool/aider/settings/prevent-cache-expiration?claim={what is wrong}&evidence_url={link} How to cite: LatestN. (2026). How do I prevent the prompt cache from expiring in Aider? Revision 1, last verified 2026-11-20T11:43:57Z. https://latestn.com/tool/aider/settings/prevent-cache-expiration (accessed 2026-11-21T10:00:22Z). @misc{LatestN_tool_aider_settings_prevent_cache_expiration_r1, title = {How do I prevent the prompt cache from expiring in Aider?}, author = {{LatestN}}, year = {2026}, howpublished = {\url{https://latestn.com/tool/aider/settings/prevent-cache-expiration}}, note = {Revision 1; digest sha256:e91268f1e8cf6044; last verified 2026-11-20T11:43:57Z; accessed 2026-11-21T10:00:22Z} } Reuse: License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/) Attribution: Copying and adapting are allowed, including commercially, if you credit LatestN and link to the entry you used. Each entry ends with a ready-made citation. URL: https://latestn.com/tool/aider/settings/prevent-cache-expiration