跳到正文
Skillpedia
提示词与 LLM33k · #8535

context-window-management

它能做什么

这个技能说明如何让 AI 模型有限的上下文窗口中保留最有用的信息。适合开发长时间运行、可能耗尽空间或丢失关键细节的 AI 应用的开发者。

适用场景

  • ✓当一段长对话或应用接近模型的令牌上限的时候。
  • ✓当重要细节似乎在长输入的中间部分丢失的时候。
  • ✓当团队需要在总结和检索信息之间做选择的时候。

技能链接

https://github.com/davila7/claude-code-templates/blob/main/cli-tool/components/skills/ai-research/context-window-management/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/davila7/claude-code-templates/blob/main/cli-tool/components/skills/ai-research/context-window-management/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“我的聊天机器人在长对话中会丢失关键细节。请帮我更好地管理它的上下文窗口。”

每周 5 个新技能,1 分钟读完。

工作原理

这个技能描述了一些策略,例如分层上下文、把重要内容放在开头和结尾,以及按重要性而不只是按时间顺序进行总结。它会帮你为应用选择合适的策略。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

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

常见问题

什么是上下文退化?

它是指随着对话变长,关键信息被埋没,回答质量逐渐下降的现象。

上下文越多越好吗?

不是。该技能指出,整理出正确的信息比增加更多令牌更重要。

它涵盖令牌成本吗?

涵盖。它提醒在管理上下文时不要忽视令牌成本。

详情

作者的原始描述

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.

repo: davila7/claude-code-templates

热度

GitHub 星标
33k
排名
#8535
许可证
MIT
更新时间
2026/11/2

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能