AI guidesHow AI thinks

Models, Tokens and the Context Window: What Happens Behind the Scenes

Every time you write to Claude or ChatGPT, three things shape the result: which model answers, how many tokens the chat uses, and how much room is left in the context window. Understand all three and you will pick the right tool, save usage and get more accurate answers.

7 min read

01What is a language model, anyway?

A language model (LLM) is software trained on a huge amount of text: books, websites, code, documents. From that training it learned patterns of language and a lot of knowledge.

At its core it does one thing: it guesses what comes next. It reads what you wrote, predicts the next word (more precisely, the next token), adds it, and repeats until a full answer is formed.

That sounds simple, but when the model is large and well trained, those guesses are good enough to draft an email, check a calculation or write code.

02An engine and a desk

Think of the model as the engine size of a car: a big engine is more powerful but burns more fuel, and you do not need it for a trip to the corner shop. The context window is the desk surface you work on: every document, drawing and message you put on it takes space. When the desk is full, you summarise, clear some papers or start at a fresh desk.

03What happens when you press send

  1. 1Your textThe question, the files and all earlier messages in the chat
  2. 2Split into tokensThe text is cut into small pieces of words
  3. 3The modelWorks out the most likely next token
  4. 4New tokensGenerated one by one, each based on the ones before
  5. 5The answerTokens are joined back into the text you read

04Claude model families

Fast and cheap

Haiku

The small, fast model. Good for short repetitive jobs: sorting emails, pulling data out of a table, quick answers.

Balanced

Sonnet

A good mix of speed and intelligence. A sensible default for most daily work: writing, summarising, reviewing documents.

Smart and heavy

Opus

A large model for complex, long work: checking a tricky calculation, coding agents, analysing many documents together. Slower and uses more of your allowance.

Changes

Top tier

As of October 2026 there is also a model called Fable above Opus, for the hardest reasoning tasks. Names and versions change, so always check the official models page.

Same idea

ChatGPT and Gemini

OpenAI and Google also offer larger and smaller models plus thinking variants. Google's new model, Gemini 4 Argon, has been in the Gemini app since October 2026 on the paid AI Pro and Ultra plans. The logic is the same: bigger means smarter but slower and costlier.

05Tokens, context and thinking: the key terms

Unit of measure

Token

A piece of a word. A short word may be one token, a long word several. Everything going into and out of the model is counted in tokens.

Worth knowing

Hebrew vs English

In general, the same content in Hebrew usually splits into more tokens than in English, because models were trained mostly on English. Hebrew chats therefore fill up faster.

Working memory

Context window

How many tokens the model can see at once in one chat: instructions, files, your messages and its replies. Anything beyond that it cannot see. With every message the model rereads the whole chat.

Auto-summary

When it fills up

On paid plans Claude automatically summarises older parts to make room (Claude Code calls this compaction). Early details can get blurry, so for a new topic start a new chat with a short summary.

Thinking

Thinking mode

The model reasons quietly before answering: breaks the problem down and checks itself. Better for calculations and analysis, but slower and uses more tokens.

Plan-dependent

Usage limits

Claude plans have usage limits. Long chats, big files, heavy models and thinking mode all use more of your allowance.

06A quick email to a client

Office managerasks
Write a short, polite email telling the client the quote will go out on Thursday instead of Tuesday, because we are waiting for soil data.
gets
A five-line email ready to copy, in seconds.
ToolClaude with Haiku or Sonnet, thinking off

07Reviewing a long calculation report

Structural engineerasks
Attached is a chemical anchor calculation report (PDF, 40 pages). Check that the loads in Table 3 match the summary on page 38, and flag any inconsistency in units or safety factors.
gets
A list of three inconsistencies with page numbers and why each looks suspicious. The engineer checks each one personally.
ToolClaude with Opus, thinking on

08A coding agent fixing an app

Engineer building an in-house calculation toolasks
There is a bug: when I change the concrete thickness, the result does not update. Find the cause, fix it and run the tests.
gets
The agent reads several files, finds the faulty function, fixes it and runs the tests. It is long work, so it uses many tokens.
ToolClaude Code with Opus (see /ai/agents/)

09Which model for which task

TaskModel tierThinkingWhy
Short email or rewordingHaiku or SonnetOffSimple job, speed matters
Summarising meeting minutesSonnetOffMedium text, no calculation
Translating a technical spec into EnglishSonnetOff or lowNeeds accurate terms, not deep reasoning
Extracting data from dozens of invoicesHaikuOffMany small repetitive tasks
Reviewing a calculation report or standardOpusOnNeeds logic, units and self-checking
Comparing complex quotesSonnet or OpusOnMany parameters and conditions
Coding agent or long automationOpusOnMany steps, needs planning and fixing
Brainstorming article headlinesSonnetOffCreativity, not calculation

10How to make your usage allowance last

  1. 1

    Match the model to the job

    Do not use Opus for a two-line email. Sonnet or Haiku will do it faster and cheaper.

  2. 2

    One topic, one chat

    A long chat is reread with every message. New topic = new chat with a short summary.

  3. 3

    Send only what is needed

    Instead of a 200-page PDF, attach the relevant chapter or paste the table you need.

  4. 4

    Use Projects

    In Projects, documents are retrieved as needed rather than all loaded into every chat (see Context that stays).

  5. 5

    Turn off tools you do not need

    Active connectors and tools take room in the context window. Keep on only what you use.

  6. 6

    Thinking only when it helps

    Yes for calculations and analysis, no for drafting an email.

11Why you always verify: hallucinations

What the model may do

  • Invent a clause number in a standard that does not exist
  • Give a factor value that sounds right but is wrong
  • Cite a source that does not exist
  • Sound completely confident even when wrong

What you do

  • Check every number against the original standard or catalogue
  • Ask for the source and check it yourself
  • Attach the document itself instead of trusting the model's memory
  • Sign off only on what you have checked yourself

12FAQ

Why does the model "forget" things I said early in the chat?

Probably the context window filled and Claude summarised older parts, or the chat is simply so long that details get lost. Start a new chat with a summary of the key points.

Should I write in English to save tokens?

Not necessarily. Hebrew usually uses more tokens, but if you are comfortable in Hebrew the answers are good. For very long documents, English is worth considering.

How do I know which models I have?

In the model picker in the Claude interface. The list depends on your plan, and names change over time. The up-to-date list is on the models page in the Claude docs.

Is a bigger model always better?

No. For simple tasks it is slower and uses more allowance without much gain. Pick the smallest model that does the job well.

Does thinking mode stop hallucinations?

It reduces errors in calculations and reasoning, but does not eliminate them. You still need to check every important number.

More in this guide

The Claude Toolkit: What to Add for Every Task So It Works BetterA kit for every taskWhat Is an Artifact? A Guide for Engineers Who Want More Than a Chat AnswerOutputs, not just answersWhat Is an AI Agent? A Practical Guide for EngineersAI agents at workWhat Are Skills? An Engineer's Guide to Teaching Claude Your Office ProceduresProcedures for AIWhat Is a Connector? How Claude Plugs Into Your Apps (MCP)Claude meets your toolsWhat Is a Plugin? An Engineer's Guide to Installing a Whole Claude Workflow at OnceWorkflow packages for AIWhat Is a Prompt and How Do You Write a Good One?Talking to AIProjects and Memory in Claude: Make It Remember Your WorkContext that staysPictures and Video with Claude: What It Sees, What It Makes, and the WorkaroundsClaude's eyeWhat Is a Design System? A Guide for Non-DesignersDesign without a designerWhat Is a Snippet? An Engineer's Guide to Reusable Pieces of Code and TextReusable building blocksWhat Is GitHub? A Guide for Engineers Who Don't CodeGitHub without codeDesign an image with AI: create, edit and improve pictures, free and paidImages with AIDesigning an AI Character: Mascot, Avatar, Talking Presenter, 3DTask: AI characterEngineering calculations with AI: compute, check and document properlyCalculations with AIBuild engineering software with AI: from a small calculator to an app, without being a programmerSoftware without codingFind a product with AI: search, compare and verify products, suppliers and datasheetsFind and compare productsFind a standard with AI: the right standard and clause, without the hallucinationsStandards, no guessingThe full Claude guideEverything you need to start, step by step

Back to the AI page