ai-config-openai-codex-integration
Section titled “ai-config-openai-codex-integration”Background
Section titled “Background”- Talbot (2026-09-29, in Market-timing-Red-Team): “For very important work (like Red Team stress testing), I want to use the strongest SOTA models. Currently, that is NOT Gemini. It is OpenAI (and its latest models).” · “I want to avoid API billing unless critical… I would prefer a known-cost solution, like adding a $20/mn OpenAI subscription” · “we should /task-prepare to integrate OpenAI/ChatGPT into our ai-config and KB-OS systems, as a complement to Claude Code.” · Approved: “yes, prep this task”.
- Gemini (CLI or AntiGravity) is reserved for mid-level tasks, to be wired up later (same response). The Gemini CLI trigger in
~/ai-config/UPGRADES.md(“when a Gemini CLI install appears, add it to the fan-out”) has fired, but stays deferred.
Context (Auto-Prepared)
Section titled “Context (Auto-Prepared)”Verified 2026-09-29 unless marked otherwise.
- Codex CLI is installed:
pnpm add -g @openai/codex, v0.159.0, binary~/.local/share/pnpm/codex. It is signed in with ChatGPT (device code) for the Red Team pass. Credentials are in~/.codex/auth.json, which OpenAI says to treat “like a password” (Codex auth). - Plan: ChatGPT Plus, $20/month. Per Codex pricing:
- about 15–150 messages per 5 hours on GPT-6 Sol, plus weekly limits;
- models listed: GPT-6 Sol/Luna, GPT-5.6 Sol/Terra/Luna, GPT-5.5, GPT-5.4 and 5.4 mini;
- at the limit, “purchase additional credits” is optional, so there is no metered billing.
- Headless use (CLI reference):
codex exec -m <model> -c model_reasoning_effort=high -s read-only|workspace-write -C <dir> -o <answer-file> "<prompt>". - ai-config today:
deploy.shcopiesclaude/commands/*(the SMTM/task-*skills) to Claude Code only.- It copies
skills/(the tool-agnostic SSOT) to Claude Code and AntiGravity. - It sends nothing to Codex or Gemini CLI.
AGENTS.mdis the rules SSOT, andclaude/CLAUDE.mdandGEMINI.mdare thin wrappers.
- Unverified, check first: whether Codex reads a global
~/.codex/AGENTS.mdand per-repoAGENTS.mdfiles natively, and whether it supports custom commands or skills in a format the SMTM skills could be ported to. - Model-choice policy lives in
Core/AI/Subscriptions.md(Active Subscriptions). Add ChatGPT Plus there once it is subscribed.
- Verify Codex’s instruction-file and custom-command/skill support at its own docs or release notes, not blog summaries.
- Add a Codex target to
deploy.sh:- deploy
AGENTS.md(plus a thincodex/wrapper, if one is needed) to wherever Codex reads global instructions; - never commit or copy
~/.codex/auth.json; - follow the ai-config rule of diffing before deploying.
- deploy
- Decide which skills Codex gets:
- the tool-agnostic
skills/, by extending the fan-out; - whether the SMTM
/task-*commands should be ported, or whether Codex should instead be used as a reviewer, called headless by Claude (the Red Team pattern) and not as a task runner.
- the tool-agnostic
- Write the model-routing rule (Claude vs OpenAI vs Gemini: which work goes to which, and why) into
AGENTS.mdorCore/AI/. Include a reusable “second-opinion / Red Team” recipe (codex execon a throwaway copy, with a self-contained brief). - Record the ChatGPT Plus subscription in
Core/AI/Subscriptions.md, and register Codex inCore/IT/Utils/External/Utilities.md.
Success Criteria
Section titled “Success Criteria”- A fresh
codexsession in~/projects/<any>shows it loaded the AGENTS.md rules (for example, it can state the “NEVER GUESS” rule without being told). deploy.shcovers Codex and was tested with a deploy run.- The model-routing rule and the second-opinion recipe are written down, and Claude can run the recipe end to end without Talbot pasting anything.