Skip to main content
hook CX Codex

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

Install into Claude Code · Manually: put the files in place All methods and platforms ↓
.claude/settings.json
Open on GitHub

What 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.py on each edit
  • Wire a Python check to the PostToolUse event

How to install codex-project-autopilot

Manually: put the files in place

.claude/settings.json

The 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

Similar hooks

All hooks for Agent setup: memory, context, orchestration →

From the same set391

The whole set →
board A SessionStart hook that tells the agent what is on the project board. The board lives in plain Markdown files, so you can read it straight from the terminal. CX Codex ★ 1,596repo stars steinwall The steinwall hook for Claude Code and Codex provides cost controls, action guards, and loop recovery for unattended agent sessions with shell execution. CX Codex ★ 1,596repo stars session-orchestrator session-orchestrator — a hook for Claude Code and Codex that wraps each agent session in structured planning, staged execution, and quality gates. Fires on SessionStart, PreToolUse, PostToolUse, Stop, and SubagentStop. CX Codex ★ 1,596repo stars repopilot repopilot takes a repo snapshot at session start and checks it again before the agent stops. If tests, suppressions or CI gates got weaker, the session will not end quietly. CX Codex ★ 1,596repo stars praxis This hook loads Praxis triage when a session starts or resumes, so the agent can work toward a defined outcome instead of a step list. CX Codex ★ 1,596repo stars off-the-wall The off-the-wall hook quotes your earlier fixes into the prompt before every Codex answer. The model sees what you corrected before and stops repeating the same mistakes. CX Codex ★ 1,596repo stars nightshift nightshift binds Codex work sessions to strict time limits, tracking punch lists, deferred decisions, and run logs. CX Codex ★ 1,596repo stars homie homie checks tool calls, pauses risky actions for approval, and removes secrets from results the model reads. CX Codex ★ 1,596repo stars

Project sponsors

Companies that keep this analytics open