# Codex 1m Context Window Setup

Configures and verifies an expanded, model-aware context window for OpenAI Codex CLI...

- Repository: https://github.com/daymade/claude-code-skills (1509 stars)
- Category: Engineering
- License: MIT
- Last updated: 2026-11-01
- Runs scripts: yes, review before use

## Install

Claude Code: `npx skills add daymade/claude-code-skills --skill codex-1m-context-window-setup -g -a claude-code -y`
Codex: `npx skills add daymade/claude-code-skills --skill codex-1m-context-window-setup -g -a codex -y`
Cursor: `npx skills add daymade/claude-code-skills --skill codex-1m-context-window-setup -g -a cursor -y`
Gemini CLI: `npx skills add daymade/claude-code-skills --skill codex-1m-context-window-setup -g -a gemini-cli -y`
Claude Code plugin marketplace: `/plugin marketplace add daymade/claude-code-skills`

## Description

Configures and verifies an expanded, model-aware context window for OpenAI Codex CLI and Desktop. Use to inspect local context settings, lower or set the auto-compaction threshold, expand ~258K context to 500K or 1M, or repair model_context_window/model_auto_compact_token_limit. Not for changing the selected model or other Codex settings.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Codex 1m Context Window Setup

Inspect local settings or change only automatic compaction. For full context
expansion, read Codex's current model catalog, cap the request at the model's
declared maximum, and apply the bundled expansion preset.

## Route the request

| User intent | Action |
|---|---|
| Read the current base-config window or compaction threshold | Run `show`; no Codex process or model catalog needed |
| Lower/set only automatic compaction | Run `show`, then `set-compact --tokens N` |
| Explain 258K, diagnose model limits, or preview full expansion | Run `doctor` |
| Configure/fix/raise the context window | Run `apply` |
| Confirm a prior setup is still correct after an update or model switch | Run `verify` |

Honor a user-specified threshold exactly. If the user only asks for a small
reduction, choose and state a modest reversible reduction from the observed value.
For expansion, derive attainable values from the live catalog instead of asking
the user for model limits. Running `apply` selects the full expansion preset and
replaces a custom threshold; do it only when full setup is requested.

For local reads/edits, start with the bundled commands. Do not dump config.toml,
load unrelated machine manuals, or run network/model diagnostics. Consult official
OpenAI documentation when parameter semantics or compatibility are unresolved;
it cannot establish this machine's current value. Respect host output restrictions;
if numeric output is denied, use its supported field-condition probe and keep an
unread value unknown. Do not reconstruct denied values through repeated comparisons.

## Prerequisites

The rest: https://github.com/daymade/claude-code-skills/blob/HEAD/daymade-codex/codex-1m-context-window-setup/SKILL.md
