Claude Code hooks and Codex hooks: guardrails that say how strong they are

Claude Code and Codex are the first agents 05 supports. Hooks watch the session, a git pre-push gate and a CI template cover everything else, and each one is honest about what it can and cannot enforce.

What the Claude Code and Codex hooks do

05 ships hooks for the two agents it supports first. They watch what the agent does against the plan it declared and the repository's policy.

The agent declares; the hook seals. Before its first edit, the agent runs use05 start with its plan: what it will do, where, and which checks must pass. Its hook, which runs outside the agent's sandbox, seals that plan and records who declared it, so a later change to it shows. An agent running unsandboxed as you could, in principle, rewrite seals that are not pushed yet; once CI seals them, they are permanent. When the agent stops, the hook runs the checks itself, so “tests pass” is never taken on the agent's word.

Guardrails on every tool call. Before a tool runs, the hook (Claude Code's PreToolUse, and its Codex equivalent) refuses commands that destroy work or switch checks off, such as a force push, git reset --hard or --no-verify, and edits to protected paths without an approved plan. It also refuses edits to locked files, rewrites of append-only files, deletions of no-delete files and reads of do-not-read files, before they happen; in Claude Code it sees the Read, Grep and Glob tools for that. See locked folders and file rules. Ordinary edits get no permission decision from 05, so the agent's own permission settings still apply. Codex cannot ask a person from a hook yet, so where Claude Code would ask, Codex is refused with the reason. use05 init also adds a short block to AGENTS.md, so the agent knows the rules before it starts.

Hooks are advisory. The agent runs on your machine, so a hook is only as strong as the agent's willingness, or inability, to route around it. Use hooks for early, friendly feedback while the work happens. Do not treat them as the thing that keeps a bad change from merging. The CLI says this out loud instead of implying protection it cannot provide.

Any other agent: a generic hook, pre-push gate and CI

An agent with hooks of its own can call use05 hook generic: the same events, answered with a plain decision, reason and context. The git pre-push gate and the CI template do not care which agent, or which person, wrote the change. Any agent that works in a git repository is covered by them. The pre-push gate is still local and advisory (git lets a developer skip local hooks). The CI template is where enforcement becomes hard.

What an agent-written change looks like with 05

The agent declares and works, its checks are signed on the exact tree, and 05 compares the result to the plan; you read the brief only when something did not match. The full flow, with a diagram, is on how 05 works.

Several agents at once, kept orchestrated: declared scope and git worktrees

Each agent's declared plan reserves its area, and its hook tells any other agent that plans or edits there which task holds it; each agent works on its own branch and worktree, and use05 land removes them once its change lands. The whole picture, step by step, is on several agents, one codebase.

Try it

To set 05 up with Claude Code or Codex, follow get started with 05. The source is on GitHub.

Try 05 on your own repositories

The source, install steps and docs are on GitHub. Questions, or want to tell us which agent and Git host you use? Email us. No forms, no cookies.