Answer: Codex caches container state for up to 12 hours to speed up new chats and follow-ups; when a cached container is resumed, Codex checks out the branch specified for the chat and runs the maintenance script (optional). Status: Confirmed Entry: tool/codex/agents-and-automation/container-caching-maintenance-script Revision: 1 Digest: sha256:84b7595d9d5c9628 (changes whenever the content changes) Timeline: Created: 2026-11-13T03:50:57Z Last changed: 2026-11-13T03:50:57Z Last verified: 2026-11-20T13:39:14Z Next check: 2026-11-21T13:39:14Z Check interval: Daily Expected change: No fixed schedule Data: Field | Value | Unit | Source | As of Cache duration | 12 hours | hours | [1] | 2026-11-20 When maintenance script runs | When a cached container is resumed | | [1] | 2026-11-20 Maintenance script step | Codex runs the maintenance script (optional). | | [1] | 2026-11-20 Cache invalidation triggers | setup script, maintenance script, environment variables, or secrets | | [1] | 2026-11-20 Sources: [1] OpenAI. "Codex Cloud (Legacy)". https://learn.chatgpt.com/docs/environments/cloud-environment.md Role: primary. Accessed: 2026-11-20T13:39:14Z Quote: "Codex caches container state for up to 12 hours to speed up new chats and follow-ups." (Supports: Cache duration) Quote: "When a cached container is resumed:" (Supports: When maintenance script runs) Quote: "Codex runs the maintenance script (optional)." (Supports: Maintenance script step) Quote: "Codex automatically invalidates the cache if you change the setup script, maintenance script, environment variables, or secrets." (Supports: Cache invalidation triggers) Snapshot SHA-256: a8f0c084d12d59c1fd815ad91c2749a3f7133b413b9ecb84fd2f41bd4e86bf0f (captured 2026-11-13T03:50:56Z) 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-13T03:50:57Z, so the values verified then were kept. Cross-check: not-available at 2026-11-20T13:39:14Z. No independent second source is configured for this entry Last successful check: 2026-11-20T13:39:14Z Last attempt: 2026-11-20T13:39:14Z Notes and limitations: Extracted automatically from a single official source (section "Container caching"). Related: https://latestn.com/tool/codex/agents-and-automation/create-publish-environment How do I create and publish a reusable environment in Codex Cloud? https://latestn.com/tool/codex/agents-and-automation/delegate-repo-work-codex-cloud-slack How do I delegate repository work to Codex Cloud from Slack? https://latestn.com/tool/codex/agents-and-automation/dot-codex-tasks How can my dot start Codex tasks and follow up on existing Codex threads? https://latestn.com/tool/codex/agents-and-automation/codex-cloud-task-default-environment How do I start a Codex cloud task without choosing a repository? https://latestn.com/tool/codex/agents-and-automation/codex-prompt-examples How do I prompt Codex to explain a codebase or fix a bug? https://latestn.com/tool/codex/agents-and-automation/configure-custom-agents How do I configure a custom Codex agent with its own model and instructions? https://latestn.com/tool/ All entries in AI tools Change log: Time | Event | Change | Source 2026-11-13T03:50:57Z | added | Entry created | — Changes for this entry as a feed: https://latestn.com/tool/codex/agents-and-automation/container-caching-maintenance-script/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/codex/agents-and-automation/container-caching-maintenance-script POST: https://latestn.com/dispute/tool/codex/agents-and-automation/container-caching-maintenance-script with claim, evidence_url, and optionally field and contact (form-encoded or JSON) GET: https://latestn.com/dispute/tool/codex/agents-and-automation/container-caching-maintenance-script?claim={what is wrong}&evidence_url={link} How to cite: LatestN. (2026). How does container caching work in Codex Cloud and when is the maintenance script run? Revision 1, last verified 2026-11-20T13:39:14Z. https://latestn.com/tool/codex/agents-and-automation/container-caching-maintenance-script (accessed 2026-11-21T09:57:46Z). @misc{LatestN_tool_codex_agents_and_automation_container_caching_maintenance_script_r1, title = {How does container caching work in Codex Cloud and when is the maintenance script run?}, author = {{LatestN}}, year = {2026}, howpublished = {\url{https://latestn.com/tool/codex/agents-and-automation/container-caching-maintenance-script}}, note = {Revision 1; digest sha256:84b7595d9d5c9628; last verified 2026-11-20T13:39:14Z; accessed 2026-11-21T09:57:46Z} } 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/codex/agents-and-automation/container-caching-maintenance-script