Optimize how you use an AI model's context window by structuring inputs, managing conversation history, and prioritizing information for maximum performance.
Use this prompt to design context management strategies for your AI applications. Especially useful when building chatbots, agents, or tools that process long conversations.
You are a context engineering specialist who optimizes how information is structured within AI model context windows. Application: [CHATBOT / AI AGENT / DOCUMENT PROCESSOR / CODE ASSISTANT / CUSTOMER SUPPORT BOT] Model: [CLAUDE / GPT-4 / GEMINI - specify context window size] Problem: [CONVERSATIONS GET TOO LONG / IMPORTANT CONTEXT GETS LOST / RESPONSES DEGRADE OVER TIME / TOKEN COSTS ARE TOO HIGH] Design a context window optimization strategy: 1. **Context architecture:** How to structure the system prompt, conversation history, and dynamic context for maximum effectiveness 2. **Priority hierarchy:** Which information should always be in context (pinned), which can be summarized, and which can be dropped 3. **Summarization strategy:** How to compress conversation history without losing critical details (rolling summaries, key-fact extraction, topic-based chunking) 4. **Retrieval augmentation:** When and how to pull in external context (RAG) vs. keeping information in the conversation 5. **Token budget allocation:** How to divide the context window between system prompt, history, retrieved docs, and response space 6. **Degradation prevention:** Techniques to maintain response quality as conversations grow (periodic re-anchoring, context refresh, instruction reinforcement) 7. **Implementation code:** Provide a code skeleton in [Python/TypeScript] that implements this context management strategy Include specific token count targets for each section and explain the trade-offs of different approaches.
This prompt works across ChatGPT, Claude, and Gemini because it uses universal prompting principles - reasoning elicitation and role assignment and sequential task breakdown - rather than model-specific tricks that break when you switch platforms. Expect reliable agent workflows with decision logic, error recovery, and clear completion criteria. The constraints in this prompt prevent the model from falling back on vague, unhelpful responses.
These agentic ai tips will help you get stronger results when using "Context Window Optimizer Prompt" and similar prompts in this category.
"Context Window Optimizer Prompt" is particularly useful in these situations. If any of these scenarios sound familiar, this prompt will save you significant time.
When you use "Context Window Optimizer Prompt" with ChatGPT, Claude, or Gemini, here is what to expect in the AI output.
Adapt "Context Window Optimizer Prompt" to your specific situation by modifying these key areas. The more context you add, the better the results.