Answer: Set `async` to `true` on a command hook to run it in the background while Codex continues. In `hooks.json` add `"async": true` to the command handler, or in `config.toml` set `async = true`. Status: Confirmed Entry: tool/codex/agents-and-automation/background-hooks Revision: 1 Digest: sha256:61b735660c291251 (changes whenever the content changes) Timeline: Created: 2026-11-13T03:51:34Z Last changed: 2026-11-13T03:51:34Z Last verified: 2026-11-20T13:39:56Z Next check: 2026-11-21T13:39:56Z Check interval: Daily Expected change: No fixed schedule Data: Field | Value | Unit | Source | As of async setting | true | | [1] | 2026-11-20 hooks.json setting | "async": true | | [1] | 2026-11-20 config.toml setting | async = true | | [1] | 2026-11-20 default timeout | 600 | seconds | [1] | 2026-11-20 concurrent background hooks limit | eight | | [1] | 2026-11-20 Sources: [1] OpenAI. "Hooks". https://learn.chatgpt.com/docs/hooks.md Role: primary. Accessed: 2026-11-20T13:39:56Z Quote: "Set `async` to `true` to run a command hook in the background while Codex continues." (Supports: async setting) Quote: "Add `"async": true` to a command handler in `hooks.json`:" (Supports: hooks.json setting) Quote: "For an inline hook in `config.toml`, set `async = true`:" (Supports: config.toml setting) Quote: "`timeout` is measured in seconds and defaults to `600`." (Supports: default timeout) Quote: "Codex runs up to eight background hooks concurrently per session." (Supports: concurrent background hooks limit) Snapshot SHA-256: 37cdbfc3b9d19925f88af3e680399fd61bd3d15979961302160f97698cc5a841 (captured 2026-11-18T13:33:44Z) 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-18T13:33:46Z, so the values verified then were kept. Cross-check: not-available at 2026-11-20T13:39:56Z. No independent second source is configured for this entry Last successful check: 2026-11-20T13:39:56Z Last attempt: 2026-11-20T13:39:56Z Notes and limitations: Extracted automatically from a single official source (section "Run hooks in the background"). Related: https://latestn.com/tool/codex/agents-and-automation/build-skill How do I build a skill for ChatGPT or Codex? 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/admin-and-enterprise/set-global-baseline-environment-overrides How do I set a Global baseline policy and add environment overrides in Codex Agent Security? https://latestn.com/tool/codex/agents-and-automation/agent-workflow-guardrails How do I add guardrails to custom agent workflows in Codex? https://latestn.com/tool/codex/agents-and-automation/automate-security-reviews-ci-cd How do I automate Codex security reviews in CI/CD? https://latestn.com/tool/ All entries in AI tools Change log: Time | Event | Change | Source 2026-11-13T03:51:34Z | added | Entry created | — Changes for this entry as a feed: https://latestn.com/tool/codex/agents-and-automation/background-hooks/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/background-hooks POST: https://latestn.com/dispute/tool/codex/agents-and-automation/background-hooks with claim, evidence_url, and optionally field and contact (form-encoded or JSON) GET: https://latestn.com/dispute/tool/codex/agents-and-automation/background-hooks?claim={what is wrong}&evidence_url={link} How to cite: LatestN. (2026). How do I run a Codex hook in the background? Revision 1, last verified 2026-11-20T13:39:56Z. https://latestn.com/tool/codex/agents-and-automation/background-hooks (accessed 2026-11-21T09:57:09Z). @misc{LatestN_tool_codex_agents_and_automation_background_hooks_r1, title = {How do I run a Codex hook in the background?}, author = {{LatestN}}, year = {2026}, howpublished = {\url{https://latestn.com/tool/codex/agents-and-automation/background-hooks}}, note = {Revision 1; digest sha256:61b735660c291251; last verified 2026-11-20T13:39:56Z; accessed 2026-11-21T09:57:09Z} } 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/background-hooks