> ## Documentation Index
> Fetch the complete documentation index at: https://docs.payback.sh/llms.txt
> Use this file to discover all available pages before exploring further.

# Codex

> Hooks in Codex's hooks.json; approve them once with /hooks.

## How it hooks in

Setup writes `~/.codex/hooks.json` with entries for `UserPromptSubmit`, `Stop`, `SessionStart`, `SessionEnd`, `PreCompact` and `PostCompact`, each running `payback hook codex <event>`.

## The one-time approval

Codex runs a hook only after you've approved it. Open Codex in any project and run `/hooks`, then approve the payback hooks. Codex stores a hash of each hook's text and remembers it.

> [!NOTE]
>
> Codex asks again only if a hook's text changes; it does not change on ordinary updates.

Until the hooks are approved, `payback status` shows "Codex · approve the hooks once with /hooks".

## What is captured

The same as every agent: see [What is recorded](https://docs.payback.sh/recording.md).

## Turning it off

`payback pause` stops every agent; `payback uninstall` removes payback's entries from `hooks.json`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.