Answer: Setup scripts run automatically when Codex creates a new worktree at the start of a new chat, and you use them to run any command required to configure your environment, such as installing dependencies or running a build process. If your setup is platform-specific, you can define setup scripts for macOS, Windows, or Linux to override the default. Status: Confirmed Entry: tool/codex/settings/configure-setup-script Revision: 1 Digest: sha256:78f57ce2ea536be9 (changes whenever the content changes) Timeline: Created: 2026-11-13T03:51:03Z Last changed: 2026-11-13T03:51:03Z Last verified: 2026-11-20T13:39:21Z Next check: 2026-11-21T13:39:21Z Check interval: Daily Expected change: No fixed schedule Data: Field | Value | Source | As of when setup scripts run | Setup scripts run automatically when Codex creates a new worktree at the start of a new chat. | [1] | 2026-11-20 purpose | run any command required to configure your environment, such as installing dependencies or running a build process | [1] | 2026-11-20 TypeScript example | npm install npm run build | [1] | 2026-11-20 platform-specific override | define setup scripts for macOS, Windows, or Linux to override the default | [1] | 2026-11-20 Sources: [1] OpenAI. "Local environments". https://learn.chatgpt.com/docs/environments/local-environment.md Role: primary. Accessed: 2026-11-20T13:39:21Z Quote: "Setup scripts run automatically when Codex creates a new worktree at the start of a new chat." (Supports: when setup scripts run) Quote: "Use this script to run any command required to configure your environment, such as installing dependencies or running a build process." (Supports: purpose) Quote: "npm install npm run build" (Supports: TypeScript example) Quote: "If your setup is platform-specific, define setup scripts for macOS, Windows, or Linux to override the default." (Supports: platform-specific override) Snapshot SHA-256: be1d914a3e59fb5a17f8b2c8247ff864236d12dc2c50b2b4cc58137a636b6e29 (captured 2026-11-13T03:51:03Z) 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:51:03Z, so the values verified then were kept. Cross-check: not-available at 2026-11-20T13:39:21Z. No independent second source is configured for this entry Last successful check: 2026-11-20T13:39:21Z Last attempt: 2026-11-20T13:39:21Z Notes and limitations: Extracted automatically from a single official source (section "Setup scripts"). Related: https://latestn.com/tool/codex/settings/configure-vertex-ai-provider How do I configure the Vertex AI provider manually in Codex? https://latestn.com/tool/codex/settings/copy-ignored-files-worktree How do I copy ignored local files into Codex-managed worktrees? https://latestn.com/tool/codex/settings/create-codex-environment How do I create a Codex environment in the desktop app or on the web? https://latestn.com/tool/codex/settings/configure-env-vars-secrets How do I configure environment variables and network secrets for a Codex Cloud environment? https://latestn.com/tool/codex/settings/configure-local-web-search-custom-provider How do I configure local web search in Codex with a custom model provider? https://latestn.com/tool/codex/settings/configure-reviewer-policy How do I configure the Codex Auto-review reviewer policy? https://latestn.com/tool/ All entries in AI tools Change log: Time | Event | Change | Source 2026-11-13T03:51:03Z | added | Entry created | — Changes for this entry as a feed: https://latestn.com/tool/codex/settings/configure-setup-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/settings/configure-setup-script POST: https://latestn.com/dispute/tool/codex/settings/configure-setup-script with claim, evidence_url, and optionally field and contact (form-encoded or JSON) GET: https://latestn.com/dispute/tool/codex/settings/configure-setup-script?claim={what is wrong}&evidence_url={link} How to cite: LatestN. (2026). How do I configure a setup script for Codex local environments? Revision 1, last verified 2026-11-20T13:39:21Z. https://latestn.com/tool/codex/settings/configure-setup-script (accessed 2026-11-21T09:50:44Z). @misc{LatestN_tool_codex_settings_configure_setup_script_r1, title = {How do I configure a setup script for Codex local environments?}, author = {{LatestN}}, year = {2026}, howpublished = {\url{https://latestn.com/tool/codex/settings/configure-setup-script}}, note = {Revision 1; digest sha256:78f57ce2ea536be9; last verified 2026-11-20T13:39:21Z; accessed 2026-11-21T09:50:44Z} } 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/configure-setup-script