Context Window Management

by davila78da17d671b6fNo license32K starsListed Oct 8, 2026Updated Oct 8, 2026Repository updated today

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 context.

Instructions onlyAI & Agents
AI-generated overview

Guidance on managing LLM context windows through summarization, trimming, routing and prioritization.

What it does
This skill provides strategies for handling limited LLM context windows, covering summarization, trimming, routing, token counting and context prioritization. It describes patterns such as tiered context strategies, serial position optimization and importance-based summarization, along with anti-patterns like naive truncation and ignoring token costs. It is an instructions-only reference and produces no files or scripts.
When to use it
Use it when working on context window limits, token budgets, context engineering or long-context behavior in an LLM application. It is meant for situations involving context rot, lost-in-the-middle problems or deciding when to summarize versus retrieve.
Requirements
No tools, packages or credentials are required; it is instructions only and ships no scripts.

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

Source and attribution

Source:davila7/claude-code-templatesincli-tool/components/skills/ai-research/context-window-managementat commit8da17d6

License: No license

Content belongs to its original authors. SourceWeft indexes it from a public repository.

Report or request removal