Answer: Codex looks for `hooks.json` in system locations (`/etc/codex/hooks.json` on macOS and Linux, `%ProgramData%\OpenAI\Codex\hooks.json` on Windows), the user location `$CODEX_HOME/hooks.json`, and the trusted project location `.codex/hooks.json`. It also checks `.codex` directories from the project root to the working directory, loading hooks only from trusted project layers. Status: Confirmed Entry: tool/codex/settings/hook-file-locations Revision: 2 Digest: sha256:4c4b0b8214fb7314 (changes whenever the content changes) Timeline: Created: 2026-11-13T03:51:33Z Last changed: 2026-11-18T13:33:44Z (Plugin bundled hooks default: — → hooks/hooks.json) Last verified: 2026-11-20T13:39:54Z Next check: 2026-11-21T13:39:54Z Check interval: Daily Expected change: No fixed schedule Data: Field | Value | Source | As of System (macOS and Linux) location | /etc/codex/hooks.json | [1] | 2026-11-20 System (Windows) location | %ProgramData%\OpenAI\Codex\hooks.json | [1] | 2026-11-20 User location | $CODEX_HOME/hooks.json | [1] | 2026-11-20 Trusted project location | .codex/hooks.json | [1] | 2026-11-20 User file when CODEX_HOME unset (macOS and Linux) | ~/.codex/hooks.json | [1] | 2026-11-20 User file when CODEX_HOME unset (Windows) | %USERPROFILE%\.codex\hooks.json | [1] | 2026-11-20 Plugin bundled hooks default | hooks/hooks.json | [1] | 2026-11-20 Sources: [1] OpenAI. "Hooks". https://learn.chatgpt.com/docs/hooks.md Role: primary. Accessed: 2026-11-20T13:39:54Z Quote: "| System (macOS and Linux) | `/etc/codex/hooks.json` |" (Supports: System (macOS and Linux) location) Quote: "| System (Windows) | `%ProgramData%\OpenAI\Codex\hooks.json` |" (Supports: System (Windows) location) Quote: "| User | `$CODEX_HOME/hooks.json` |" (Supports: User location) Quote: "| Trusted project | `.codex/hooks.json` |" (Supports: Trusted project location) Quote: "If `CODEX_HOME` is unset, the user file is `~/.codex/hooks.json` on macOS and" (Supports: User file when CODEX_HOME unset (macOS and Linux)) Quote: "Linux and `%USERPROFILE%\.codex\hooks.json` on Windows." (Supports: User file when CODEX_HOME unset (Windows)) Quote: "their manifest or, by default, `hooks/hooks.json` in the plugin root." (Supports: Plugin bundled hooks default) 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:44Z, so the values verified then were kept. Cross-check: not-available at 2026-11-20T13:39:54Z. No independent second source is configured for this entry Last successful check: 2026-11-20T13:39:54Z Last attempt: 2026-11-20T13:39:54Z Notes and limitations: Extracted automatically from a single official source (section "Where Codex looks for hooks"). Related: https://latestn.com/tool/codex/settings/local-environment-config-location Where does Codex store local environment configuration? https://latestn.com/tool/codex/settings/move-diagnostic-logs-local How do I move Codex diagnostic logs to local disk when using an NFS home? https://latestn.com/tool/codex/settings/one-run-settings-override How do I change Codex settings for a single run instead of permanently? https://latestn.com/tool/codex/settings/enable-disable-codex-skills How do I enable or disable local Codex skills? https://latestn.com/tool/codex/settings/enable-fast-mode How do I enable Fast mode in Codex? https://latestn.com/tool/codex/settings/global-agents-md-guidance How do I create global custom instructions for Codex? https://latestn.com/tool/ All entries in AI tools Change log: Time | Event | Change | Source 2026-11-18T13:33:44Z | changed | Plugin bundled hooks default: — → hooks/hooks.json | [1] 2026-11-18T13:33:44Z | changed | User file when CODEX_HOME unset (Windows): — → %USERPROFILE%\.codex\hooks.json | [1] 2026-11-18T13:33:44Z | changed | User file when CODEX_HOME unset (macOS and Linux): — → ~/.codex/hooks.json | [1] 2026-11-18T13:33:44Z | changed | Trusted project location: — → .codex/hooks.json | [1] 2026-11-18T13:33:44Z | changed | User location: — → $CODEX_HOME/hooks.json | [1] 2026-11-18T13:33:44Z | changed | System (Windows) location: — → %ProgramData%\OpenAI\Codex\hooks.json | [1] 2026-11-18T13:33:44Z | changed | System (macOS and Linux) location: — → /etc/codex/hooks.json | [1] 2026-11-18T13:33:44Z | changed | Plugin default file: hooks/hooks.json → — | [1] 2026-11-18T13:33:44Z | changed | Repo config file: /.codex/config.toml → — | [1] 2026-11-18T13:33:44Z | changed | Repo hooks file: /.codex/hooks.json → — | [1] 2026-11-18T13:33:44Z | changed | User config file: ~/.codex/config.toml → — | [1] 2026-11-18T13:33:44Z | changed | User hooks file: ~/.codex/hooks.json → — | [1] 2026-11-18T13:33:44Z | changed | Inline form: [hooks] → — | [1] 2026-11-18T13:33:44Z | changed | Discovery method: hooks.json → — | [1] 2026-11-13T03:51:33Z | added | Entry created | — Changes for this entry as a feed: https://latestn.com/tool/codex/settings/hook-file-locations/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/hook-file-locations POST: https://latestn.com/dispute/tool/codex/settings/hook-file-locations with claim, evidence_url, and optionally field and contact (form-encoded or JSON) GET: https://latestn.com/dispute/tool/codex/settings/hook-file-locations?claim={what is wrong}&evidence_url={link} How to cite: LatestN. (2026). Where does Codex look for hook files? Revision 2, last verified 2026-11-20T13:39:54Z. https://latestn.com/tool/codex/settings/hook-file-locations (accessed 2026-11-21T09:54:07Z). @misc{LatestN_tool_codex_settings_hook_file_locations_r2, title = {Where does Codex look for hook files?}, author = {{LatestN}}, year = {2026}, howpublished = {\url{https://latestn.com/tool/codex/settings/hook-file-locations}}, note = {Revision 2; digest sha256:4c4b0b8214fb7314; last verified 2026-11-20T13:39:54Z; accessed 2026-11-21T09:54:07Z} } 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/hook-file-locations