codex-1m-context-window-setup
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.
Install / Use
npx skills add daymade/claude-code-skills --skill codex-1m-context-window-setupInstalls into whichever agent you are using.
SKILL.md
Installable skill definition
Quality Score
Category
AutomationSupported Platforms
Tags
Our assessment of codex-1m-context-window-setup
codex-1m-context-window-setup scores 87/100 on our quality scale, 1669th of 2,780 Automation skills we index.
Its SKILL.md is 4.6 KB long, well organised into 8 sections with 2 code examples: a solid amount of guidance for an agent.
With 1,426 GitHub stars, it is one of the more widely adopted skills in the catalogue.
Maintenance, license and trust
- The repository was last updated about 2 months ago, so codex-1m-context-window-setup is actively maintained.
- Our last check on 2026-11-06 found the source still online.
- It is released under the MIT license, a permissive license that allows use, modification and commercial use with attribution.
- Its trust signals score 100/100, with no cautions. These come from repository metadata, not a code audit — read the skill file before letting an agent act on it.
Safety scan
No issues foundOur scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. An AI review of the same text found nothing harmful.
AI review by kimi-k2.7-code on 2026-10-01. Automated pattern scan on 2026-10-01. It catches known dangerous patterns, not every risk — read a skill before letting an agent act on it.
codex-1m-context-window-setup compared with similar skills
All 4 of these similar skills score higher than codex-1m-context-window-setup; compare them before choosing.
| Skill | Score | Stars | Updated | Format |
|---|---|---|---|---|
| codex-1m-context-window-setup (this skill)by daymade | 87 | 1.4k | 53d ago | SKILL.md |
| Agent-Reachby Panniantong | 100 | 112.3k | 9d ago | CLAUDE.md |
| rufloby ruvnet | 100 | 81.9k | today | CLAUDE.md |
| Claude-Code-Game-Studiosby Donchitos | 100 | 39.7k | 7d ago | CLAUDE.md |
| Scraplingby D4Vinci | 100 | 103.6k | 2d ago | MCP Server |
Frequently asked questions
- How do I install codex-1m-context-window-setup?
- Run
npx skills add daymade/claude-code-skills --skill codex-1m-context-window-setup. The install tabs above show the steps for each supported agent. - Which AI agents does codex-1m-context-window-setup work with?
- It is written for OpenAI Codex, as a SKILL.md file. Other agents that read the same format can often use it too.
- Is codex-1m-context-window-setup safe to use?
- Our scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. An AI review of the same text found nothing harmful. It is MIT-licensed and scores 100/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
- Is codex-1m-context-window-setup still maintained?
- The repository was last updated about 2 months ago, so codex-1m-context-window-setup is actively maintained.
Skill content
View source on GitHubname: codex-1m-context-window-setup description: >- Configures and verifies an expanded, model-aware context window for OpenAI Codex CLI and Desktop. Use when Codex shows ~258K context, you want 500K or 1M tokens, auto-compaction fires too often, or model_context_window/model_auto_compact_token_limit needs repair. Not for changing the selected model or other Codex settings. argument-hint: "[doctor|apply|verify]"
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 intent | Action |
|---|---|
| Inspect the current limit, explain 258K, or preview the recommendation | 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 |
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.mdfrom this Skill'sfile: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:
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:
$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
applyis needed; - exact
$CODEX_HOME/config.tomltarget.
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:
- Re-reads the live model contract.
- Changes only the top-level
model_context_windowandmodel_auto_compact_token_limitkeys. - Creates a content-addressed backup only when bytes will change.
- Uses an atomic same-directory replace and refuses to overwrite a concurrently changed config.
- Runs Codex strict-config diagnostics; a failure restores the exact prior bytes.
- 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: trueafter 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
-cflags; - 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.
Related Skills
Agent-Reach
112.3kGive your AI agent eyes to see the entire internet. Read & search Twitter, Reddit, YouTube, GitHub, Bilibili, XiaoHongShu — one CLI, zero API fees.
ruflo
81.9k🌊 The original agent harness. Deploy intelligent multi-player swarms, coordinate autonomous workflows, and build conversational AI systems. Features adaptive memory, self-learning intelligence, federation, vector RAG integration, and native Claude Code / Codex / Hermes and many more Integrated
Claude-Code-Game-Studios
39.7kTurn Claude Code into a full game dev studio — 49 AI agents, 72 workflow skills, and a complete coordination system mirroring real studio hierarchy.
Scrapling
103.6k🕷️ The BEST Web Scraping framework that handles everything from a single request to a full-scale crawl! Don't be shy, join here: https://discord.gg/EMgGbDceNQ and follow here for daily tips and tricks: https://x.com/Scrapling_dev
Languages
Trust signals
From repository metadata: license, adoption, age and documentation. Not a code audit — see the Safety scan above for what the skill file itself contains.
