Context window usage or limit is communicated
Why it matters
When the conversation exceeds the model's context window, the API either errors, truncates silently, or starts forgetting earlier turns — all three outcomes confuse users who have no mental model of why the AI suddenly lost track of something they told it ten messages ago. Surfacing context usage teaches users the constraint proactively so they can branch, summarize, or start fresh before quality degrades. The alternative is an invisible cliff that users hit repeatedly without understanding why responses get worse.
Severity rationale
High because silent context truncation causes the model to appear dumber without the user knowing why.
Remediation
Estimate token usage by summing message.content.length / 4 across the turn history and compare against the model's context ceiling. Render a warning at 75% and a strong recommendation to start a new conversation at 90%. Use a real tokenizer (tiktoken, @anthropic-ai/tokenizer) in src/lib/tokens.ts once the rough heuristic is in place.
{contextUsed > 0.75 && <p>Conversation is {Math.round(contextUsed * 100)}% of context used. Consider starting fresh.</p>}
DetectionPro
The detection method for this pattern is part of AuditBuffet Pro.
The full method (what to look for, pass and fail conditions, and how results get reported) ships inside the AI UX Patterns Audit. The pattern definition, severity rationale, and remediation remain openly licensed under CC-BY-4.0.
Taxons
History
- 2026-04-18·v1.0.0·Initial import from ai-ux-patterns·automated