From openrouter-pack
Optimize token usage and context window management. Use when reducing costs or fitting more information into model context. Trigger with phrases like 'openrouter context', 'token optimization', 'context window', 'reduce tokens'.
How this skill is triggered — by the user, by Claude, or both
Slash command
/openrouter-pack:openrouter-context-optimizationThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
This skill covers techniques for managing token budgets, optimizing prompt length, and making the most of each model's context window.
This skill covers techniques for managing token budgets, optimizing prompt length, and making the most of each model's context window.
tiktoken (Python) or js-tiktoken (JS) to estimate token counts before making API calls; abort if the prompt exceeds the model's context limitmax_tokens to the minimum needed for your use case; shorter completions cost less and return faster| Error | Cause | Fix |
|---|---|---|
400 context_length_exceeded | Prompt + max_tokens exceeds model limit | Prune messages or switch to a model with a larger context window |
| Truncated responses | max_tokens set too low | Increase max_tokens or split the task into smaller requests |
| Token count mismatch | Wrong tokenizer for the model | Use the correct tokenizer per model family; fall back to rough estimation (1 token ~ 4 chars) |
See ${CLAUDE_SKILL_DIR}/references/errors.md for full error reference.
See ${CLAUDE_SKILL_DIR}/references/examples.md for runnable code samples.
npx claudepluginhub nickloveinvesting/nick-love-plugins --plugin openrouter-packOptimizes OpenRouter context with token estimation, model selection, conversation trimming, and chunking for RAG systems. Fits limits in long chats to cut costs.
Guides LLM context optimization with token budgeting, placement effects, RAG patterns, prompt caching, compression, and multi-turn strategies. Use for context windows, budgets, overflow, and long contexts.
Provides strategies for managing LLM context windows via summarization, trimming, routing, token-counting, prioritization, and serial position optimization. Useful for multi-turn conversations and long prompts.