Skip to content
sickn33 avatar

Context Optimization

Strategies for stretching limited context windows through compaction, observation masking, KV-cache reuse, and partitioning.

CCM score
54 of 100
skills.sh installs
561
GitHub stars
50.5K
last updated
Jul 14, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers compaction, observation masking, KV-cache optimization, and context partitioning, with budget allocation and trigger-based optimization
  • Explains which content to summarize, mask, or never compress, such as tool outputs, old turns, and the system prompt
  • Enforces preservation boundaries so authorization, user constraints, unresolved blockers, and failed checks survive summarization
  • Designed for long-running agent systems and production workloads where token cost, latency, or context limits constrain tasks

Install

$ npx -y skills add sickn33/agentic-awesome-skills --skill context-optimization -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

Context Optimization Techniques

Context optimization extends the effective capacity of limited context windows through strategic compression, masking, caching, and partitioning. The goal is not to magically increase context windows but to make better use of available capacity. Effectiveness depends on task/workload and must be measured; compression can lose critical information.

When to Use

Activate this skill when:

  • Context limits constrain task complexity
  • Optimizing for cost reduction (fewer tokens = lower costs)
  • Reducing latency for long conversations
  • Implementing long-running agent systems
  • Needing to handle larger documents or conversations
  • Building production systems at scale

Core Concepts

Context optimization extends effective capacity through four primary strategies: compaction (summarizing context near limits), observation masking (replacing verbose outputs with references), KV-cache optimization (reusing cached computations), and context partitioning (splitting work across isolated contexts).

Details

Repository
github.com/sickn33/agentic-awesome-skills
Categories
Memory & Context, AI Agents & LLM Apps
First seen
Jun 3, 2026

More from sickn33/agentic-awesome-skills

All 682

Similar to Context Optimization

More Memory & Context