Agent skill

Context Optimization

by guanyang in guanyang/open-agent-hub

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…

MITAuto-check passedAgent Workflows

Install Context Optimization

skills CLI
$ npx skills add guanyang/open-agent-hub --skill context-optimization -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install guanyang/open-agent-hub context-optimization --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/guanyang/open-agent-hub.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/context-optimization .claude/skills/context-optimization && rm -rf skills-src

Use ~/.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/

Facts

Skill name
context-optimization
GitHub stars
973
Used in
2 other repos
Token cost
~4k tokens
SKILL.md length
1,948 words
Files
3 (incl. scripts, references)
Skills in repo
26
Repo updated
First seen
Licence
MIT

At a glance

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…

  • Works in 4 steps: KV-cache optimization — Reorder and… → Observation masking — Replace verbose… → Compaction — Summarize accumulated… → …
  • Tasks that involve Context engineering
  • SKILL.md covers When to Activate, Core Concepts, Detailed Topics and Practical Guidance, plus 6 more sections
  • Runs Python scripts from its folder

What it does

Context Optimization is an agent skill from guanyang/open-agent-hub. 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.

Its SKILL.md is about 4k tokens, which your agent loads only when the skill is triggered. The skill folder holds 4 other files, including scripts and reference files (for example `references/optimization_techniques.md` and `scripts/compaction.py`).

It sits in Agent Workflows, covering Context engineering, LLM cost and token optimization and Caching. The repository describes itself as: A lightweight, zero-dependency CLI tool to manage and activate capabilities for AI coding assistants (such as Claude Code, Cursor, Trae, etc.). The licence is MIT.

When your agent uses it

  • Tasks that involve Context engineering
  • Tasks that involve LLM cost and token optimization
  • Tasks that involve Caching

Example prompts

  • “/context-optimization”

Requirements

  • Python 3

Workflow steps

4 steps, taken from the first numbered list in SKILL.md.

  1. KV-cache optimization — Reorder and stabilize prompt structure so the inference engine reuses cached Key/Value tensors. This is the…
  2. Observation masking — Replace verbose tool outputs with compact references once their purpose has been served. Tool outputs can dominate…
  3. Compaction — Summarize accumulated context when utilization exceeds 70%, then reinitialize with the summary. This distills the window's…
  4. Context partitioning — Split work across sub-agents with isolated contexts when a single window cannot hold the full problem. Each…

What it can do on your machine

Read from SKILL.md and the folder at commit c32921b. It shows what the files ask for, not the result of running them.

  • Tool permissions

    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.

  • Runs code

    Ships 1 file in scripts/ (Python), which the agent can run.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Context Optimization loads about 4k tokens when it runs, and up to ~6.3k if it reads all its reference files. Until then it costs about 70 tokens; SKILL.md has 1,948 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~70
When it runs · the whole SKILL.md, loaded when a task matches
~4k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~6.3k

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.

Safety

Auto-check passed

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); the scripts in this folder are not scanned.

SKILL.md

The full file from guanyang/open-agent-hub at commit c32921b, republished under its MIT licence (© guanyang). 1,948 words, ~4,002 tokens.

Download SKILL.mdSave it as .claude/skills/context-optimization/SKILL.md (or your agent's skills folder). This skill also uses 2 other files; get the full folder from GitHub.
name
context-optimization
description
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.

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 logs as files: filesystem-context.
  • Model-initiated rewrites of its own context and their re-prefill cost: self-managed-context.

Core Concepts

Apply four primary strategies in this priority order:

  1. KV-cache optimization — Reorder and stabilize prompt structure so the inference engine reuses cached Key/Value tensors. This is the cheapest optimization when the runtime supports prefix caching: low quality risk, immediate cost and latency savings. Apply it first when stable prefixes exist.

  2. Observation masking — Replace verbose tool outputs with compact references once their purpose has been served. Tool outputs can dominate agent trajectories (claim-context-optimization-tool-output-dominance), so masking often yields the largest capacity gains. The original content remains retrievable if needed downstream.

  3. Compaction — Summarize accumulated context when utilization exceeds 70%, then reinitialize with the summary. This distills the window's contents while preserving task-critical state. Compaction is lossy — apply it after masking has already removed the low-value bulk.

  4. Context partitioning — Split work across sub-agents with isolated contexts when a single window cannot hold the full problem. Each sub-agent operates in a clean context focused on its subtask. Reserve this for tasks where estimated context exceeds 60% of the window limit, because coordination overhead is real.

The governing principle: context quality matters more than quantity. Every optimization preserves signal while reducing noise. Measure before optimizing, then measure the optimization's effect.

Detailed Topics

Compaction Strategies

Trigger compaction when context utilization exceeds 70%: summarize the current context, then reinitialize with the summary. This distills the window's contents in a high-fidelity manner, enabling continuation with minimal performance degradation. Prioritize compressing tool outputs first (they consume 80%+ of tokens), then old conversation turns, then retrieved documents. Never compress the system prompt — it anchors model behavior and its removal causes unpredictable degradation.

Preserve different elements by message type:

  • Tool outputs: Extract key findings, metrics, error codes, and conclusions. Strip verbose raw output, stack traces (unless debugging is ongoing), and boilerplate headers.
  • Conversational turns: Retain decisions, commitments, user preferences, and context shifts. Remove filler, pleasantries, and exploratory back-and-forth that led to a conclusion already captured.
  • Retrieved documents: Keep claims, facts, and data points relevant to the active task. Remove supporting evidence and elaboration that served a one-time reasoning purpose.

Target 50-70% token reduction with less than 5% quality degradation. If compaction exceeds 70% reduction, audit the summary for critical information loss — over-aggressive compaction is the most common failure mode.

Observation Masking

Mask observations selectively based on recency and ongoing relevance — not uniformly. Apply these rules:

  • Never mask: Observations critical to the current task, observations from the most recent turn, observations used in active reasoning chains, and error outputs when debugging is in progress.
  • Mask after 3+ turns: Verbose outputs whose key points have already been extracted into the conversation flow. Replace with a compact reference: [Obs:{ref_id} elided. Key: {summary}. Full content retrievable.]
  • Always mask immediately: Repeated/duplicate outputs, boilerplate headers and footers, outputs already summarized earlier in the conversation.

Masking should achieve 60-80% reduction in masked observations with less than 2% quality impact. The key is maintaining retrievability — store the full content externally and keep the reference ID in context so the agent can request the original if needed.

KV-Cache Optimization

Maximize prefix cache hits by structuring prompts so that stable content occupies the prefix and dynamic content appears at the end. KV-cache stores Key and Value tensors computed during inference; when consecutive requests share an identical prefix, the cached tensors are reused, saving both cost and latency.

Apply this ordering in every prompt:

  1. System prompt (most stable — never changes within a session)
  2. Tool definitions (stable across requests)
  3. Frequently reused templates and few-shot examples
  4. Conversation history (grows but shares prefix with prior turns)
  5. Current query and dynamic content (least stable — always last)

Design prompts for cache stability: remove timestamps, session counters, and request IDs from the system prompt. Move dynamic metadata into a separate user message or tool result where it does not break the prefix. Even a single whitespace change in the prefix invalidates the entire cached block downstream of that change. The same rule prices any compaction or masking edit applied to earlier history: its cost is the text that follows it, so batch such edits and prefer them near the end of the context.

Target 70%+ cache hit rate for stable workloads. At scale, this translates to 50%+ cost reduction and 40%+ latency reduction on cached tokens.

Context Partitioning

Partition work across sub-agents when a single context cannot hold the full problem without triggering aggressive compaction. Each sub-agent operates in a clean, focused context for its subtask, then returns a structured result to a coordinator agent.

Plan partitioning when estimated task context exceeds 60% of the window limit. Decompose the task into independent subtasks, assign each to a sub-agent, and aggregate results. Validate that all partitions completed before merging, merge compatible results, and apply summarization if the aggregated output still exceeds budget.

This approach achieves separation of concerns — detailed search context stays isolated within sub-agents while the coordinator focuses on synthesis. However, coordination has real token cost: the coordinator prompt, result aggregation, and error handling all consume tokens. Only partition when the savings exceed this overhead.

Budget Management

Allocate explicit token budgets across context categories before the session begins: system prompt, tool definitions, retrieved documents, message history, tool outputs, and a reserved buffer (5-10% of total). Monitor usage against budget continuously and trigger optimization when any category exceeds its allocation or total utilization crosses 70%.

Use trigger-based optimization rather than periodic optimization. Monitor these signals:

  • Token utilization above 80% — trigger compaction
  • Attention degradation indicators (repetition, missed instructions) — trigger masking + compaction
  • Quality score drops below baseline — audit context composition before optimizing

Practical Guidance

Optimization Decision Framework

Select the optimization technique based on what dominates the context:

Context CompositionFirst ActionSecond Action
Tool outputs dominate (>50%)Observation maskingCompaction of remaining turns
Retrieved documents dominateSummarizationPartitioning if docs are independent
Message history dominatesCompaction with selective preservationPartitioning for new subtasks
Multiple components contributeKV-cache optimization first, then layer masking + compaction
Near-limit with active debuggingMask resolved tool outputs only — preserve error details
Show full SKILL.md (790 more words)Show less
Performance Targets

Track these metrics to validate optimization effectiveness:

  • Compaction: 50-70% token reduction, <5% quality degradation, <10% latency overhead from the compaction step itself
  • Masking: 60-80% reduction in masked observations, <2% quality impact, near-zero latency overhead
  • Cache optimization: 70%+ hit rate for stable workloads, 50%+ cost reduction, 40%+ latency reduction
  • Partitioning: Net token savings after accounting for coordinator overhead; break-even typically requires 3+ subtasks

Iterate on strategies based on measured results. If an optimization technique does not measurably improve the target metric, remove it — optimization machinery itself consumes tokens and adds latency.

Examples

Example 1: Compaction Trigger

python
if context_tokens / context_limit > 0.8:
    context = compact_context(context)

Example 2: Observation Masking

python
if len(observation) > max_length:
    ref_id = store_observation(observation)
    return f"[Obs:{ref_id} elided. Key: {extract_key(observation)}]"

Example 3: Cache-Friendly Ordering

python
# Stable content first
context = [system_prompt, tool_definitions]  # Cacheable
context += [reused_templates]  # Reusable
context += [unique_content]  # Unique

Example 4: Budget-triggered optimization policy

yaml
budgets:
  tool_outputs: 35%
  message_history: 30%
  retrieved_documents: 20%
  reserved_buffer: 15%
triggers:
  tool_outputs_over_budget: mask resolved observations
  total_context_over_70_percent: compact message history
  repeated_irrelevant_retrievals: tighten retrieval scope

Guidelines

  1. Measure before optimizing—know your current state
  2. Apply masking before compaction — remove low-value bulk first, then summarize what remains
  3. Design for cache stability with consistent prompts
  4. Partition before context becomes problematic
  5. Monitor optimization effectiveness over time
  6. Balance token savings against quality preservation
  7. Test optimization at production scale
  8. Implement graceful degradation for edge cases

Gotchas

  1. Whitespace breaks KV-cache: Even a single whitespace or newline change in the prompt prefix invalidates the entire KV-cache block downstream of that point. Pin system prompts as immutable strings — do not interpolate timestamps, version numbers, or session IDs into them. Diff prompt templates byte-for-byte between deployments.

  2. Timestamps in system prompts destroy cache hit rates: Including Current date: {today} or similar dynamic content in the system prompt forces a full cache miss on every new day (or every request, if using time-of-day). Move dynamic metadata into a user message or a separate tool result appended after the stable prefix.

  3. Compaction under pressure loses critical state: When the model performing compaction is itself under context pressure (>85% utilization), its summarization quality degrades — it omits task goals, drops user constraints, and flattens nuanced state. Trigger compaction at 70-80%, not 90%+. If compaction must happen late, use a separate model call with a clean context containing only the material to summarize.

  4. Masking error outputs breaks debugging loops: Over-aggressive masking hides error messages, stack traces, and failure details that the agent needs in subsequent turns to diagnose and fix issues. During active debugging (error in the last 3 turns), suspend masking for all error-related observations until the issue is resolved.

  5. Partitioning overhead can exceed savings: Each sub-agent requires its own system prompt, tool definitions, and coordination messages. For tasks with fewer than 3 independent subtasks, the coordination overhead often exceeds the context savings. Estimate total tokens (coordinator + all sub-agents) before committing to partitioning.

  6. Cache miss cost spikes after deployment changes: Reordering tools, rewording the system prompt, or changing few-shot examples between deployments invalidates the entire prefix cache, causing a temporary cost spike of 2-5x until the new cache warms up. Roll out prompt changes gradually and monitor cache hit rate during deployment windows.

  7. Compaction creates false confidence in stale summaries: Once context is compacted, the summary looks authoritative but may reflect outdated state. If the task has evolved since compaction (new user requirements, corrected assumptions), the summary silently carries forward stale information. After compaction, re-validate the summary against the current task goal before proceeding.

Integration

This skill owns token-efficiency tactics and budget policy. Adjacent skills own diagnosis, storage, and architecture:

  • context-fundamentals: mental models for why context quality and attention placement matter.
  • context-degradation: diagnosis when output quality has already dropped.
  • context-compression: lossy summarization and handoff strategy.
  • filesystem-context: file-backed offloading for full outputs and logs.
  • multi-agent-patterns: partitioning work across isolated agent contexts.
  • latent-briefing: selective KV retention across orchestrator-worker boundaries in compatible runtimes.
  • self-managed-context: the model, not the harness, decides when and what to edit in its live context.
  • evaluation: measuring whether the optimization improved quality, cost, or latency.
  • memory-systems: persistent retrieval layers that feed context just in time.

References

Internal reference:

  • Optimization Techniques Reference - Read when: implementing a specific optimization technique and needing detailed code patterns, threshold tables, or integration examples beyond what the skill body provides

Related skills in this collection:

  • context-fundamentals - Read when: unfamiliar with context window mechanics, token counting, or attention distribution basics
  • context-degradation - Read when: diagnosing why agent performance has dropped and needing to identify which degradation pattern is occurring before selecting an optimization
  • evaluation - Read when: setting up metrics and benchmarks to measure whether an optimization technique actually improved outcomes

External resources:

  • Research on context window limitations - Read when: evaluating model-specific context behavior (e.g., lost-in-the-middle effects, attention decay curves)
  • KV-cache optimization techniques - Read when: implementing prefix caching at the inference infrastructure level (vLLM, TGI, or cloud provider APIs)
  • Production engineering guides - Read when: deploying context optimization in a production pipeline and needing operability patterns (monitoring, alerting, rollback)

Skill Metadata

Created: 2025-12-20 Last Updated: 2026-05-15 Author: Agent Skills for Context Engineering Contributors Version: 2.1.0

© guanyang, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 2 other files (scripts, references) in skills/context-optimization of guanyang/open-agent-hub.

  • SKILL.md
  • references/optimization_techniques.md
  • scripts/compaction.py

Open the folder on GitHubat commit c32921b

Used in 2 other repositories

We found 2 copies of this SKILL.md (exact, near-identical or edited) in other folders, from 2 other GitHub owners. This page covers the copy in guanyang/open-agent-hub, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Context Optimization 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.

Context Optimization compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Context Optimization this skillguanyang/open-agent-hub9732 repos~4kAutomated safety check: PassMIT
xc-plugin State Managementconorluddy/xclaude-plugin183—~4kAutomated safety check: PassMIT
Recursive Context Pruning Token Budgetingsickn33/agentic-awesome-skills47k1 repos~1.2kAutomated safety check: PassMIT
Context Mode Output Sandboxmksglu/context-mode26k—~4.1kAutomated safety check: PassCustom licence
Context Mode for Antigravity CLImksglu/context-mode26k—~850Automated safety check: PassCustom licence
Context DoctorjzOcb/context-doctor119—~642Automated safety check: PassMIT

Similar skills

  • xc-plugin State Management

    conorluddy/xclaude-plugin

    Teaches how xc-plugin saves tokens with progressive disclosure, cached responses and consistent configuration, so large device lists and build logs arrive as summaries first.

    183 GitHub stars~4k tokensUpdated 25 days ago
    Agent WorkflowsAuto-check passed
  • Recursive Context Pruning Token Budgeting

    sickn33/agentic-awesome-skills

    Optimizes AI agent performance by pruning redundant context, managing token usage, and enforcing ultra-concise, direct-to-value responses.

    47k GitHub starsUsed in 1 repo~1.2k tokens
    Business, Finance & HRAuto-check passed
  • Context Mode Output Sandbox

    mksglu/context-mode

    Routes large command, file, API and browser output through context-mode tools so only the needed result enters the agent's context, instead of dumping it via Bash.

    26k GitHub stars~4.1k tokensUpdated today
    Agent WorkflowsAuto-check passed
  • Routing rules for using context-mode MCP tools in Antigravity CLI: sandboxed code runs, file analysis, indexed search and web fetches that keep large output out of the conversation.

    26k GitHub stars~850 tokensUpdated today
    Agent WorkflowsAuto-check passed
  • Context Doctor

    jzOcb/context-doctor

    Visualize and diagnose OpenClaw context window usage. An agent skill from jzOcb/context-doctor.

    119 GitHub stars~642 tokensUpdated 6 mo ago
    Agent WorkflowsAuto-check passed
  • Code Context Slicing

    trailofbits/skills

    Official

    Picks a small, graph-based slice of source with Trailmark and hands a focused code task to a smaller or local model without exposing the whole repository.

    7.4k GitHub stars~2.1k tokensUpdated 5 days ago
    Agent WorkflowsAuto-check passed

More from guanyang/open-agent-hub

All 26 skills in this repo
  • Context Compression

    guanyang/open-agent-hub

    This skill should be used when long-running agent sessions need context compression, structured summarization, compaction, token-per-task optimization, or durable handoff summaries that preserve…

    973 GitHub starsUsed in 2 repos~4.6k tokens
    Auto-check passed
  • Context Fundamentals

    guanyang/open-agent-hub

    This skill should be used to explain or reason about the foundational concepts of context engineering: what context is, the anatomy of a context window, how attention mechanics work, the U-shaped…

    973 GitHub starsUsed in 2 repos~4.2k tokens
    Auto-check passed
  • Evaluation

    guanyang/open-agent-hub

    This skill should be used when building agent evaluation systems: deterministic checks, regression suites, multi-dimensional rubrics, quality gates, production monitoring, baseline comparison, and…

    973 GitHub starsUsed in 2 repos~4.2k tokens
    Auto-check passed
  • Multi Agent Patterns

    guanyang/open-agent-hub

    This skill should be used when designing multi-agent systems that need context isolation, supervisor or swarm coordination, explicit handoffs, parallel execution, or a decision on whether multiple…

    973 GitHub starsUsed in 2 repos~4.6k tokens
    Auto-check passed
  • Project Development

    guanyang/open-agent-hub

    This skill should be used for project-level decisions about LLM-powered systems: whether an LLM is the right primitive for the task at hand, the shape of a multi-stage batch or agent pipeline, token…

    973 GitHub starsUsed in 2 repos~4.7k tokens
    Auto-check passed
  • Tool Design

    guanyang/open-agent-hub

    This skill should be used for the tool-interface layer of an agent system specifically: writing tool descriptions agents can route on, designing tool schemas and response formats, naming…

    973 GitHub starsUsed in 2 repos~5k tokens
    Auto-check passed

Questions about Context Optimization

What does Context Optimization 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…. Context Optimization is an agent skill from guanyang/open-agent-hub. 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.

When should I use Context Optimization?

Context Optimization fits situations like: tasks that involve Context engineering; tasks that involve LLM cost and token optimization; tasks that involve Caching.

How do I install Context Optimization in Claude Code?

Run `npx skills add guanyang/open-agent-hub --skill context-optimization -a claude-code`. Or copy the skill folder (skills/context-optimization in guanyang/open-agent-hub) into .claude/skills/context-optimization in your project. Claude Code loads it when a task matches its description.

How do I install Context Optimization in Codex?

Run `npx skills add guanyang/open-agent-hub --skill context-optimization -a codex`. Or copy the skill folder (skills/context-optimization in guanyang/open-agent-hub) into .agents/skills/context-optimization in your project. Codex loads it when a task matches its description.

Can I use Context Optimization in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add guanyang/open-agent-hub --skill context-optimization -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/context-optimization, .gemini/skills/context-optimization, .github/skills/context-optimization and .opencode/skills/context-optimization in your project.

What does Context Optimization need to run?

Going by SKILL.md and its folder, Context Optimization needs Python for the scripts in its folder. Our summary lists: Python 3.

Does Context Optimization access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Context Optimization safe to install?

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. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Context Optimization use?

Context Optimization is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Context Optimization use?

About 4k tokens (SKILL.md is roughly 16k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 2.3k tokens, read only when the agent opens those files.

What are the alternatives to Context Optimization?

Skills that share tags, products or a category with Context Optimization: xc-plugin State Management (conorluddy/xclaude-plugin, 183 stars), Recursive Context Pruning Token Budgeting (sickn33/agentic-awesome-skills, 47k stars), Context Mode Output Sandbox (mksglu/context-mode, 26k stars) and Context Mode for Antigravity CLI (mksglu/context-mode, 26k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Context Optimization?

guanyang (a GitHub user) maintains it in guanyang/open-agent-hub, which has 973 GitHub stars. The repository holds 26 skills in this directory. The repository was last updated on October 7, 2026.

Source: guanyang/open-agent-hub on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.