Pre-tool-use hooks that block destructive commands such as deleting the root or home directory, prompted by a report of GPT 5.6 deleting a user's files. The creator also recommends the 'approve for me' approval mode over full access.
Pre-tool-use hooks for OpenAI Codex that intercept and block destructive shell commands before they run.
Updated EU status checked Last shown
Codex Hooks at a glance
- What is Codex Hooks?
- Codex Hooks is an app from OpenAI. Pre-tool-use hooks for OpenAI Codex that intercept and block destructive shell commands before they run.
- Who makes Codex Hooks?
- Codex Hooks is made by OpenAI.
- Does Codex Hooks work in the EU?
- Unverified. No explicit evidence found. Last verified 14 Nov 2026.
- How much does Codex Hooks cost?
- Pricing unknown. The example gist is freely viewable. Use of Codex itself depends on OpenAI's plans, which were not covered in the provided material.
- Where was Codex Hooks shown?
- In 1 creator video by Matthew Berman. Most recently by Matthew Berman on 14 Jul 2026, at 13:00 in “You aren't using Codex like me...”.
Sources: the vendor's own pages (linked above) and creator videos at the linked timestamps. EU status is information, not legal advice; see how we check.
Codex Hooks, specifically pre-tool-use hooks, are scripts that run before OpenAI's Codex coding agent executes a tool call. A hook can inspect the pending command and block it. The example discussed by creator Matthew Berman, shared as a public GitHub gist, uses this to stop destructive commands such as deleting the root or home directory.
Berman presented the setup as a response to a report of a GPT 5.6 model deleting a user's files. The hooks act as a deterministic guardrail outside the model, so a dangerous command is refused even if the model proposes it. He also recommends using Codex's 'approve for me' approval mode instead of full access, as a second layer of protection.
The material provided is a user-authored gist and a video description, not official documentation. Details such as the exact configuration format, supported events and Codex version requirements are not confirmed here. Users should check OpenAI's Codex documentation before relying on it.
- Runs before a tool call executes and can block it
- Example rules block deleting the root or home directory
- Works as a deterministic safety layer outside the model
- Intended to be combined with the 'approve for me' approval mode
- Shared as a copyable GitHub gist
As seen on YouTube
Watch the moment: the exact second top creators show it. Videos load only when you press play, via youtube-nocookie.com.
Similar AI tools
Closest neighbours by meaning, not just by category.
Codex
App · OpenAI
OpenAI's coding agent, available in the ChatGPT app, cloud, IDE extension and CLI under one ChatGPT account.
Codex in the cloud
App · OpenAI
OpenAI's cloud-based coding agent that runs engineering tasks in remote environments, accessed via ChatGPT.
Codex CLI (refreshed)
App · OpenAI
OpenAI's open-source coding agent that runs in the terminal, with voice control and a new code review experience.
Codex in ChatGPT mobile app
App · OpenAI
Mobile access to Codex in the ChatGPT iOS and Android app to monitor, approve and start coding tasks running on your machines.
Codex Thread Delegation and Search
App · OpenAI
Codex feature letting one thread search, summarize and link other threads and delegate work to them.
GPT-5.3 Codex
Model · OpenAI
OpenAI's agentic coding model powering Codex in the CLI, IDE extension, desktop app and ChatGPT cloud.
