Where the budget really lives
Current Claude models support large context windows (200K tokens on the standard Sonnet/Opus, with even longer windows on opt-in models). 'Long' is a capability, not an instruction. Cost scales with input tokens — sending 150K tokens costs 150K input tokens whether the model needed all of them or not.
Effective context vs theoretical
Theoretical context is the API limit. Effective context is the slice the model actually attends to well. Long-context retrieval (the 'needle in a haystack' benchmark) shows Claude is strong, but careful prompt structure (placing critical info near the question) helps even more. Do not rely on the model to dig through 100K tokens for one fact you could have placed last.
Token counting before sending
The messages.count_tokens() endpoint returns the input token count without running a completion — perfect for budget planning. Use it in CI to assert prompts stay under a budget you set, and in production to log surprise growth.