Openrouter Context Optimization
jeremylongshore/tons-of-skills-marketplace
Optimize context window usage for OpenRouter models to reduce cost and improve quality.
Configure token budget limits, auto-compact settings, and view current budget status (model-aware — Claude 5 lineup, Opus 5.5 default fallback, full 1M context at standard price)
$ npx skills add egorfedorov/claude-context-optimizer --skill cco-budget -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install egorfedorov/claude-context-optimizer cco-budget --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/egorfedorov/claude-context-optimizer.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/cco-budget .claude/skills/cco-budget && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "cco-budget" agent skill from https://github.com/egorfedorov/claude-context-optimizer/tree/main/skills/cco-budget into .claude/skills/cco-budget/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "cco-budget", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/egorfedorov/claude-context-optimizer/tree/main/skills/cco-budgetType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add egorfedorov/claude-context-optimizer --skill cco-budget -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install egorfedorov/claude-context-optimizer cco-budget --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/egorfedorov/claude-context-optimizer.git skills-src && mkdir -p .agents/skills && cp -r skills-src/skills/cco-budget .agents/skills/cco-budget && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "cco-budget" agent skill from https://github.com/egorfedorov/claude-context-optimizer/tree/main/skills/cco-budget into .agents/skills/cco-budget/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "cco-budget", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add egorfedorov/claude-context-optimizer --skill cco-budget -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install egorfedorov/claude-context-optimizer cco-budget --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/egorfedorov/claude-context-optimizer.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/skills/cco-budget .cursor/skills/cco-budget && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "cco-budget" agent skill from https://github.com/egorfedorov/claude-context-optimizer/tree/main/skills/cco-budget into .cursor/skills/cco-budget/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "cco-budget", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/egorfedorov/claude-context-optimizer.git --path skills/cco-budget--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add egorfedorov/claude-context-optimizer --skill cco-budget -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install egorfedorov/claude-context-optimizer cco-budget --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/egorfedorov/claude-context-optimizer.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/skills/cco-budget .gemini/skills/cco-budget && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "cco-budget" agent skill from https://github.com/egorfedorov/claude-context-optimizer/tree/main/skills/cco-budget into .gemini/skills/cco-budget/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "cco-budget", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install egorfedorov/claude-context-optimizer cco-budgetInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add egorfedorov/claude-context-optimizer --skill cco-budget -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/egorfedorov/claude-context-optimizer.git skills-src && mkdir -p .github/skills && cp -r skills-src/skills/cco-budget .github/skills/cco-budget && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "cco-budget" agent skill from https://github.com/egorfedorov/claude-context-optimizer/tree/main/skills/cco-budget into .github/skills/cco-budget/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "cco-budget", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add egorfedorov/claude-context-optimizer --skill cco-budget -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install egorfedorov/claude-context-optimizer cco-budget --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/egorfedorov/claude-context-optimizer.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/skills/cco-budget .opencode/skills/cco-budget && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "cco-budget" agent skill from https://github.com/egorfedorov/claude-context-optimizer/tree/main/skills/cco-budget into .opencode/skills/cco-budget/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "cco-budget", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
cco-budgetConfigure token budget limits, auto-compact settings, and view current budget status (model-aware — Claude 5 lineup, Opus 5.5 default fallback, full 1M context at standard price)
Cco Budget is an agent skill from egorfedorov/claude-context-optimizer. Configure token budget limits, auto-compact settings, and view current budget status (model-aware — Claude 5 lineup, Opus 5.5 default fallback, full 1M context at standard price)
Its SKILL.md is about 810 tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.
It sits in AI & LLM Engineering, covering LLM cost and token optimization and Context engineering. The repository describes itself as: Claude Code plugin that tracks token usage, identifies wasted context, and saves 30-50% on API costs. Heatmaps, ROI reports, budget alerts, efficiency scores, git-aware… The licence is MIT.
Read from SKILL.md and the folder at commit f6f20ee. It shows what the files ask for, not the result of running them.
Pre-approves these tools, so the agent can use them without asking each time:
ReadFrom allowed-tools in the SKILL.md frontmatter.
No scripts in the folder and no shell commands in SKILL.md (its code samples are json).
From the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Cco Budget loads about 808 tokens when it runs. Until then it costs about 47 tokens; SKILL.md has 354 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from egorfedorov/claude-context-optimizer at commit f6f20ee, republished under its MIT licence (© egorfedorov). 354 words, ~808 tokens.
.claude/skills/cco-budget/SKILL.md (or your agent's skills folder).Manage the token budget for Claude Code sessions. Model-aware — picks the right
effective context window and prices per model. The session's REAL model is read
from the transcript by the budget hook; config.model is only the fallback.
Everything from Sonnet 4.6 up is 1M; Haiku 4.5 is 200K.
Parse $ARGUMENTS:
status (or no arguments)Show current budget config + auto-compact settings: Read
~/.claude-context-optimizer/config.json and
~/.claude-context-optimizer/budget-config.json (either may be missing).
If no config exists, show defaults (200K working budget on a 1M window, opus-5.5 fallback model, warn at 50/70/85/95%).
set <tokens>Update the budget limit. Parse the token count (200K, 1M, 500000 all OK).
Update ~/.claude-context-optimizer/config.json (the user approves the write):
{
"budgetTokens": <parsed_number>,
"warnAt": [50, 70, 85, 95],
"autoCompactAt": 90,
"model": "opus-5.5"
}If budgetTokens exceeds the chosen model's context window, warn the user.
model <name>Set the FALLBACK model for cost estimation (used only when a session's transcript has no model id yet). Supported keys:
haiku-4.5 (alias haiku) — $1/$5 per M, 200Ksonnet-4.6 (alias sonnet) — $3/$15 per M, 1Msonnet-5 — $2/$10 per M, 1Msonnet-5.5 — $2/$10 per M, 1Mopus-4.7 / opus-4.8 — $5/$25 per M, 1Mopus-5 (alias opus) — $5/$25 per M, 1Mopus-5.5 (default) — $4/$20 per M, 1M, cache reads at 0.05×fable-5 — $10/$50 per M, 1Mfable-5.1 (alias fable) — $10/$50 per M, 1M, cache reads at 0.025× (vs 0.1× elsewhere)opus-4.8-1m / opus-4.7-1m / opus-extended are back-compat aliases only — there is
no 1M surcharge; the 1M window is standard at $5/$25.
Update the model field in config.json. When switching to a 1M-context model and the
current budgetTokens is below 500K, ask if the user wants to bump it to 1M.
auto <on|off>Toggle auto-compact at thresholds (80% / 90%). Update
~/.claude-context-optimizer/budget-config.json:
auto on → autoCompactEnabled: trueauto off → autoCompactEnabled: falseDefaults if file missing:
{
"autoCompactEnabled": true,
"autoCompactThreshold": 80,
"criticalThreshold": 90
}The budget monitor now estimates input + output tokens separately and uses
the model's real input/output prices. Example: Edit with a 200-char new_string
counts as ~54 output tokens, charged at the model's output rate.
At 50%+ budget usage, the monitor shows how much CCO multiplies your effective budget — e.g. "1.6x more effective" if Read Cache + file digests saved enough redundant reads to make your 200K context behave like ~320K.
© egorfedorov, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
Just SKILL.md in skills/cco-budget of egorfedorov/claude-context-optimizer.
Open the folder on GitHubat commit f6f20ee
Cco Budget next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Cco Budget this skillegorfedorov/claude-context-optimizer | 114 | — | ~808 | Automated safety check: Pass | MIT | |
| Openrouter Context Optimizationjeremylongshore/tons-of-skills-marketplace | 2.8k | — | ~2.4k | Automated safety check: Pass | MIT | |
| Context Engineering Reviewmohitagw15856/pm-claude-skills | 1.4k | — | ~1.4k | Automated safety check: Pass | MIT | |
| Context Compressionseb1n/awesome-ai-agent-skills | 206 | — | ~2.2k | Automated safety check: Pass | MIT | |
| Agents Best PracticesDenisSergeevitch/agents-best-practices | 2.4k | — | ~7.4k | Automated safety check: Pass | MIT | |
| OmniRoute RTK Context Filtersdiegosouzapw/OmniRoute | 75k | — | ~618 | Automated safety check: Pass | MIT |
jeremylongshore/tons-of-skills-marketplace
Optimize context window usage for OpenRouter models to reduce cost and improve quality.
mohitagw15856/pm-claude-skills
Review what an LLM feature or agent actually puts in its context window — and find what's bloating, missing, or fighting itself.
seb1n/awesome-ai-agent-skills
Compress selected context to a target token budget while preserving decisions, evidence, constraints, and unresolved questions.
DenisSergeevitch/agents-best-practices
A skill your agent uses when designing, generating an MVP blueprint for, auditing, troubleshooting, refactoring, or explaining an agentic harness for any domain.
diegosouzapw/OmniRoute
Controls the RTK filter set and context-handling settings in OmniRoute, with endpoints to try compression on sample text and read back retained output.
cwinvestments/memstack
A skill your agent uses when the user says 'token optimization', 'save tokens', 'context window', 'reduce tokens', 'token stack', or 'TokenStack', or asks about extending context window capacity.
egorfedorov/claude-context-optimizer
Automatically suggests optimal files to preload based on the user's task description and historical context patterns.
egorfedorov/claude-context-optimizer
Context Control Center — one screen for budget, $ spent, tokens saved, waste, last prompt grade, the active task, and ready-to-run optimization actions
egorfedorov/claude-context-optimizer
View and tune CCO's behavior thresholds — re-read warnings, cache staleness, prompt-coach length bands, and the /cco-pack budget cap
egorfedorov/claude-context-optimizer
Share learned file patterns across a team — export an anonymized digest of what's usually waste/useful/co-edited, and import a teammate's so a fresh clone benefits day one
egorfedorov/claude-context-optimizer
Show ContextShield status and waste protection stats; suggest or apply .contextignore rules from historical waste
egorfedorov/claude-context-optimizer
Organize work by task, track tokens/cost per task, and keep a small patchable execution state that is re-injected after /compact (SKILL.state-style) — start a task, patch its state, list tasks, or…
Categories
Configure token budget limits, auto-compact settings, and view current budget status (model-aware — Claude 5 lineup, Opus 5.5 default fallback, full 1M context at standard price). Cco Budget is an agent skill from egorfedorov/claude-context-optimizer.
Cco Budget fits situations like: tasks that involve LLM cost and token optimization; tasks that involve Context engineering.
Run `npx skills add egorfedorov/claude-context-optimizer --skill cco-budget -a claude-code`. Or copy the skill folder (skills/cco-budget in egorfedorov/claude-context-optimizer) into .claude/skills/cco-budget in your project. Claude Code loads it when a task matches its description.
Run `npx skills add egorfedorov/claude-context-optimizer --skill cco-budget -a codex`. Or copy the skill folder (skills/cco-budget in egorfedorov/claude-context-optimizer) into .agents/skills/cco-budget in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add egorfedorov/claude-context-optimizer --skill cco-budget -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/cco-budget, .gemini/skills/cco-budget, .github/skills/cco-budget and .opencode/skills/cco-budget in your project.
SKILL.md names no scripts, command-line tools or credentials: Cco Budget is instructions for the agent only. Its frontmatter pre-approves these tools: Read.
SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Cco Budget is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.
About 808 tokens (SKILL.md is roughly 3.2k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Cco Budget: Openrouter Context Optimization (jeremylongshore/tons-of-skills-marketplace, 2.8k stars), Context Engineering Review (mohitagw15856/pm-claude-skills, 1.4k stars), Context Compression (seb1n/awesome-ai-agent-skills, 206 stars) and Agents Best Practices (DenisSergeevitch/agents-best-practices, 2.4k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
egorfedorov (a GitHub user) maintains it in egorfedorov/claude-context-optimizer, which has 114 GitHub stars. The repository holds 13 skills in this directory. The repository was last updated on September 30, 2026.
Source: egorfedorov/claude-context-optimizer on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.