Context Window Budget Allocator

General Productivitycontext-engineering-guideapplication_typemodel_namecontext_window

Defining format alongside budget ensures each component is not just sized correctly but structured for optimal model comprehension.

Prompt
I'm building a {{application_type}} with a {{model_name}} backend ({{context_window}} token context window).\n\nMy context needs:\n- System prompt: {{system_prompt_summary}}\n- User query: variable length\n- Retrieved documents: {{retrieval_description}}\n- Conversation history: {{history_policy}}\n- Tool call results: {{tool_results_description}}\n\nDesign the token budget allocation. For each component:\n1. Allocate a fixed or proportional token budget\n2. Define the compression strategy when it exceeds budget\n3. Set the priority for when total context exceeds the window\n4. Specify the format (raw text, XML tags, JSON, markdown)\n\nInclude a fallback strategy for edge cases where a single component exceeds 50% of the window.

Variables to customize

{{application_type}}{{model_name}}{{context_window}}{{system_prompt_summary}}{{retrieval_description}}{{history_policy}}{{tool_results_description}}

Why this prompt works

Defining format alongside budget ensures each component is not just sized correctly but structured for optimal model comprehension.

What you get when you save this prompt

Your workspace unlocks powerful tools to iterate and improve.

AI OPTIMIZE

AI Optimization

One-click improvement with structure analysis and pattern suggestions.

VERSION DIFF

Version History

Track every edit. Compare versions side-by-side with word-level diffs.

ORGANIZE
Development
Code Review
Testing
Marketing

Folders & Tags

Organize your library with nested folders, tags, and drag-and-drop.

MCP
$ npm i -g @promptingbox/mcp
Claude · Cursor · ChatGPT

Use Everywhere

Access prompts from Claude, Cursor, ChatGPT & more via MCP integration.

Your prompts, organized

Save, version, and access your best prompts across ChatGPT, Claude, Cursor, and more.