本文へ移動
cccskills
無料GitHub で公開

codex-1m-context-window-setup

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.

インストール方法を見る

含まれるファイル(4)

  • SKILL.md4.6 KB
  • references/context_window_contract.md3.2 KB
  • scripts/codex_context_window.py16.8 KB
  • tests/test_codex_context_window.py11.8 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

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:

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 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.

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

Fixes web search on an agent whose model backend can't run it: a relay/reseller proxying Claude or Codex returns empty instead of failing. Use when web search returns nothing, a model insists a shipped product doesn't exist, someone wants to give an agent internet access, or the user is on a third-party base URL, relay, or 中转站. Diagnoses which built-in tools are dead, removes them, and installs a working replacement.

日本語の概要は準備中です。原文の説明を表示しています。

daymade/claude-code-skills1,4512026年10月11日 更新

抓取 A 股消息面情报:从财联社、华尔街见闻、金十、新浪 7x24、东财快讯、 证监会/央行/上交所/财政部政策公告、东方财富股吧等公开来源抓取与股票相关的 新闻、政策、情绪,输出结构化 JSON 或 Markdown。 当用户提到“A 股消息面”、“抓新闻”、“个股消息”、“政策监管”、“股吧情绪”、 “财联社”、“东财快讯”、“市场情绪”或需要把某只股票相关的公开情报聚合出来时 触发。也适用于“帮我看看 000001 最近有什么消息”这类口语化请求。

日本語の概要は準備中です。原文の説明を表示しています。

daymade/claude-code-skills1,4512026年10月11日 更新

Transcribes audio or video to speaker-labeled, timestamped text, locally with MLX on Apple Silicon or remotely. Use for 转录 / 录音转文字 / 说话人分离 / 字幕, and also for preparing audio for ASR without transcribing: 转格式, 降采样到 16kHz, merging recorder segments, or compressing and speeding up audio before 飞书妙记 — even when it looks like a one-line ffmpeg job.

日本語の概要は準備中です。原文の説明を表示しています。

daymade/claude-code-skills1,4512026年10月11日 更新

Routes audio: StepFun ASR/语音识别, StepFun TTS/配音, transcript/妙记→会议纪要, merge/review minutes. Reads one bundled specialist; generic ASR and correction stay direct.

日本語の概要は準備中です。原文の説明を表示しています。

daymade/claude-code-skills1,4512026年10月11日 更新

Diagnoses and repairs repository setup and guarded Git workflows for Claude Code or Codex — environment repair, startup sync, hook auditing, collaborator handoff. Use when a repo won't run, a teammate onboards, hook output duplicates, or commit/push/conflict needs guarding. Not for lost-commit recovery (use git-safety-net), GitHub ops (use github-ops), or history scrubbing (use github-sensitive-data-cleanup).

日本語の概要は準備中です。原文の説明を表示しています。

daymade/claude-code-skills1,4512026年10月11日 更新

Runs adversarial due-diligence on a benchmark the user envies — a founder, KOL, company, or product whose success looks inflated — splitting marketing bubble from real signal, then mapping the validated playbook onto the user's own resources. Use for 尽调/对标/拆解 a competitor, 抄/偷师 their playbook, or suspecting 水分/泡沫 in claims. Prefer over deep-research when debunking inflated claims, not a neutral briefing.

日本語の概要は準備中です。原文の説明を表示しています。

daymade/claude-code-skills1,4512026年10月11日 更新

daymade のスキルをすべて見る

このスキルの問題を報告する