Back to Skills

context-window-management

majiayu000
Updated Today
1 views
58
9
58
View on GitHub
Otherai

About

This Claude Skill provides strategies for managing LLM context windows, including techniques like summarization, trimming, and routing to handle token limits and avoid context rot. Use it when you need to engineer long contexts, prioritize information, or maintain conversation quality within token constraints. It offers capabilities for token counting, context prioritization, and curating the most relevant information for your application.

Quick Install

Claude Code

Recommended
Plugin CommandRecommended
/plugin add https://github.com/majiayu000/claude-skill-registry
Git CloneAlternative
git clone https://github.com/majiayu000/claude-skill-registry.git ~/.claude/skills/context-window-management

Copy and paste this command in Claude Code to install this skill

Documentation

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

GitHub Repository

majiayu000/claude-skill-registry
Path: skills/context-window-management

Related Skills

sglang

Meta

SGLang is a high-performance LLM serving framework that specializes in fast, structured generation for JSON, regex, and agentic workflows using its RadixAttention prefix caching. It delivers significantly faster inference, especially for tasks with repeated prefixes, making it ideal for complex, structured outputs and multi-turn conversations. Choose SGLang over alternatives like vLLM when you need constrained decoding or are building applications with extensive prefix sharing.

View skill

evaluating-llms-harness

Testing

This Claude Skill runs the lm-evaluation-harness to benchmark LLMs across 60+ standardized academic tasks like MMLU and GSM8K. It's designed for developers to compare model quality, track training progress, or report academic results. The tool supports various backends including HuggingFace and vLLM models.

View skill

langchain

Meta

LangChain is a framework for building LLM applications using agents, chains, and RAG pipelines. It supports multiple LLM providers, offers 500+ integrations, and includes features like tool calling and memory management. Use it for rapid prototyping and deploying production systems like chatbots, autonomous agents, and question-answering services.

View skill

llamaguard

Other

LlamaGuard is Meta's 7-8B parameter model for moderating LLM inputs and outputs across six safety categories like violence and hate speech. It offers 94-95% accuracy and can be deployed using vLLM, Hugging Face, or Amazon SageMaker. Use this skill to easily integrate content filtering and safety guardrails into your AI applications.

View skill