Get Started
Context basics
Context is your session working memory. Managing it directly improves output quality, latency, and cost predictability.
What context includes
Each request is built from context, which is the model input window for that turn.
- Conversation history that remains relevant to the active task.
- Current request text, plus any attachments (files, diffs, text, images).
- System/runtime instructions, selected mode/model behavior, and persistent guidance such as memories.
- Recent tool outputs and other execution artifacts needed for continuity.
Token-level view
Context size is measured in tokens. More carried context means more input tokens per turn.
Why context fills over time
- Every turn adds new user text, assistant output, and tool results.
- Large attachments and pasted blobs accelerate growth.
- Long multi-topic sessions retain stale details that compete for attention.
- Higher-context turns cost more because larger input windows are reprocessed.
Context usage signals in app
- 70%+: warning zone (quality and cost risk starts rising).
- 90%+: critical zone (strong chance of drift and unnecessary spend).
- 95%+: sending is blocked until pressure is reduced.
text
Quick rule:
- <70%: continue normally
- 70-89%: tighten prompts + narrow scope
- 90-94%: compact before next major step
- >=95%: compact or start a fresh sessionCompaction and max mode
- Auto-compaction defaults to 85% context usage for coding requests.
- Auto-compaction is skipped for max-mode requests.
- You can manually compact to summarize history and free room for new work.
- Max mode prioritizes continuity by using larger context, but usually increases token spend.
Important tradeoff
Max mode can help long, complex tasks, but it removes automatic compaction safeguards.
Practical context management playbook
- Keep one larger objective per session to avoid topic drift.
- Use focused attachments instead of broad file dumps.
- Compact at milestone boundaries before starting a new sub-task.
- When a task is done, open a fresh session for the next objective.
- If quality drops, restate non-negotiable constraints explicitly after compaction.
text
Bad: "Let us keep this same session for every task this week."
Better: "We finished feature A. Start a new session for feature B with clean context and updated constraints."