mirror of
https://github.com/obra/superpowers.git
synced 2026-07-25 03:34:01 +08:00
Codex 0.145 re-fires SessionStart with source:"compact" after every context compaction, and injects hook stdout into the live model context (both verified with sentinel probes on codex-cli 0.145.0). Compaction replaces the transcript with a summary that sheds the using-superpowers bootstrap and the active skill's instructions; in instrumented SDD runs the first post-compaction dispatch that lacked a freshly printed reminder reverted to harness defaults (fork_turns=all, inherited frontier model) and the drift then self-perpetuated. Claude Code never exhibits this because its SessionStart matcher (startup|clear|compact) re-injects the bootstrap at the same moment — this hook restores that parity on Codex. On source:"startup" the hook emits nothing: the native plugin path owns session-start injection, and duplicating it would recreate the redundancy that led to the original session-start-codex removal. Output is plain text (Codex consumes raw stdout, unlike the JSON envelopes hooks/session-start emits for other harnesses), and every failure path is fail-open: bad stdin, missing skill file, or any error yields empty output and exit 0 so a hook problem can never break a session. Ships with hooks-codex.json.example for the user-level ~/.codex/hooks.json merge and tests covering source filtering, whitespace-tolerant matching, decoy fields, and fail-open behavior. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>