codex-project-autopilot — Claude Code hook: what it does
codex-project-autopilot — a hook for Claude Code and Codex that runs a check after every file write or edit. Fires automatically on PostToolUse events.
MIT ★ 1,596 updated 2026-10-29
.claude/settings.jsonWhat codex-project-autopilot does
After each Write or Edit tool call, it runs the Python script post_write_codex_agent_guardrail.py from the ./scripts folder. The script performs a validation step — what exactly depends on its internal logic.
The config lists three launch variants (py -3, python, python3). The hook tries them in order until one succeeds. Requires Python installed and the script file at the specified path.
Fits projects where every change needs automatic verification: linters, tests, style checks or codebase constraints.
What it helps with
- run a check after every file write
- automatically call a script when editing code
- set up post-processing for changes in Claude Code
Example prompts for the agent
- Add a hook that checks files after every write
- Set up autorun for
post_write_codex_agent_guardrail.pyon each edit - Wire a Python check to the PostToolUse event
How to install codex-project-autopilot
Manually: put the files in place
.claude/settings.jsonThe hooks block: event (PreToolUse, PostToolUse, Stop…) → command. Personal ones go to ~/.claude/settings.json
Step by step, with commands for each platform: Claude Code hooks: what they are, where to configure them, how to block a risky command
Questions about codex-project-autopilot
How to install codex-project-autopilot in Claude Code?
Add the hook config to .claude/settings.json at the project root. In the hooks.PostToolUse section, specify the matcher Write|Edit and the script launch command.
What does codex-project-autopilot do?
Runs the Python script post_write_codex_agent_guardrail.py after each write or edit operation in Claude Code or Codex. The script performs a validation check — what exactly depends on its content.
What does the hook need to run?
Python installed (any of py -3, python, python3) and the script file ./scripts/post_write_codex_agent_guardrail.py in the project. The hook tries commands in sequence until one works.
Source text
hooks.json · MIT
Hooks bundle shipped with the codex-project-autopilot plugin for Claude Code.
Turn an idea into a structured project workflow with planning, execution, verification, and handoff.
Triggers on: PostToolUse.
```json
{
"hooks": {
"PostToolUse": [
{
"matcher": "Write|Edit",
"hooks": [
{
"type": "command",
"command": "py -3 ./scripts/post_write_codex_agent_guardrail.py || python ./scripts/post_write_codex_agent_guardrail.py || python3 ./scripts/post_write_codex_agent_guardrail.py"
}
]
}
]
}
}
```
© Morecil · MIT · hashgraph-online/awesome-codex-plugins