Docs / Field guide / Hooks for burn rate in Claude Code and Codex

Hooks for burn rate in Claude Code and Codex

Both engines run your own commands at fixed points in a session, called hooks: before a tool runs, after it runs, when a session starts, when a turn ends. They are the natural place to keep an agent's spending in check. But in neither engine does a hook see the usage meter, so start with what does.

Figures from model a5v3, last checked against a live meter on 29/10/2026: plan usage burn data.

Reading the meter#

  • Claude Code hands your status line command the plan's usage percentages each time it redraws. A status line that writes down what it receives gives you a running record of both meters. That is how our own figures started.
  • Codex writes its rate-limit percentages into its own session files, and /status shows the session's token use.

With either record you can watch your pace: the meter's rise per day against about 14.3% a day for an even week. A bad day caught by lunchtime is a day you can still change.

Where hooks help#

MomentClaude CodeCodexWhat to do there
After a tool runsPostToolUsePostToolUsespot a huge output and point the agent at a stored copy, so it isn't re-read every turn
Before a tool runsPreToolUsePreToolUsehand over a short briefing on the file about to be edited, instead of five exploratory reads
Session start, including after compactionSessionStartSessionStartinject a short generated handover, so a fresh session doesn't need a long pasted history
Before compactionPreCompactPreCompactsave what must survive, or stop a compaction at a bad moment (both can)
When a turn endsStopStophold an agent that is about to stop with work half done

Codex reads hooks from hooks.json or a [hooks] table in config.toml, and runs a new or changed hook only after you trust it in /hooks. Claude Code reads them from its settings files, and /hooks lists them.

Keep them few#

Every hook runs on every event it matches, and whatever it prints becomes context too. A handful of hooks with one job each beats a dozen that overlap. A hook that blocks is a gate, and gates have a habit of multiplying: not every issue should become one.

Where ADE fits#

ADE installs at most 8 hooks in Claude Code, each with one job: the first-edit briefing, the shell guard, notes on search output, the turn-end hold and the handover. Its status line records the Claude meters each turn, it reads Codex's own rate-limit records, and ade cockpit shows each engine against the share of the week you set. See Day to day.