Openrouter Context Optimization
jeremylongshore/tons-of-skills-marketplace
Optimize context window usage for OpenRouter models to reduce cost and improve quality.
Fetch trending programming models from OpenRouter rankings. An agent skill from MadAppGang/claude-code.
$ npx skills add MadAppGang/claude-code --skill openrouter-trending-models -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install MadAppGang/claude-code openrouter-trending-models --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/MadAppGang/claude-code.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/openrouter-trending-models .claude/skills/openrouter-trending-models && 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 "openrouter-trending-models" agent skill from https://github.com/MadAppGang/claude-code/tree/main/skills/openrouter-trending-models into .claude/skills/openrouter-trending-models/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "openrouter-trending-models", 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/MadAppGang/claude-code/tree/main/skills/openrouter-trending-modelsType 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 MadAppGang/claude-code --skill openrouter-trending-models -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install MadAppGang/claude-code openrouter-trending-models --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/MadAppGang/claude-code.git skills-src && mkdir -p .agents/skills && cp -r skills-src/skills/openrouter-trending-models .agents/skills/openrouter-trending-models && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "openrouter-trending-models" agent skill from https://github.com/MadAppGang/claude-code/tree/main/skills/openrouter-trending-models into .agents/skills/openrouter-trending-models/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "openrouter-trending-models", 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 MadAppGang/claude-code --skill openrouter-trending-models -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install MadAppGang/claude-code openrouter-trending-models --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/MadAppGang/claude-code.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/skills/openrouter-trending-models .cursor/skills/openrouter-trending-models && 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 "openrouter-trending-models" agent skill from https://github.com/MadAppGang/claude-code/tree/main/skills/openrouter-trending-models into .cursor/skills/openrouter-trending-models/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "openrouter-trending-models", 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/MadAppGang/claude-code.git --path skills/openrouter-trending-models--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 MadAppGang/claude-code --skill openrouter-trending-models -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install MadAppGang/claude-code openrouter-trending-models --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/MadAppGang/claude-code.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/skills/openrouter-trending-models .gemini/skills/openrouter-trending-models && 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 "openrouter-trending-models" agent skill from https://github.com/MadAppGang/claude-code/tree/main/skills/openrouter-trending-models into .gemini/skills/openrouter-trending-models/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "openrouter-trending-models", 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 MadAppGang/claude-code openrouter-trending-modelsInstalls 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 MadAppGang/claude-code --skill openrouter-trending-models -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/MadAppGang/claude-code.git skills-src && mkdir -p .github/skills && cp -r skills-src/skills/openrouter-trending-models .github/skills/openrouter-trending-models && 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 "openrouter-trending-models" agent skill from https://github.com/MadAppGang/claude-code/tree/main/skills/openrouter-trending-models into .github/skills/openrouter-trending-models/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "openrouter-trending-models", 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 MadAppGang/claude-code --skill openrouter-trending-models -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install MadAppGang/claude-code openrouter-trending-models --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/MadAppGang/claude-code.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/skills/openrouter-trending-models .opencode/skills/openrouter-trending-models && 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 "openrouter-trending-models" agent skill from https://github.com/MadAppGang/claude-code/tree/main/skills/openrouter-trending-models into .opencode/skills/openrouter-trending-models/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "openrouter-trending-models", 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.
openrouter-trending-modelsFetch trending programming models from OpenRouter rankings. An agent skill from MadAppGang/claude-code.
Openrouter Trending Models is an agent skill from MadAppGang/claude-code. Fetch trending programming models from OpenRouter rankings. Use when selecting models for multi-model review, updating model recommendations, or researching current AI coding trends. Provides model IDs, context windows, pricing, and usage statistics from the most recent week.
Its SKILL.md is about 3.6k 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 Model routing and gateways and Context engineering. It works with OpenRouter. The repository describes itself as: claude code plugins marketplace. The licence is MIT.
5 steps, taken from the first numbered list in SKILL.md.
Read from SKILL.md and the folder at commit 6097ad4. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
Shell commands in SKILL.md call:
bunjqcurlFrom the folder's file list and the shell code blocks in SKILL.md.
Hosts in commands or code, which the agent is likely to contact:
openrouter.aiFrom 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.
Openrouter Trending Models loads about 3.6k tokens when it runs. Until then it costs about 76 tokens; SKILL.md has 839 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 MadAppGang/claude-code at commit 6097ad4, republished under its MIT licence (© MadAppGang). 839 words, ~3,571 tokens.
.claude/skills/openrouter-trending-models/SKILL.md (or your agent's skills folder).This skill provides access to current trending programming models from OpenRouter's public rankings. It executes a Bun script that fetches, parses, and structures data about the top 9 most-used AI models for programming tasks.
What you get:
x-ai/grok-code-fast-1)Data Source:
Update Frequency: Weekly (OpenRouter updates rankings every week)
Use this skill when you need to:
Select models for multi-model review
Research AI coding trends
Update plugin documentation
Cost optimization
Model recommendations
Basic Usage:
bun run scripts/get-trending-models.tsOutput to File:
bun run scripts/get-trending-models.ts > trending-models.jsonPretty Print:
bun run scripts/get-trending-models.ts | jq '.'Help:
bun run scripts/get-trending-models.ts --helpThe script outputs structured JSON to stdout:
{
"metadata": {
"fetchedAt": "2025-11-14T10:30:00.000Z",
"weekEnding": "2025-11-10",
"category": "programming",
"view": "trending"
},
"models": [
{
"rank": 1,
"id": "x-ai/grok-code-fast-1",
"name": "Grok Code Fast",
"tokenUsage": 908664328688,
"contextLength": 131072,
"maxCompletionTokens": 32768,
"pricing": {
"prompt": 0.0000005,
"completion": 0.000001,
"promptPer1M": 0.5,
"completionPer1M": 1.0
}
}
// ... 8 more models
],
"summary": {
"totalTokens": 4500000000000,
"topProvider": "x-ai",
"averageContextLength": 98304,
"priceRange": {
"min": 0.5,
"max": 15.0,
"unit": "USD per 1M tokens"
}
}
}Typical execution: 2-5 seconds
{
fetchedAt: string; // ISO 8601 timestamp of when data was fetched
weekEnding: string; // YYYY-MM-DD format, end of ranking week
category: "programming"; // Fixed category
view: "trending"; // Fixed view type
}Each model contains:
{
rank: number; // 1-9, position in trending list
id: string; // OpenRouter model ID (e.g., "x-ai/grok-code-fast-1")
name: string; // Human-readable name (e.g., "Grok Code Fast")
tokenUsage: number; // Total tokens used last week
contextLength: number; // Maximum input tokens
maxCompletionTokens: number; // Maximum output tokens
pricing: {
prompt: number; // Per-token input cost (USD)
completion: number; // Per-token output cost (USD)
promptPer1M: number; // Input cost per 1M tokens (USD)
completionPer1M: number; // Output cost per 1M tokens (USD)
}
}{
totalTokens: number; // Sum of token usage across top 9 models
topProvider: string; // Most represented provider (e.g., "x-ai")
averageContextLength: number; // Average context window size
priceRange: {
min: number; // Lowest prompt price per 1M tokens
max: number; // Highest prompt price per 1M tokens
unit: "USD per 1M tokens";
}
}Scenario: Plan reviewer needs current trending models for multi-model review
# In plan-reviewer agent workflow
STEP 1: Fetch trending models
- Execute: Bash("bun run scripts/get-trending-models.ts > /tmp/trending-models.json")
- Read: /tmp/trending-models.json
STEP 2: Parse and present to user
- Extract top 3-5 models from models array
- Display with context and pricing info
- Let user select preferred model(s)
STEP 3: Use selected model for review
- Pass model ID to Claudish proxyImplementation:
// Agent reads output
const data = JSON.parse(bashOutput);
// Extract top 5 models
const topModels = data.models.slice(0, 5);
// Present to user
const modelList = topModels.map((m, i) =>
`${i + 1}. **${m.name}** (\`${m.id}\`)
- Context: ${m.contextLength.toLocaleString()} tokens
- Pricing: $${m.pricing.promptPer1M}/1M input
- Usage: ${(m.tokenUsage / 1e9).toFixed(1)}B tokens last week`
).join('\n\n');
// Ask user to select
const userChoice = await AskUserQuestion(`Select model for review:\n\n${modelList}`);Scenario: User wants high-context models at lowest cost
# Fetch models and filter with jq
bun run scripts/get-trending-models.ts | jq '
.models
| map(select(.contextLength > 100000))
| sort_by(.pricing.promptPer1M)
| .[:3]
| .[] | {
name,
id,
contextLength,
price: .pricing.promptPer1M
}
'Output:
{
"name": "Gemini 2.5 Flash",
"id": "google/gemini-2.5-flash",
"contextLength": 1000000,
"price": 0.075
}
{
"name": "Grok Code Fast",
"id": "x-ai/grok-code-fast-1",
"contextLength": 131072,
"price": 0.5
}Scenario: Automated weekly update of README model recommendations
# Fetch models
bun run scripts/get-trending-models.ts > trending.json
# Extract top 5 model names and IDs
jq -r '.models[:5] | .[] | "- `\(.id)` - \(.name) (\(.contextLength / 1024)K context, $\(.pricing.promptPer1M)/1M)"' trending.json
# Output (ready for README):
# - `x-ai/grok-code-fast-1` - Grok Code Fast (128K context, $0.5/1M)
# - `anthropic/claude-4.5-sonnet-20250929` - Claude 4.5 Sonnet (200K context, $3.0/1M)
# - `google/gemini-2.5-flash` - Gemini 2.5 Flash (976K context, $0.075/1M)Scenario: Identify when new models enter top 9
# Save current trending models
bun run scripts/get-trending-models.ts | jq '.models | map(.id)' > current.json
# Compare with previous week (saved as previous.json)
diff <(jq -r '.[]' previous.json | sort) <(jq -r '.[]' current.json | sort)
# Output shows new entries (>) and removed entries (<)Error Message:
✗ Error: Failed to fetch rankings: fetch failedPossible Causes:
Solutions:
curl -I https://openrouter.ai/rankings
# Should return HTTP 200Check URL in browser:
Check firewall/proxy:
# Test from command line
curl "https://openrouter.ai/rankings?category=programming&view=trending&_rsc=2nz0s"
# Should return HTML with embedded JSONError Message:
✗ Error: Failed to extract JSON from RSC formatCause: OpenRouter changed their page structure
Solutions:
curl "https://openrouter.ai/rankings?category=programming&view=trending&_rsc=2nz0s" | head -200Look for data pattern:
"data":[{ in output1b:)Update regex in script:
scripts/get-trending-models.tsfetchRankings() functionReport issue:
Warning Message:
Warning: Model x-ai/grok-code-fast-1 not found in API, using defaultsCause: Model ID in rankings doesn't match API
Impact: Model will have 0 values for context/pricing
Solutions:
curl "https://openrouter.ai/api/v1/models" | jq '.data[] | select(.id == "x-ai/grok-code-fast-1")'Check for ID mismatches:
Manual correction:
Symptom: Models seem outdated compared to OpenRouter site
Check data age:
jq '.metadata.fetchedAt' trending-models.json
# Compare with current dateSolutions:
bun run scripts/get-trending-models.ts > trending-models.jsonSet up weekly refresh:
0 0 * * 1 cd /path/to/repo && bun run scripts/get-trending-models.ts > skills/openrouter-trending-models/trending-models.jsonAdd staleness check in agents:
const data = JSON.parse(readFile("trending-models.json"));
const fetchedDate = new Date(data.metadata.fetchedAt);
const daysSinceUpdate = (Date.now() - fetchedDate.getTime()) / (1000 * 60 * 60 * 24);
if (daysSinceUpdate > 7) {
console.warn("Data is over 7 days old, consider refreshing");
}Recommended Update Schedule:
Staleness Guidelines:
When to cache:
How to cache:
bun run scripts/get-trending-models.ts > trending-models.jsonskills/openrouter-trending-models/)Cache invalidation:
# Check if cache is stale (> 7 days)
if [ $(find trending-models.json -mtime +7) ]; then
echo "Cache is stale, refreshing..."
bun run scripts/get-trending-models.ts > trending-models.json
fiGraceful degradation pattern:
1. Try to fetch fresh data
- Run: bun run scripts/get-trending-models.ts
- If succeeds: Use fresh data
- If fails: Continue to step 2
2. Try cached data
- Check if trending-models.json exists
- Check if < 14 days old
- If valid: Use cached data
- If not: Continue to step 3
3. Fallback to hardcoded models
- Use known good models from agent prompt
- Warn user data may be outdated
- Suggest manual refreshPattern 1: On-Demand (Fresh Data)
# Run before each use
bun run scripts/get-trending-models.ts > /tmp/models.json
# Read from /tmp/models.jsonPattern 2: Cached (Fast Access)
# Check cache age first
CACHE_FILE="skills/openrouter-trending-models/trending-models.json"
if [ ! -f "$CACHE_FILE" ] || [ $(find "$CACHE_FILE" -mtime +7) ]; then
bun run scripts/get-trending-models.ts > "$CACHE_FILE"
fi
# Read from cachePattern 3: Background Refresh (Non-Blocking)
# Start refresh in background (don't wait)
bun run scripts/get-trending-models.ts > trending-models.json &
# Continue with workflow
# Use cached data if available
# Fresh data will be ready for next runSkill Version: 1.0.0 Last Updated: November 14, 2025 Maintenance: Weekly refresh recommended Dependencies: Bun runtime, internet connection
© MadAppGang, 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/openrouter-trending-models of MadAppGang/claude-code.
Open the folder on GitHubat commit 6097ad4
Openrouter Trending Models 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 |
|---|---|---|---|---|---|---|
| Openrouter Trending Models this skillMadAppGang/claude-code | 285 | — | ~3.6k | Automated safety check: Pass | MIT | |
| Openrouter Context Optimizationjeremylongshore/tons-of-skills-marketplace | 2.8k | — | ~2.4k | Automated safety check: Pass | MIT | |
| Claudish UsageMadAppGang/claudish | 1k | — | ~9k | Automated safety check: Pass | None | |
| Run Deep Swesickn33/agentic-awesome-skills | 47k | 1 repos | ~1.2k | Automated safety check: Pass | MIT | |
| QuorumDetrol/quorum-cli | 119 | — | ~807 | Automated safety check: Notes | Custom licence | |
| OpenCode Agent Provider for NanoClawnanocoai/nanoclaw | 31k | — | ~5k | Automated safety check: Notes | MIT |
jeremylongshore/tons-of-skills-marketplace
Optimize context window usage for OpenRouter models to reduce cost and improve quality.
MadAppGang/claudish
CRITICAL - Guide for using Claudish CLI ONLY through sub-agents to run Claude Code with any AI model (OpenRouter, Gemini, OpenAI, local models).
sickn33/agentic-awesome-skills
Run reproducible DeepSWE coding-agent benchmark evaluations through OpenRouter and mini-swe-agent.
Detrol/quorum-cli
Run a structured debate between agent CLIs (claude, codex, agy, grok) and the user's configured API or local models (OpenAI, Anthropic, Google, xAI, OpenRouter, Ollama and more) through the Quorum…
nanocoai/nanoclaw
Installs OpenCode as an optional NanoClaw agent runtime, reaching OpenRouter, OpenAI, Google, DeepSeek and others through OpenCode's own configuration.
Luciole-Studio/Misaka-Agent
Evolve prompts/regex/SQL/code with Imbue's evolution loop. An agent skill from Luciole-Studio/Misaka-Agent.
MadAppGang/claude-code
Content brief template and creation methodology for SEO-optimized content.
MadAppGang/claude-code
A skill your agent uses when detecting project technology stack from files/configs/directory structure, auto-loading framework-specific skills, or analyzing multi-stack fullstack projects (e.g…
MadAppGang/claude-code
On-page SEO optimization techniques including keyword density, meta tags, heading structure, and readability.
MadAppGang/claude-code
Techniques for expanding seed keywords and clustering by topic and intent.
MadAppGang/claude-code
SERP analysis techniques for intent classification, feature identification, and competitive intelligence.
MadAppGang/claude-code
A skill your agent uses when deciding whether to launch an agent, selecting which agent to use, or coordinating multiple agents.
Works with
Categories
Fetch trending programming models from OpenRouter rankings. An agent skill from MadAppGang/claude-code. Openrouter Trending Models is an agent skill from MadAppGang/claude-code. Fetch trending programming models from OpenRouter rankings.
Openrouter Trending Models fits situations like: selecting models for multi-model review; updating model recommendations; researching current AI coding trends.
Run `npx skills add MadAppGang/claude-code --skill openrouter-trending-models -a claude-code`. Or copy the skill folder (skills/openrouter-trending-models in MadAppGang/claude-code) into .claude/skills/openrouter-trending-models in your project. Claude Code loads it when a task matches its description.
Run `npx skills add MadAppGang/claude-code --skill openrouter-trending-models -a codex`. Or copy the skill folder (skills/openrouter-trending-models in MadAppGang/claude-code) into .agents/skills/openrouter-trending-models 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 MadAppGang/claude-code --skill openrouter-trending-models -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/openrouter-trending-models, .gemini/skills/openrouter-trending-models, .github/skills/openrouter-trending-models and .opencode/skills/openrouter-trending-models in your project.
Going by SKILL.md and its folder, Openrouter Trending Models needs the command-line tools its instructions call (bun, jq and curl).
SKILL.md names 1 domain. In commands or code: openrouter.ai; the agent is likely to contact it when it follows the instructions. 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.
Openrouter Trending Models is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 3.6k tokens (SKILL.md is roughly 14k 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 Openrouter Trending Models: Openrouter Context Optimization (jeremylongshore/tons-of-skills-marketplace, 2.8k stars), Claudish Usage (MadAppGang/claudish, 1k stars), Run Deep Swe (sickn33/agentic-awesome-skills, 47k stars) and Quorum (Detrol/quorum-cli, 119 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
MadAppGang (a GitHub organization) maintains it in MadAppGang/claude-code, which has 285 GitHub stars. The repository holds 69 skills in this directory. The repository was last updated on March 15, 2026.
Source: MadAppGang/claude-code on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.