Agent skill · Code Review & Quality

context-optimization

This skill should be used for improving context efficiency: context budgeting, observation masking, prefix or KV-cache strategy, partitioning, token-cost reduction, retrieval scoping, and extending effective context capacity without lowering answer quality.

guanyanggithub.com/guanyangGitHub ↗
claude-codeships scriptsMIT
Install
npx skills add guanyang/open-agent-hub --skill context-optimization --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 3
SKILL.md size: 15 KB
Bundled scripts: yes
Path: skills/context-optimization/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 940
Language: TypeScript

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# Context Optimization Techniques Context optimization extends the effective capacity of limited context windows through strategic compression, masking, caching, and partitioning. Effective optimization increases useful capacity without requiring larger models or longer windows — but only when applied with measurement discipline. The techniques below are ordered by impact and risk. ## When to Activate Activate this skill when: - Context budgets or token costs constrain task complexity - Observation masking can replace verbose tool outputs with retrievable references - Prefix or KV-cache hit rate needs improvement - Retrieval scoping can reduce irrelevant loaded context - Context partitioning can extend effective capacity across agents - Budget triggers are needed for masking, compaction, or partitioning Do not activate this skill for adjacent work owned by other skills: - Explaining why attention or context windows behave this way: `context-fundamentals`. - Diagnosing active lost-in-middle, poisoning, distraction, confusion, or clash: `context-degradation`. - Designing a structured handoff summary for a long conversation: `context-compression`. - Storing large outputs, plans, or lo

What's inside
Steps it walks through
  1. When to Activate
  2. Core Concepts
  3. Detailed Topics
  4. Compaction Strategies
  5. Observation Masking
  6. KV-Cache Optimization
  7. Context Partitioning
  8. Budget Management
  9. Practical Guidance
  10. Optimization Decision Framework
  11. Performance Targets
  12. Examples
  13. Guidelines
  14. Gotchas
Ships with 2 files
  • references/optimization_techniques.md
  • scripts/compaction.py
More from open-agent-hub
All skills →
About this skill
What does the context-optimization skill do?

This skill should be used for improving context efficiency: context budgeting, observation masking, prefix or KV-cache strategy, partitioning, token-cost reduction, retrieval scoping, and extending effective context capacity without lowering answer quality.

How do I install it?

Run `npx skills add guanyang/open-agent-hub --skill context-optimization --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From guanyang/open-agent-hub, a repository with 940 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going