You can use Claude Code without understanding any of this lesson. But if you do understand it — even at a hand-wavy level — you'll make much better decisions about when to trust it, when not to, and what it can and can't do.
The shortest possible explanation
A modern AI like Claude is a large language model (LLM). It's a program that, given some text, predicts what text is likely to come next. That's the whole machine. It's a prediction engine for language.
That sounds underwhelming, and it is — until you scale it up enormously. You take that simple "guess the next word" machine, train it on a truly absurd amount of text from the internet, books, code, conversations, and the predictions get so good that the results start looking like understanding.
What is a "model"?
A model, in AI, is just the file (a very, very big file) that holds the learned patterns. Training a model takes huge amounts of compute. Using a model — "running it" — is much cheaper. When you talk to Claude, you're using a pre-trained model that lives on Anthropic's servers.
Anthropic releases different models at different sizes and capabilities. You'll hear names like Claude Opus, Claude Sonnet, and Claude Haiku. Roughly: Opus is the biggest and smartest (and slowest, and most expensive); Sonnet is in the middle; Haiku is the smallest and fastest. We'll get into when to use which in Module 4.
The context window
When you talk to a model, it doesn't remember you between conversations. Each session, the model is given a fresh chunk of text to work with — your messages, files it has read, tool outputs. That chunk is called the context window.
The context window has a maximum size — measured in tokens(roughly: word fragments). A bigger window means the model can hold more of your project in its head at once. A smaller window means it has to be more selective. This becomes relevant in Claude Code: knowing what's in context, and what isn't, helps you give good instructions.
Hallucinations
Because the model generates by prediction, it can sometimes produce confident-sounding text that's simply wrong. This is called a hallucination. It can invent function names that don't exist, cite papers that were never written, or claim a file has contents that aren't there.
Claude Code reduces this dramatically by giving the model real tools — it actually reads the file rather than guessing what's in it. But the failure mode never fully goes away. Your job, when reviewing Claude's work, is partly to catch the occasional hallucination before it becomes a bug in your code.
What makes an "agent" different
A regular AI chat — like the chat box on a website — just generates text in response to your messages. An agent can also take actions: read a file from your disk, run a command in your terminal, edit a piece of code, fetch a web page.
Claude Code is an agent. It doesn't just talk to you about your code — it actually opens the files, reads them, edits them, runs tests, and reports back. That's the leap that makes it powerful, and also the reason it asks for permission before doing certain things.
- An LLM is a prediction engine for language. Big ones, trained on lots of text, become useful for almost any text-based task.
- A "model" is the file of learned patterns. Claude has multiple model sizes (Opus, Sonnet, Haiku).
- The context window is the chunk of text the model can see for one task. It has a maximum size.
- Hallucinations are confident wrong answers. Always sanity-check output, especially for facts and code.
- An agent is an AI that can also take actions, not just generate text. Claude Code is an agent.