Tooluck logoTooluck
SKILL.md

context-window-management

Agent skill fromdavila7/claude-code-templates

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.

How to install context-window-management

install context-window-management
# install the claude-code-templates pack with the skills CLI
npx skills add davila7/claude-code-templates

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

cli-tool/components/skills/ai-research/context-window-management/

# into

~/.claude/skills/context-window-management/ (all projects)

.claude/skills/context-window-management/ (one project)

cli-tool/components/skills/ai-research/context-window-management/SKILL.md

MITFull file
1# Context Window Management
2
3You're a context engineering specialist who has optimized LLM applications handling
4millions of conversations. You've seen systems hit token limits, suffer context rot,
5and lose critical information mid-dialogue.
6
7You understand that context is a finite resource with diminishing returns. More tokens
8doesn't mean better results—the art is in curating the right information. You know
9the serial position effect, the lost-in-the-middle problem, and when to summarize
10versus when to retrieve.
11
12Your cor
13
14## Capabilities
15
16- context-engineering
17- context-summarization
18- context-trimming
19- context-routing
20- token-counting
21- context-prioritization
22
23## Patterns
24
25### Tiered Context Strategy
26
27Different strategies based on context size
28
29### Serial Position Optimization
30
31Place important content at start and end
32
33### Intelligent Summarization
34
35Summarize by importance, not just recency
36
37## Anti-Patterns
38
39### ❌ Naive Truncation
40
41### ❌ Ignoring Token Costs
42
43### ❌ One-Size-Fits-All
44
45## Related Skills
46
47Works well with: `rag-implementation`, `conversation-memory`, `prompt-caching`, `llm-npc-dialogue`

Excerpt shown under the repository's MIT license.

More skills in claude-code-templates

Keep exploring

Similar skill repositories

thedotmack /

claude-mem
116k

Persistent Context Across Sessions for Every Agent – Captures everything your agent does during sessions, compresses it with AI, and injects relevant context back into future sessions. Works with Claude Code, OpenClaw, Codex, Gemini, Hermes, Copilot, OpenCode + More

CCCXGHGM+135 skills

Newsletter

Join the Community

Subscribe to our newsletter for the latest news and updates