context window limits and what happens when you hit them: if the input alone is bigger than the window, the Claude API returns a 'prompt is too long' error. Otherwise generation can stop when it reaches the limit. Chat apps such as claude.ai can manage the window on a rolling first-in, first-out basis. For long conversations, Anthropic describes compaction, which summarizes earlier parts on the server so the conversation can continue. Cached prompts still occupy the window; caching changes the price, not the count. source: https://platform.claude.com/docs/en/build-with-claude/context-windows