Configures and verifies an expanded, model-aware context window for OpenAI Codex CLI and Desktop. Inspects local settings, lowers or sets auto-compaction thresholds, expands ~258K context to 500K or 1M, and repairs model_context_window/model_auto_compact_token_limit.
Ships in daymade-codex. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
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.
| 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.
Use Python 3.11+ for the script's tomllib dependency and uv for the documented
launcher. show needs no Codex executable. set-compact requires a Codex CLI
supporting features list; full expansion additionally requires doctor --json,
debug models and strict-config diagnostics. Missing expansion support does not
prevent a local read. Do not substitute another config root or guessed model data
when a required command is unavailable.
Run the bundled configuration script.
When this Skill loads, the host exposes its installed path. Resolve it explicitly:
SKILL.md from this Skill's file:
entry in the current Available skills catalog.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:
SKILL_DIR="/absolute/path/from-the-loaded-skill-metadata"
On Windows PowerShell, use the same exposed directory with forward slashes:
$SkillDir = "C:/absolute/path/from-the-loaded-skill-metadata"
Execute only the branch selected under Route the request. In the commands
below, PowerShell users substitute $SkillDir for $SKILL_DIR.
show and set-compactUse the same resolved script path on either platform:
uv run --no-project python "$SKILL_DIR/scripts/codex_context_window.py" show --json
uv run --no-project python "$SKILL_DIR/scripts/codex_context_window.py" set-compact --tokens 400000 --json
uv run --no-project python "$SKILL_DIR/scripts/codex_context_window.py" show --json
Choose --tokens from the current request, not this example. show emits only
the numeric settings, the config path and evidence status; a missing value is null,
not a guessed default.
It does not inspect profile or command-line overrides.
set-compact preserves the context-window setting, profiles, comments and existing
formatting; inserting a missing key may add a separating newline. It rejects
nonpositive/out-of-range tokens and thresholds
above an explicitly configured window. When the window is absent, leave it absent;
model-derived runtime caps remain unverified. Before a changed write, back up the
original and check for concurrent edits. Write atomically, run the local
codex features list configuration-load check with captured output, and read back
the target. Restore the original on validation failure unless a concurrent edit
makes that unsafe. A no-op creates no backup. Do not echo diagnostic bodies that
may contain unrelated configuration. Use show afterward as independent readback.
doctorRun first for full expansion or model-cap diagnosis:
uv run --no-project python "$SKILL_DIR/scripts/codex_context_window.py" doctor --json
It is read-only and reports:
apply is needed;$CODEX_HOME/config.toml target.If Codex cannot return a live model catalog, stop the expansion path. Do not
substitute remembered model limits, API marketing numbers, or a bundled default.
Local show/set-compact remain independent of catalog availability.
applyRun only after doctor succeeds:
uv run --no-project python "$SKILL_DIR/scripts/codex_context_window.py" apply --json
The script:
model_context_window and
model_auto_compact_token_limit keys.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.
verifyRun 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
expansion preset. A deliberate custom threshold can differ from that preset; this
is not proof that the saved threshold is invalid. Use show for its current base value.
uv run --no-project python "$SKILL_DIR/scripts/codex_context_window.py" verify --json
For a threshold-only change, report previous → saved tokens, backup path when
changed, local configuration-load result and independent readback. Keep
session_adoption: unverified until the actual consumer supplies evidence. Ask
the user to start a new CLI thread or restart/open a new Desktop thread that reads
this base config; do not claim the running thread changed. Profile and -c
overrides can still supersede it.
For expansion, copy exact values from script output. Include:
restart_required: true after a changed apply.This Skill does not:
-c flags;Read references/context_window_contract.md when diagnosing model caps, usable-window display, or compaction semantics.
What SKILL.md sets; muted values are Claude Code's defaults
5 skills in this plugin
/codex-image-galleryStart or reuse a self-contained local web gallery for browsing Codex-generated images. Use when the user asks to browse Codex generated images, open a local image gallery, inspect ~/.codex/generated_images, view a Codex image output folder, or browse image files produced by Codex./design-style-pickerBatch-generate and compare visual design directions so a user can choose the style they actually want. Use when the user says they cannot describe an abstract visual style, asks for many style options, wants to choose from generated UI/design-system images, rejects outputs as too colorful/too dead/too generic, or needs an existing UI/design system evolved without discarding current assets.//daymade-codex:codex-1m-context-window-setup [show|set-compact --tokens N|doctor|apply|verify]from daymade-codex
npx claudepluginhub daymade/claude-code-skills --plugin daymade-codexOther plugins' skills for the same job