context-window-management

Strategies for managing LLM context windows including summarization, trimming, routing, and avoiding context rot Use when: context window, token limit, context management, context engineering, long...

23 stars

Best use case

context-window-management is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Strategies for managing LLM context windows including summarization, trimming, routing, and avoiding context rot Use when: context window, token limit, context management, context engineering, long...

Teams using context-window-management should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/context-window-management/SKILL.md --create-dirs "https://raw.githubusercontent.com/christophacham/agent-skills-library/main/skills/ai-ml/context-window-management/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/context-window-management/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How context-window-management Compares

Feature / Agentcontext-window-managementStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Strategies for managing LLM context windows including summarization, trimming, routing, and avoiding context rot Use when: context window, token limit, context management, context engineering, long...

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# Context Window Management

You're a context engineering specialist who has optimized LLM applications handling
millions of conversations. You've seen systems hit token limits, suffer context rot,
and lose critical information mid-dialogue.

You understand that context is a finite resource with diminishing returns. More tokens
doesn't mean better results—the art is in curating the right information. You know
the serial position effect, the lost-in-the-middle problem, and when to summarize
versus when to retrieve.

Your cor

## Capabilities

- context-engineering
- context-summarization
- context-trimming
- context-routing
- token-counting
- context-prioritization

## Patterns

### Tiered Context Strategy

Different strategies based on context size

### Serial Position Optimization

Place important content at start and end

### Intelligent Summarization

Summarize by importance, not just recency

## Anti-Patterns

### ❌ Naive Truncation

### ❌ Ignoring Token Costs

### ❌ One-Size-Fits-All

## Related Skills

Works well with: `rag-implementation`, `conversation-memory`, `prompt-caching`, `llm-npc-dialogue`

## When to Use
This skill is applicable to execute the workflow or actions described in the overview.

Related Skills

context-management-context-restore

23
from christophacham/agent-skills-library

Use when working with context management context restore

code-refactoring-context-restore

23
from christophacham/agent-skills-library

Use when working with code refactoring context restore

azure-mgmt-apimanagement-py

23
from christophacham/agent-skills-library

Azure API Management SDK for Python. Use for managing APIM services, APIs, products, subscriptions, and policies.

azure-mgmt-apimanagement-dotnet

23
from christophacham/agent-skills-library

Azure Resource Manager SDK for API Management in .NET.

powershell-windows

23
from christophacham/agent-skills-library

PowerShell Windows patterns. Critical pitfalls, operator syntax, error handling.

filesystem-context

23
from christophacham/agent-skills-library

This skill should be used when the user asks to "offload context to files", "implement dynamic context discovery", "use filesystem for agent memory", "reduce context window bloat", or mentions file-based context management, tool output persistence, agent scratch pads, or just-in-time context loading.

context-fundamentals

23
from christophacham/agent-skills-library

Understand what context is, why it matters, and the anatomy of context in agent systems

customaize-agent:context-engineering

23
from christophacham/agent-skills-library

Understand the components, mechanics, and constraints of context in agent systems. Use when writing, editing, or optimizing commands, skills, or sub-agents prompts.

context-degradation

23
from christophacham/agent-skills-library

Recognize patterns of context failure: lost-in-middle, poisoning, distraction, and clash

context-compression

23
from christophacham/agent-skills-library

Design and evaluate compression strategies for long-running sessions

codealive-context-engine

23
from christophacham/agent-skills-library

Semantic code search and AI-powered codebase Q&A across indexed repositories. Use when understanding code beyond local files, exploring dependencies, discovering cross-project patterns, planning features, debugging, or onboarding. Queries like "How does X work?", "Show me Y patterns", "How is library Z used?". Provides search (fast, returns file locations) and chat-with-codebase (slower, costs more, but returns synthesized answers).

genderapi-io-automation

23
from christophacham/agent-skills-library

Automate Genderapi IO tasks via Rube MCP (Composio). Always search tools first for current schemas.