Codex 1m Context Window Setup logo

Codex 1m Context Window Setup

CommunityPopular
daymade
codex-1m-context-window-setup

Configures and verifies an expanded, model-aware context window for OpenAI Codex CLI and Codex Desktop by safely updating the shared base config. Use whenever Codex shows about 258K context, the user asks for 500K or 1M context, auto-compaction happens too often, model_context_window or model_auto_compact_token_limit needs repair, or a workstation/classroom needs the same long-context setup across macOS and Windows. Detects the selected model's live maximum, requests up to 1M tokens, sets compaction to 60% of the attainable window, preserves unrelated TOML, backs up changes, and fails rather than guessing when the model contract cannot be verified.

Overview

Publisherdaymade
Repositoryclaude-code-skills
Skill namecodex-1m-context-window-setup
Stars
1.4K
Forks
219
Bundled files
3
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 3 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by daymade on GitHub. Read the source before you install it.

Installation

Install the Codex 1m Context Window Setup AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/daymade/claude-code-skills.git /tmp/claude-code-skills
mkdir -p .claude/skills
cp -r /tmp/claude-code-skills/daymade-codex/codex-1m-context-window-setup .claude/skills/codex-1m-context-window-setup
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Codex 1m Context Window Setup in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Codex 1m Context Window Setup on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Codex 1m Context Window Setup is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Codex 1m Context Window Setup

Expand future Codex sessions without pretending every model supports one million tokens. The bundled script reads Codex's current model catalog, caps the request at the selected model's declared maximum, and applies the user's established 60% auto-compaction policy.

Route the request

User intentAction
Inspect the current limit, explain 258K, or preview the recommendationRun doctor
Configure/fix/raise the context windowRun apply
Confirm a prior setup is still correct after an update or model switchRun verify

Do not ask the user for raw token numbers. The model catalog is the authority and the script derives the attainable values.

Run the workflow

When this Skill loads, the host exposes its installed path. Resolve it explicitly:

  • In Codex, take the directory containing SKILL.md from this Skill's file: entry in the current Available skills catalog.
  • In Claude Code, use the Base directory for this skill shown by the Skill load result.

Do not search a home directory for another copy. If the host did not expose an installed path, stop with installed Skill path not exposed rather than guessing.

On macOS/Linux, set that exact directory and run:

bash
SKILL_DIR="/absolute/path/from-the-loaded-skill-metadata"
uv run --no-project python "$SKILL_DIR/scripts/codex_context_window.py" doctor
uv run --no-project python "$SKILL_DIR/scripts/codex_context_window.py" apply
uv run --no-project python "$SKILL_DIR/scripts/codex_context_window.py" verify

On Windows PowerShell, use the same exposed directory with forward slashes:

powershell
$SkillDir = "C:/absolute/path/from-the-loaded-skill-metadata"
uv run --no-project python "$SkillDir/scripts/codex_context_window.py" doctor
uv run --no-project python "$SkillDir/scripts/codex_context_window.py" apply
uv run --no-project python "$SkillDir/scripts/codex_context_window.py" verify

doctor

Run first. It is read-only and reports:

  • selected model resolved by Codex;
  • catalog default, model maximum, and usable percentage;
  • requested raw window (up to 1,000,000), usable window, and 60% compaction point;
  • current base-config values and whether apply is needed;
  • exact $CODEX_HOME/config.toml target.

If Codex cannot return a live model catalog, stop. Do not substitute remembered model limits, API marketing numbers, or a bundled default.

apply

Run only after doctor succeeds. The script:

  1. Re-reads the live model contract.
  2. Changes only the top-level model_context_window and model_auto_compact_token_limit keys.
  3. Creates a content-addressed backup only when bytes will change.
  4. Uses an atomic same-directory replace and refuses to overwrite a concurrently changed config.
  5. Runs Codex strict-config diagnostics; a failure restores the exact prior bytes.
  6. Reads the written file back and reports the values that future sessions will use.

Existing sessions do not grow in place. After success, tell the user to start a new CLI thread or restart/open a new Codex Desktop thread.

verify

Run after Codex upgrades, default-model changes, or on a newly configured machine. It exits non-zero when the current base config no longer equals the model-aware recommendation. Report the mismatch; do not call it configured.

Report the outcome

Copy exact values from script output. Include:

  • model slug;
  • configured raw window;
  • usable window shown to the session;
  • automatic compaction threshold;
  • whether the model capped the 1M request;
  • config and backup paths;
  • restart_required: true after a changed apply.

Refuse scope expansion

This Skill does not:

  • change the selected model, reasoning effort, service tier, sandbox, approvals, plugins, MCP servers, browser/computer-use settings, or shell aliases;
  • edit profile-specific config files or override per-command -c flags;
  • claim the current running thread was expanded;
  • force 1M when the selected model declares a smaller maximum;
  • fall back to stale or guessed model metadata.

Read references/context_window_contract.md when diagnosing model caps, the 95% usable-window display, or compaction semantics.

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Codex 1m Context Window Setup AI skill do?

Configures and verifies an expanded, model-aware context window for OpenAI Codex CLI and Codex Desktop by safely updating the shared base config. Use whenever Codex shows about 258K context, the user asks for 500K or 1M context, auto-compaction happens too often, model_context_window or model_auto_compact_token_limit needs repair, or a workstation/classroom needs the same long-context setup across macOS and Windows. Detects the selected model's live maximum, requests up to 1M tokens, sets compaction to 60% of the attainable window, preserves unrelated TOML, backs up changes, and fails rathe...

Why use Codex 1m Context Window Setup on TypingMind?

Because you install it once and use it with any model. Codex 1m Context Window Setup is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Codex 1m Context Window Setup in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/daymade/claude-code-skills/tree/main/daymade-codex/codex-1m-context-window-setup. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Codex 1m Context Window Setup?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Codex 1m Context Window Setup?

As many as you like. As long as a model supports skills, you can use Codex 1m Context Window Setup with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Codex 1m Context Window Setup AI skill free?

Yes. It is published on GitHub by daymade under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇