Codex Hook Gate
Installation
-
Download
codex-hook-gate.zipfrom the GitHub Release and extract it to a stable directory. Keep the.agentsdirectory alongsidecodex-hook-gate. -
Register that extracted directory:
codex plugin marketplace add /absolute/path/to/extracted-directory. -
In Codex desktop, install Codex Hook Gate from the Codex Hook Gate local marketplace and approve its hooks. Restart or start a new chat if Codex does not load the new plugin in the current chat.
-
In the project to check, create
.codex/gate.yaml, for example:rules: - match: "**/*.{ts,tsx}" run: - name: lint cmd: pnpm lint run_checks: [test] consistency_checks: - name: test run: - name: test cmd: pnpm test
No Go or Node.js runtime is needed for the plugin. Commands configured in gate.yaml still require their own project dependencies. match can be a string or list. Commands run in order; set dir on a rule or consistency check to run from a project-relative directory, and timeout in seconds on a rule, check, or command. A failed edit check is repeated at Stop. After five unsuccessful Stop attempts, the gate allows completion and reports the unresolved failure.
The bundled command hooks require a local Codex executor and trust approval. Codex does not run local plugin hooks in cloud-orchestrated environments. File detection covers tracked and nonignored untracked files in a Git project. A native Git installation is used for file enumeration when present; projects without Git use a filesystem walk. Specialized Codex tools can bypass normal tool hooks, so verify the required tool paths in the target Codex environment.