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'.
From openrouter-packnpx claudepluginhub nickloveinvesting/nick-love-plugins --plugin openrouter-packThis skill is limited to using the following tools:
references/context-recycling.mdreferences/context-truncation.mdreferences/efficient-message-patterns.mdreferences/errors.mdreferences/examples.mdreferences/model-specific-optimization.mdreferences/prompt-optimization.mdreferences/response-length-control.mdreferences/token-estimation.mdGuides Next.js Cache Components and Partial Prerendering (PPR) with cacheComponents enabled. Implements 'use cache', cacheLife(), cacheTag(), revalidateTag(), static/dynamic optimization, and cache debugging.
Migrates code, prompts, and API calls from Claude Sonnet 4.0/4.5 or Opus 4.1 to Opus 4.5, updating model strings on Anthropic, AWS, GCP, Azure platforms.
Details PluginEval's skill quality evaluation: 3 layers (static, LLM judge), 10 dimensions, rubrics, formulas, anti-patterns, badges. Use to interpret scores, improve triggering, calibrate thresholds.
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.