docs(codex): wire the compaction hook into README and codex-tools, add drift-cure footer

README gains the hook install step for Codex users (hooks.json merge,
one-time trust prompt, --dangerously-bypass-hook-trust for headless
automation). codex-tools.md aligns its claims with the mechanism — the
dispatch rules bind every spawn, the printed hints appear at scripted
boundaries, and the hook covers post-compaction re-grounding — and adds
a section telling controllers compaction sheds these instructions and
to treat every printed hint as authoritative.

The hints file gains a drift-cure footer both scripts print after the
role line: in the instrumented run that broke post-compaction,
reprinted hints alone did not heal the already-broken dispatch pattern
across three subsequent boundaries — recovery text must name the drift
and prescribe the re-read.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Drew Ritter
2026-07-23 12:23:17 -07:00
parent 6b1589c1e5
commit 4c3e7e5e8a
6 changed files with 71 additions and 2 deletions

View File

@@ -5,6 +5,10 @@
# Model names track Codex's spawn_agent allowlist (currently gpt-5.6-sol
# and gpt-5.6-terra) — update this file when the allowlist changes.
# Format: <role>: <line printed verbatim>
# The footer line prints after every role line: prevention alone does not
# cure drift — in instrumented runs, reprinted hints did not heal an
# already-broken dispatch pattern until the text named the drift directly.
footer: If any spawn this session omitted these params or used fork_turns "all", you have drifted — re-read references/codex-tools.md before dispatching again.
implementer: dispatch (spawn_agent): fork_turns=none model=gpt-5.6-terra reasoning_effort=high
task-review: dispatch (spawn_agent): fork_turns=none model=gpt-5.6-terra reasoning_effort=high
fix-review: dispatch (spawn_agent): fork_turns=none model=gpt-5.6-terra reasoning_effort=medium

View File

@@ -19,7 +19,9 @@ If your `spawn_agent` schema has `model` and `reasoning_effort`
parameters (Codex 0.145+), set both on every dispatch: task-brief and
review-package print a `dispatch:` hint line with the exact values —
copy it onto the call verbatim, every time, even late in a long
session. Those hints are the Model Selection mapping on Codex:
session. The hints print at those scripts' boundaries; every other
spawn — ad-hoc fan-outs included — follows the same table without a
printed reminder. Those hints are the Model Selection mapping on Codex:
reviewer tier never exceeds implementer tier, no fix round gets an
effort bump, and rounds 4-5's "more capable model" means a fresh
implementer at the same tier — needing more is a BLOCKED escalation
@@ -34,6 +36,19 @@ your model and effort with no override — role files in
partner before starting a plan of more than a few tasks, and offer a
lower-effort session instead.
## Compaction sheds these instructions
Context compaction replaces your transcript with a summary that keeps
your progress but not your working instructions — the first
post-compaction dispatch is where routing drift starts, and once one
bare spawn lands, the broken pattern becomes its own precedent. The
compaction re-injection hook (README, "Codex: compaction re-injection
hook") restores the bootstrap after every compaction; recommend it to
your human partner if it is not installed. Without it, the printed
`dispatch:` hints are your only re-grounding — treat every one you see
as authoritative, especially right after a summary appears in your
context.
## Environment Detection
Skills that create worktrees or finish branches should detect their