Context Window Management

davila7/claude-code-templates/cli-tool/components/skills/ai-research/context-window-management

作者 davila78da17d671b6f無授權條款32K 個星標收錄於 2026年10月8日更新於 2026年10月8日儲存庫今天更新

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.

僅含說明AI & Agents
AI 產生的概覽

透過摘要、裁剪、路由與優先順序管理 LLM 上下文視窗的策略指引。

功能
此技能提供處理有限 LLM 上下文視窗的策略,涵蓋摘要、裁剪、路由、token 計數與上下文優先順序。它描述分層上下文策略、序列位置最佳化與依重要性摘要等模式,以及天真截斷與忽略 token 成本等反模式。它僅為說明性參考,不產生檔案或指令碼。
適用情境
適用於處理上下文視窗限制、token 預算、上下文工程或 LLM 應用程式中的長上下文行為。它面向上下文腐化、中間資訊遺失問題,或決定何時摘要、何時檢索的情境。
執行需求
無需工具、套件或憑證;僅為說明性內容,不附帶指令碼。

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

來源與署名

來源:davila7/claude-code-templates位於cli-tool/components/skills/ai-research/context-window-management提交8da17d6

授權條款: 無授權條款

內容歸原作者所有。SourceWeft 從公開儲存庫中收錄這些內容。

檢舉或申請下架