sickn33/antigravity-awesome-skills/context-window-management
- community
Checking that the SKILL.md file is still in the repository.
Strategies for managing LLM context windows including
Install
npx vskill@latest install sickn33/antigravity-awesome-skills/context-window-managementSKILL.md
Context Window Management
Strategies for managing LLM context windows including summarization, trimming, routing, and avoiding context rot
Capabilities
- context-engineering
- context-summarization
- context-trimming
- context-routing
- token-counting
- context-prioritization
Prerequisites
- Knowledge: LLM fundamentals, Tokenization basics, Prompt engineering
- Skills_recommended: prompt-engineering
Scope
- Does_not_cover: RAG implementation details, Model fine-tuning, Embedding models
- Boundaries: Focus is context optimization, Covers strategies not specific implementations
Ecosystem
Primary_tools
- tiktoken - OpenAI's tokenizer for counting tokens
- LangChain - Framework with context management utilities
- Claude API - 200K+ context with caching support
Patterns
These are incomplete architectural sketches with application-defined helpers/types. Model IDs and context limits are historical; discover supported models and use their tokenizer/counting API (tiktoken is not a universal Claude tokenizer). Preserve system/developer boundaries and user constraints verbatim; never silently truncate them to a percentage budget. Keep retrieved text and summaries clearly marked as data. Preserve chronological/tool-call relationships, recount the final serialized request including tools and reserved output, and fail/reduce optional history if it still exceeds the limit. Importance ordering alone must not scramble dependent messages.
Tiered Context Strategy
Different strategies based on context size
When to use: Building any multi-turn conversation system
Serial Position Optimization
Place important content at start and end
When to use: Constructing prompts with significant context
Intelligent Summarization
Summarize by importance, not just recency
When to use: Context exceeds optimal size
Token Budget Allocation
Allocate token budget across context components
When to use: Need predictable context management
Validation Checks
No Token Counting
Severity: WARNING
Message: Building context without token counting. May exceed model limits.
Fix action: Count tokens before sending, implement budget allocation
Naive Message Truncation
Severity: WARNING
Message: Truncating messages without summarization. Critical context may be lost.
Fix action: Summarize old messages instead of simply removing them
Hardcoded Token Limit
Severity: INFO
Message: Hardcoded token limit. Consider making configurable per model.
Fix action: Use model-specific limits from configuration
No Context Management Strategy
Severity: WARNING
Message: LLM calls without context management strategy.
Fix action: Implement context management: budgets, summarization, or RAG
Collaboration
Delegation Triggers
- retrieval|rag|search -> rag-implementation (Need retrieval system)
- memory|persistence|remember -> conversation-memory (Need memory storage)
- cache|caching -> prompt-caching (Need caching optimization)
Complete Context System
Skills: context-window-management, rag-implementation, conversation-memory, prompt-caching
Workflow:
Related Skills
Works well with: rag-implementation, conversation-memory, prompt-caching, llm-npc-dialogue
When to Use
- User mentions or implies: context window
- User mentions or implies: token limit
- User mentions or implies: context management
- User mentions or implies: context engineering
- User mentions or implies: long context
- User mentions or implies: context overflow
Limitations
- Use this skill only when the task clearly matches the scope described above.
- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/context-window-management/SKILL.md
Popularity
- Repository stars
- 27,553
- Repository forks
- 4,639
- Repository npm downloads, 7 days
- 6,951
- 7-day trend score
- 72
Stars and forks are for the whole GitHub repository, not this skill alone. Downloads are for the repository's npm package. Refreshed 21 Mar 2026, 7 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/sickn33/antigravity-awesome-skills/context-window-management)