ToolsPromptsSkillsWorkflowsBlogAbout

Context Window Management — fit more without losing quality

Use summarization, compression, selective retrieval, and sliding windows to manage long context without exceeding limits or losing key information.

Optimization4.1
Context Window Management — fit more without losing quality preview

Prompt template

Summarize the following conversation history, preserving:
1. All decisions and their rationale
2. Action items and assigned owners
3. Key facts and numbers
4. Open questions and blockers

Omit: pleasantries, repeated points, already-resolved items.

History: {conversation_history}

Summary:

How to use

  1. 1Track token usage with each API call
  2. 2Summarize older conversation turns when approaching 70% limit
  3. 3Use selective retrieval for long documents (RAG)
  4. 4Implement sliding window for ongoing conversations
  5. 5Preserve system prompt and recent context verbatim

Pro tips

  • Summarize at 50-60% context usage, not at 90%
  • Keep the last 5-10 messages verbatim for coherence
  • Use a separate 'memory' file for facts across sessions
  • Compress code by removing comments and whitespace

Works best with

Ratings & Reviews

Loading reviews…

Share your experience

Select a rating

Related Skills