System prompt
- Counts toward the window?
- Yes
A context window is all the text a model can reference when answering, including its own reply. What counts toward it, Claude's sizes, and how to check usage.
A context window is all the text a language model can reference when generating a response, including the response itself. Anthropic describes it as working memory, separate from the data the model was trained on. Bigger is not automatically better: Anthropic says accuracy and recall degrade as token count grows, which it calls context rot.
Four quick questions, then a straight answer.
From your answers, this is quietly costing you traffic and nobody has the hours to chase it. Scaplet finds every affected page, drafts the fixes and tracks how AI answers mention you.
A data platform shipped 46 fixes without a ticket.
This looks handled. Re-check after a redesign, a migration or a big content push; that is when it breaks.
Your site is small and you have the time. Work through the steps on this page, starting with the pages that get the most traffic.
systemmessagestoolsmax_tokensusage in the response{
"model": "claude-sonnet-5-5",
"max_tokens": 1024,
"system": "You are a support agent.",
"messages": [
{"role": "user", "content": "Summarize this ticket thread..."}
],
"tools": [ ... ]
}invalid_request_error (prompt is too long).max_tokens exceeds the window, the request is accepted and generation stops with stop_reason: "model_context_window_exceeded" if it hits the limit.See tokenization for how text becomes tokens and retrieval-augmented generation for fetching only the passages a request needs.
Every response reports consumed tokens in its usage field. With prompt caching the input count is split across input_tokens, cache_read_input_tokens and cache_creation_input_tokens, and all three count.
Use the token counting API on a draft request. Anthropic calls the result an estimate that may differ by a small amount.
Anthropic says Claude 4.7 and later models use a newer tokenizer that produces approximately 30 percent more tokens for the same text, so recount against the model you plan to use.
1 questions people ask next, answered from the sources on this page.
No. Anthropic distinguishes the two: the context window is the working memory for one request, while training data is the large corpus the model learned from earlier.
The free audit reads robots.txt, sitemaps, status codes, canonicals, redirects and structured data.