Tooluck logoTooluck
SKILL.md

context-optimization

Agent skill frommuratcankoylan/Agent-Skills-for-Context-Engineering

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 to install context-optimization

install context-optimization
# install the Agent-Skills-for-Context-Engineering pack with the skills CLI
npx skills add muratcankoylan/Agent-Skills-for-Context-Engineering

# or add only this skill to Claude Code: copy the folder

skills/context-optimization/

# into

~/.claude/skills/context-optimization/ (all projects)

.claude/skills/context-optimization/ (one project)

skills/context-optimization/SKILL.md

MITFull file
1# Context Optimization Techniques
2
3Context 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.
4
5## When to Activate
6
7Activate this skill when:
8- Context budgets or token costs constrain task complexity
9- Observation masking can replace verbose tool outputs with retrievable references
10- Prefix or KV-cache hit rate needs improvement
11- Retrieval scoping can reduce irrelevant loaded context
12- Context partitioning can extend effective capacity across agents
13- Budget triggers are needed for masking, compaction, or partitioning
14
15Do not activate this skill for adjacent work owned by other skills:
16- Explaining why attention or context windows behave this way: `context-fundamentals`.
17- Diagnosing active lost-in-middle, poisoning, distraction, confusion, or clash: `context-degradation`.
18- Designing a structured handoff summary for a long conversation: `context-compression`.
19- Storing large outputs, plans, or logs as files: `filesystem-context`.
20- Model-initiated rewrites of its own context and their re-prefill cost: `self-managed-context`.
21
22## Core Concepts
23
24Apply four primary strategies in this priority order:
25…

Excerpt shown under the repository's MIT license.

More skills in Agent-Skills-for-Context-Engineering

Newsletter

Join the Community

Subscribe to our newsletter for the latest news and updates