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 context.
适合你,如果经常处理超长文本或对话,需要保持上下文连贯
npx oh-my-skill add davila7/claude-code-templates/context-window-managementcurl -fsSL https://oh-my-skill.com/install.sh | bash -s -- davila7/claude-code-templates/context-window-managementnpx oh-my-skill verify davila7/claude-code-templates/context-window-management怎么用
商店整理自技能原文 · 版本 279b978 · 表述以原文为准安装后,Claude 会自动采用分层上下文策略来管理对话长度:优先保留开头和结尾的重要信息,对中间内容按重要性进行摘要或修剪,避免超出令牌限制或丢失关键信息。
当用户提到“context window”、“token limit”、“long context”等关键词,或要求处理长对话、管理上下文时触发。
技能原文 SKILL.md
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