Quick Start
Model Limits
| Model | Context Limit | Default Output Reserve |
|---|---|---|
| gpt-4o | 128,000 | 16,384 |
| gpt-4o-mini | 128,000 | 16,384 |
| gpt-4-turbo | 128,000 | 4,096 |
| claude-3-opus | 200,000 | 8,192 |
| claude-3-sonnet | 200,000 | 8,192 |
| gemini-1.5-pro | 2,097,152 | 8,192 |
| gemini-1.5-flash | 1,048,576 | 8,192 |
Budget Allocation
Default segment budgets:| Segment | Default Budget | Purpose |
|---|---|---|
| System Prompt | 2,000 | Agent instructions |
| Rules | 500 | Workspace rules |
| Skills | 500 | Skill definitions |
| Memory | 1,000 | Persistent memory |
| Tools Schema | 2,000 | Tool definitions |
| Tool Outputs | 20,000 | Tool call results |
| Buffer | 1,000 | Safety margin |
| History | Remainder | Conversation history |
Custom Budgets
Overflow Detection
Threshold-Based Triggers
CLI Configuration
Environment Variables
Serialization
How It Works
Best Practices
Reserve output tokens explicitly
Reserve output tokens explicitly
Set
output_reserve for the model’s reply so retrieval and history do not consume the full window.Align budget with your model limit
Align budget with your model limit
Pass the correct model name so limits match the provider’s context window.
Monitor utilisation above 80%
Monitor utilisation above 80%
Trigger compaction or retrieval trimming before hard overflow — do not wait for API errors.
Segment large tool results
Segment large tool results
Allocate per-segment budgets when tools return bulky JSON or file contents.
Related
Context Ledger
Track actual token usage by segment
Context Optimizer
Reduce context when over budget

