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.

18,259 stars 1,508 forksOther

Install

skills CLI (Claude Code, Cursor, Codex and more)
npx skills add muratcankoylan/Agent-Skills-for-Context-Engineering --skill context-optimization
Manual install
git clone --depth 1 https://github.com/muratcankoylan/Agent-Skills-for-Context-Engineering.git /tmp/Agent-Skills-for-Context-Engineering
mkdir -p ~/.claude/skills
cp -r /tmp/Agent-Skills-for-Context-Engineering/skills/context-optimization ~/.claude/skills/context-optimization

Personal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.

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 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:
Read the full skill on GitHub

Details

Skill name
context-optimization
Path
skills/context-optimization/SKILL.md
License
MIT
Repo updated
12 October 2026

FAQ

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 the Context Optimization skill?

skills CLI (Claude Code, Cursor, Codex and more): npx skills add muratcankoylan/Agent-Skills-for-Context-Engineering --skill context-optimization. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.

Is Context Optimization popular?

It lives in muratcankoylan/Agent-Skills-for-Context-Engineering, which has 18,259 GitHub stars and 1,508 forks, and is included in 3 curated skill lists.

Related skills

Context Compression

18k

muratcankoylan/Agent-Skills-for-Context-Engineering

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 decisions, files, risks, and next actions.

Productivity & NotesIn 3 lists1.5k

Context Degradation

18k

muratcankoylan/Agent-Skills-for-Context-Engineering

This skill should be used for diagnosing and mitigating context degradation: lost-in-middle failures, context poisoning, context clash, context confusion, attention-pattern issues, and agent performance degradation caused by accumulated or conflicting context.

AI, LLMs & AgentsIn 3 lists1.5k

Context Engineering Collection

18k

muratcankoylan/Agent-Skills-for-Context-Engineering

A comprehensive collection of Agent Skills for context engineering, harness engineering, multi-agent architectures, and production agent systems. Use when building, optimizing, evaluating, or debugging agent systems that require effective context management and reliable operating loops.

AI, LLMs & AgentsIn 3 lists1.5k

Zhangxuefeng Perspective

11k

alchaincyf/zhangxuefeng-skill

张雪峰的思维框架与表达方式。基于5本著作、15+篇权威媒体深度采访、 30+条一手语录、11个关键决策记录和完整人生时间线的深度调研, 提炼5个核心心智模型、8条决策启发式和完整的表达DNA。 用途:作为思维顾问,用张雪峰的视角分析教育选择、职业规划、阶层流动等问题。 当用户提到「用张雪峰的视角」「张雪峰会怎么看」「张雪峰模式」「雪峰视角」时使用。 即使用户只是说「帮我用张雪峰的角度想想」「如果张雪峰会怎么说」「切换到张雪峰」也应触发。

Other2.7k

Sentiment Analysis

28k

phuryn/pm-skills

Analyze user feedback data to identify segments with sentiment scores, JTBD, and product satisfaction insights. Use when analyzing user feedback at scale, running sentiment analysis on reviews or surveys, or identifying satisfaction patterns.

OtherIn 3 lists2.9k

Alipay Upload

16k

dreammis/social-auto-upload

使用 social-auto-upload 的 `sau alipay` 登录支付宝生活号并发布视频。Use when 用户要向支付宝生活号发布视频或检查创作账号状态。

OtherIn 1 list2.7k

Browse the most popular Claude skills, all other skills, or write your own with the skills generator.