Expand description
OpenAI Codex integration for sqz.
Codex is OpenAI’s terminal coding agent (openai/codex). It does not
expose a stable per-tool-call hook like Claude Code’s PreToolUse — the
only event hook documented at the time of writing is notify, which
fires at the END of a turn (once per user message) and so is useless
for compressing tool output before the model sees it. An experimental
features.codex_hooks flag is mentioned in the config reference but
described as “under development; off by default” and the public hooks.json
schema is not documented enough to target safely. See
https://developers.openai.com/codex/config-reference.
What Codex DOES expose reliably today:
-
MCP servers via
~/.codex/config.tomlunder[mcp_servers.<id>]. The TOML key ismcp_servers(snake_case), NOTmcpServers(camelCase) as in JSON-based tools. See https://github.com/openai/codex/blob/main/docs/config.md. -
AGENTS.md— project-level markdown instructions Codex reads at session start. It’s the Codex analogue ofCLAUDE.mdand.cursor/rules/*.mdc. A singleAGENTS.mdis the cross-tool convention (Codex, GitHub Copilot, Cursor, Windsurf, Amp, Devin all read it). See https://agentsmd.io. -
The shell hook installed by
sqz init— works transparently because Codex runs bash via its sandboxed exec tool and sees the compressed stdout automatically. No Codex-specific wiring needed.
This module implements (1) and (2). Guidance-file approach for (2) mirrors how RTK handles the same “no programmatic hook” problem with Codex — see https://github.com/rtk-ai/rtk/blob/master/hooks/codex/README.md.
Functions§
- agents_
md_ guidance_ block - Build the markdown block that sqz appends to
AGENTS.md. - agents_
md_ path - Return the path where Codex reads project-level instructions.
- codex_
config_ path - Return the location of Codex’s user-level
config.toml. - install_
agents_ md_ guidance - Install sqz’s guidance block into
AGENTS.mdatproject_dir. - install_
codex_ mcp_ config - Merge sqz’s MCP server entry into Codex’s user-level
config.toml. - remove_
agents_ md_ guidance - Remove sqz’s guidance block from
AGENTS.md. - remove_
codex_ mcp_ config - Remove sqz’s MCP entry from Codex’s user-level
config.toml.