Skip to content
Skills Library
AI & agents · Learning & explanation

context-window-management

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

Repository
rei-skills ↗
Licence
MIT
Last repository change
27.10.2026

Assessment and security

90/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content25 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
1
Deprecation

No signals detected. Repository changed on 27.10.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

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

Original author description

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

How it works

  1. Capabilities
  2. Patterns
  3. Anti-Patterns
  4. Related Skills
  5. When to Use
Original SKILL.md headings · 57 lines, 184 words
SKILL.md preview
---
name: context-window-management
description: "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..."
source: rootcastle-rei
risk: unknown
---

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

---

> 🏰 **Rei Skills** — Curated by [Rootcastle Engineering & Innovation](https://www.rootcastle.com) | Batuhan Ayrıbaş  
> Engineering Beyond Boundaries | admin@rootcastle.com

Versions

RepositoryScoreLicence
This page · rootcastleco/rei-skills90MIT
seyhunak/skilldeck100MIT
fabiensalles/claude-marketplace100MIT
Wsh7Ash/skillmcp100MIT
charlieviettq/awesome-agent-skill100MIT
Amey-Thakur/AI-SKILLS90MIT

Database snapshot: 13.11.2026 · package version cb69ccc2731b (SHA-256 digest of the entire package)

Downloads in the last 30 days: 1 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 90context-optimization
    Use when optimizing token usage, KV cache efficiency, or context window management for LLM agents. Keywords: context optimization, KV cache, prompt caching, token budget, semantic pruning, lost-in-the-middle.
  • 100context-management
    Use when managing Claude Code context window during long sessions, when context feels degraded, or when deciding between /compact, /clear, /rewind, and sub-agents. Covers context rot detection, compaction timing, branching strategy, and sub-agent isolation patterns.
  • 100cursor-context-management
    Optimize context window usage in Cursor. Triggers on "cursor context", "context window", "context limit", "cursor memory", "context management". Use when working with cursor context management functionality. Trigger with phrases like "cursor context management", "cursor management", "cursor".
  • 90context-engineering
    Engineer what enters the model's context window for reliability and cost using Write, Select, Compress, and Isolate. Use when: context engineering, context window budget, context rot, prompt caching, just-in-time retrieval, context compaction, sub-agent context isolation, tool output distillation.
  • 100agent-context-budget-management-strategies
    Use this skill when monitoring, budgeting, and optimizing context window tokens during complex, multi-turn technical workflows.
  • 100long-context
    Work with large Claude context windows deliberately — check the window for your model, count tokens before sending, structure long inputs for recall, cache the stable part, and manage growing conversations with compaction, context editing, or memory instead of stuffing…

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.