Available in
Marketplaces, most starred first
Tags
Add to README
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
By viktorbezdekv1.0.11MITIn 1 marketplace
Guides an agent through reducing context bloat with observation masking, compaction, KV-cache-friendly prompt ordering and sub-agent partitioning.
Trending plugins
7-day copy clicks
Claude loads one when your task matches it, or you run it by name.
1 marketplace, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
v1.0.11 | Context Engineering | 5 iterations
Double or triple your agent's effective context capacity through compaction, observation masking, KV-cache optimization, and context partitioning -- without switching to a larger model. Single skill + 1 reference document | 13 trigger evals, 3 output evals
AI agent systems hit context limits long before their context windows technically fill up. An agent with a 200K-token window starts degrading at 80K tokens. Tool outputs silently consume 80%+ of the available space. Repeated prompts with identical prefixes waste computation that could be cached. The result: agents that could handle 3x more complex tasks if their context were managed efficiently.
Most teams respond to context limits by upgrading to larger-window models -- a solution that costs more, often degrades quality (larger windows have their own failure modes), and does not address the fundamental efficiency problem. A 200K-token window used at 30% efficiency gives you 60K tokens of effective capacity. The same window used at 80% efficiency gives you 160K tokens. Optimization yields more effective capacity than model upgrades at a fraction of the cost.
The specific waste patterns are well-understood but poorly addressed. Tool outputs from completed tasks linger in context consuming attention budget. Identical system prompts and tool definitions are recomputed from scratch on every request despite being unchanged. Growing message history is carried in full when most of it could be summarized. Monolithic contexts force a single agent to juggle multiple concerns when partitioned sub-agents would each operate in a clean, focused window.
This plugin provides four production-tested optimization techniques -- compaction (summarizing context near limits), observation masking (replacing verbose tool outputs with compact references), KV-cache optimization (reusing cached computations for stable prefixes), and context partitioning (splitting work across isolated sub-agent contexts). Each technique targets a different source of waste, and they compose: applying all four can double or triple effective context capacity without changing models.
The skill includes a decision framework for selecting which technique to apply based on context composition (which component dominates usage), trigger-based optimization (monitoring signals that indicate when to optimize), and performance benchmarks (compaction achieves 50-70% reduction, masking achieves 60-80% reduction on masked observations, cache optimization achieves 70%+ hit rates for stable workloads).
| Without this plugin | With this plugin |
|---|---|
| Tool outputs from 20 turns ago still consume context despite being irrelevant | Observation masking replaces completed tool outputs with compact references (60-80% reduction) |
| Every API request recomputes the system prompt and tool definitions from scratch | KV-cache optimization reuses cached computations for stable prefixes (70%+ cache hit rate) |
| Context hits limits; response is to upgrade to a more expensive model | Compaction and masking double effective capacity on the existing model at no additional cost |
| Single agent juggles 5 different tasks in one growing context | Context partitioning isolates tasks in sub-agent windows, each operating in clean focused context |
| No framework for deciding when to optimize or which technique to apply | Trigger-based optimization monitors utilization and applies techniques based on context composition |
| Context optimization is ad hoc -- each developer invents their own approach | Systematic framework: measure, diagnose what dominates, apply the matching technique, verify improvement |
Optimization decisions depend heavily on what fills the context and at what utilization level quality degrades. Generic "make it faster" requests produce generic guidance. Providing your context composition breakdown unlocks targeted recommendations that match the specific waste pattern.
What to include in your prompt:
Built from public signals: copy clicks on this site, GitHub stars and activity, the README and the manifest. Not a security audit or an endorsement.
npx claudepluginhub viktorbezdek/skillstack --plugin context-optimizationPlugins from other owners that cover similar ground