Answer: Set the `CODEX_HOME` environment variable to change the Codex home directory location; it sets the root for Codex state, and if you set it, the directory must already exist. Status: Confirmed Entry: tool/codex/settings/change-codex-home-directory Revision: 1 Digest: sha256:07ae7a7c787cad8a (changes whenever the content changes) Timeline: Created: 2026-11-13T03:48:25Z Last changed: 2026-11-13T03:48:25Z Last verified: 2026-11-20T13:36:05Z Next check: 2026-11-21T13:36:05Z Check interval: Daily Expected change: No fixed schedule Data: Field | Value | Source | As of Environment variable | CODEX_HOME | [1] | 2026-11-20 Default location | ~/.codex | [1] | 2026-11-20 Requirement | the directory must already exist | [1] | 2026-11-20 Sources: [1] OpenAI. "Environment variables". https://learn.chatgpt.com/docs/config-file/environment-variables.md Role: primary. Accessed: 2026-11-20T13:36:05Z Quote: "`CODEX_HOME`" (Supports: Environment variable) Quote: "| `CODEX_HOME` | CLI, IDE extension, app-server, installers | `~/.codex` |" (Supports: Default location) Quote: "If you set it, the directory must already exist." (Supports: Requirement) Snapshot SHA-256: 091de0e9ff7f1c504549c2b7d8fe42cf8d1bd782f5a759d58bdead958f579ff8 (captured 2026-11-13T03:48:25Z) 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:48:25Z, so the values verified then were kept. Cross-check: not-available at 2026-11-20T13:36:05Z. No independent second source is configured for this entry Last successful check: 2026-11-20T13:36:05Z Last attempt: 2026-11-20T13:36:05Z Notes and limitations: Extracted automatically from a single official source (section "Core locations"). Related: https://latestn.com/tool/codex/settings/change-editor-setting How do I change an editor setting for the Codex IDE extension in VS Code? https://latestn.com/tool/codex/settings/change-settings-tui How do I change Codex settings in the TUI? https://latestn.com/tool/codex/settings/choose-cloud-environment How do I choose or set up an environment for a Codex Cloud task? https://latestn.com/tool/codex/privacy-and-data/ultrafast-inference-residency Where can GPT-6.1 Sol Ultrafast inference residency be hosted? https://latestn.com/tool/codex/settings/add-common-actions How do I add common actions to a Codex project? https://latestn.com/tool/codex/settings/change-cli-theme How do I change the theme in the Codex CLI? https://latestn.com/tool/ All entries in AI tools Change log: Time | Event | Change | Source 2026-11-13T03:48:25Z | added | Entry created | — Changes for this entry as a feed: https://latestn.com/tool/codex/settings/change-codex-home-directory/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/settings/change-codex-home-directory POST: https://latestn.com/dispute/tool/codex/settings/change-codex-home-directory with claim, evidence_url, and optionally field and contact (form-encoded or JSON) GET: https://latestn.com/dispute/tool/codex/settings/change-codex-home-directory?claim={what is wrong}&evidence_url={link} How to cite: LatestN. (2026). How do I change the Codex home directory location? Revision 1, last verified 2026-11-20T13:36:05Z. https://latestn.com/tool/codex/settings/change-codex-home-directory (accessed 2026-11-21T09:59:30Z). @misc{LatestN_tool_codex_settings_change_codex_home_directory_r1, title = {How do I change the Codex home directory location?}, author = {{LatestN}}, year = {2026}, howpublished = {\url{https://latestn.com/tool/codex/settings/change-codex-home-directory}}, note = {Revision 1; digest sha256:07ae7a7c787cad8a; last verified 2026-11-20T13:36:05Z; accessed 2026-11-21T09:59:30Z} } 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/settings/change-codex-home-directory