Skip to content

Codex Huge Context Setup

Configure and audit Codex for a 1M-token context via direct OpenAI API with safety preflight checks

Stars
7,433
Licence
MIT
Files
1 file

What it does

This skill teaches an agent to set up, repair, or audit a Codex configuration that uses a very large (about one million token) context window. It routes model inference through a direct OpenAI API provider with a key fetched from a Keychain helper, while keeping the normal ChatGPT login for connectors such as Gmail and Calendar. It also gives exact config values, compaction thresholds, and a preflight rule that blocks launching Codex when the provider and context settings are mismatched.

Great for

  • Developers who run Codex on their own Mac and want to use the very large context windows offered by the OpenAI API
  • Operators maintaining a fleet of Macs running Codex who need consistent, audited configuration

Skip it if

  • Users without a direct OpenAI API account or the specific models named (GPT-6 Astra, GPT-6.1 Sol), since the setup will not work and may bill unexpectedly
  • Anyone who cannot verify the author's hardcoded paths and settings, since the file assumes a specific user home directory and a particular Codex version and may break or misconfigure other setups

Try asking

  • “Audit my ~/.codex/config.toml and tell me whether the provider and context window settings are safe”
  • “Set up the openai_api_direct provider with the Keychain auth helper for my Codex install”
  • “Update models-api-1m.json so every model has a 922000 context window and 700000 compaction limit”
  • “Run the preflight check before I resume a Codex session on my Mac”
Step-by-step guide: how to use Codex Huge Context SetupInstall, first run, examples, tips and FAQs

Install in 3 steps

  1. 1

    Download the skill

    The ZIP contains the 1 original files, the MIT licence and an attribution note.

    codex-huge-context.zip
  2. 2

    Add it to your agent

    Claude Code (all projects)

    mkdir -p ~/.claude/skills && unzip codex-huge-context.zip -d ~/.claude/skills/

    Claude Code / Agent SDK (this project only)

    mkdir -p .claude/skills && unzip codex-huge-context.zip -d .claude/skills/

    Claude apps (web/desktop): Settings → Capabilities → Skills → Upload skill, and choose the ZIP.

  3. 3

    Ask for the task

    No special command needed — the agent reads the skill's description and loads it when your request matches. Try one of the prompts above.

Get better results

  • Back up ~/.codex/config.toml and models-api-1m.json before applying changes, since the skill asks you to overwrite root keys and the full model catalogue
  • Review the hardcoded user path and the Peter-specific dates and measurements, and adapt them to your own machine before use
  • Start fresh threads after any provider change, because resuming an old thread keeps its recorded provider

What's inside

  • SKILL.md

Redistributed unmodified from steipete/agent-scripts under the MIT licence. The assessment was drafted with AI from the skill's files on 2026-10-29. Skills can instruct your agent to run code — read SKILL.md and any scripts before installing.