‹ 首页

context-window-management

@davila7 · 收录于 5 天前 · 上游提交 5 天前

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 安装 校验哈希
npx oh-my-skill add davila7/claude-code-templates/context-window-management
/ 通过 bash 安装
curl -fsSL https://oh-my-skill.com/install.sh | bash -s -- davila7/claude-code-templates/context-window-management
/ 已经装过?验证本机副本,不用重装
npx oh-my-skill verify davila7/claude-code-templates/context-window-management
安装目标可用 --agent / --scope 或 --to 明确指定;省略时只会在唯一已存在的 agent 目录上自动选择,零命中或多命中会停止并提示。content_hash 缺失或不一致均拒装。
29874GitHub stars
~249上下文体积 · 单文件
索引托管

怎么用

商店整理自技能原文 · 版本 279b978 · 表述以原文为准
它做什么

安装后,Claude 会自动采用分层上下文策略来管理对话长度:优先保留开头和结尾的重要信息,对中间内容按重要性进行摘要或修剪,避免超出令牌限制或丢失关键信息。

什么时候触发

当用户提到“context window”、“token limit”、“long context”等关键词,或要求处理长对话、管理上下文时触发。

装好后可以这样说
Claude 会智能摘要并压缩上下文。
Claude 会基于重要性进行修剪。
Claude 会应用序列位置优化。
技能原文 SKILL.md作者撰写 · MIT · 279b978

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

按 MIT 许可原样转载,未经改动 · 在 GitHub 查看 →

评论

登录即可评论;带「已验证安装」的,是发布者名下有本店的安装或持有记录。