Skip to content
Docs

Codex hooks aren't running

Most often, Codex is waiting for you to approve TokenNibbler’s two hooks: open Codex, choose Trust all and continue, and run a command. If the card or Run checks shows one of the messages below, its section has the fix.

MessageSection
Connected · approve the hooks in Codex, or in Run checks: “No Codex hook received yet. Approve the TokenNibbler hook in Codex (/hooks), restart Codex and run a shell command.”Approve the hooks in Codex
Codex hooks are turned off, with “Codex config.toml sets [features] hooks = false.”Hooks turned off in config.toml
Reconnect Codex, with “The Codex hook points to an older TokenNibbler location.”Reconnect Codex
“Codex command hook could not reach the local service. Reconnect Codex.” (or “Codex output hook …”)Reconnect Codex
Codex needs attention, with “Cannot parse Codex hooks.json. The existing file has not been changed.”hooks.json can’t be read
Codex not found, or “Codex was not found on this PC. Install Codex, then try again.”Codex not found

Why it happens: Codex asks you to review new hooks before it runs them, and TokenNibbler never approves hooks for you.

  1. On the ChatGPT card, select Open Codex. When Codex asks about the new hooks, choose Trust all and continue.
  2. In a Codex session that’s already open, type /hooks to review and approve TokenNibbler’s hooks there.
  3. Restart any Codex sessions that were open before you connected. They load hooks when they start.
  4. Run a shell command in Codex, such as a build or a test. The card changes to Connected · last output with the time.

If Open Codex isn’t shown, run codex in a terminal and choose Trust all and continue there. If you see “Codex could not start on this PC. Open a terminal and run codex to see why.”, do that: Codex’s own message says what it needs.

Why it happens: Your Codex config.toml turns hooks off. Codex runs hooks by default, and TokenNibbler never edits config.toml, so this is a change you make.

  1. Open %USERPROFILE%\.codex\config.toml (on a Mac, ~/.codex/config.toml), or the one in CODEX_HOME.
  2. Find hooks = false under [features], or features.hooks = false at the top, and remove the line.
  3. Save, restart Codex, and run a shell command.

If Run checks says “Codex config.toml also defines hooks; Codex loads both and may show a warning”, that’s for your information: Codex loads the hooks from both places and may show a warning about it.

Why it happens: The hooks in hooks.json point to an older TokenNibbler location, or a hook couldn’t reach TokenNibbler’s local service when Run checks ran it the way Codex does.

  1. If the card says Local service unavailable or Run checks says “Local service is not reachable”, fix that first: see Local service unavailable.
  2. On the ChatGPT card, select Reconnect. TokenNibbler replaces its own hooks and keeps everything else.
  3. If Codex asks about the hooks again, choose Trust all and continue, then restart open Codex sessions.

Why it happens: hooks.json isn’t valid JSON, so TokenNibbler leaves it exactly as it is.

  1. Open the file shown in Settings › Integrations, usually %USERPROFILE%\.codex\hooks.json (on a Mac, ~/.codex/hooks.json).
  2. Fix the JSON: remove comments and trailing commas, and check every bracket is closed.
  3. Select Connect Codex again.

Codex runs code-mode models’ commands inside a script, where a hook cannot change the output. In the Microsoft Store and Mac versions, these commands run exactly as Codex typed them, with their full output, and Run checks says so in one line. That line is for your information: nothing needs fixing. On a Mac, version 1.0.2 words it as “Codex command wrapping is available on Windows only”, marked !; nothing needs fixing there either. TokenNibbler still shortens Codex’s direct shell output, plus Claude Code and its MCP results.

Why it happens: TokenNibbler looks for Codex’s folder, %USERPROFILE%\.codex (on a Mac, ~/.codex), or the folder in CODEX_HOME, and for the codex command.

  1. Install the Codex CLI and sign in with codex login.
  2. If you keep Codex’s files elsewhere, set CODEX_HOME to that folder, then restart TokenNibbler.
  3. Select Connect Codex. TokenNibbler looks for the codex command again within 30 seconds, so there’s no need to restart it after installing.

Select Run checks in Settings › Integrations, copy the results, and send them with a screenshot of the ChatGPT card through the contact page. Troubleshooting: start here lists what else helps. To see what the connection changes, read Connect Codex.