September 11, 2026
TOKENS: THE METER RUNNING UNDER EVERY AI CONVERSATION

In Class 08 you learned to pick the right model for the job. Now you need to understand what the job actually consumes. Every request you send to a model — every instruction, file, pasted log, and reply — is measured in small units called tokens. Tokens decide two things at once: how much the model can pay attention to right now, and how much the request costs.
Tokens are pieces of words, not words
A token is a chunk of text the model reads or writes. In ordinary English, one token is roughly four characters, or about three-quarters of a word. So "build a website" is three words but about four tokens. Code, URLs, and long error logs tend to use *more* tokens per line, because punctuation, indentation, and unusual strings get split into extra pieces.
You do not need to count tokens by hand. You need the intuition:
- Short, focused instructions use few tokens.
- Whole files, long chats, and raw logs use many tokens.
- Everything the model reads *and* everything it writes counts.
That last point surprises people. The meter runs in both directions.
The five token types you will actually meet
| Token type | What it is | Everyday example |
|---|---|---|
| Input tokens | Everything the model reads for this request: your prompt, system instructions, attached files, and the conversation so far. | Your question plus CONTEXT.md plus the last twenty messages. |
| Output tokens | Everything the model writes back: answers, code, explanations. | A 400-line component it just generated. |
| Reasoning tokens | The model's private working-out, used by reasoning models before they answer. You pay for the thinking even when you only see the final answer. | A coding model trying three approaches before proposing one fix. |
| Cached tokens | Input the system has seen before and stored, so it can be reused at a discount instead of reprocessed at full price. | The same SPEC.md sent with every request in a long agent session. |
| Tool output tokens | Results that come back from tools and get fed to the model as new input: file contents, terminal output, test results, search results. | A 5,000-line log you asked the agent to "just take a look at." |
Think of it this way: input tokens are what you hand the model, output tokens are what it hands back, reasoning tokens are the scribbled notes it makes in between, cached tokens are photocopies it kept to save time, and tool output is the pile of documents its assistants keep dropping on the desk.
The context backpack
Picture every AI session as a backpack the model carries while it works.
┌─────────────────────────────────┐
│ CONTEXT BACKPACK │
│ │
│ [system instructions] │
│ [your prompt] │
│ [CONTEXT.md + SPEC.md] │
│ [attached files] │
│ [terminal + test output] │
│ [earlier messages + mistakes] │
│ [model's draft answer] │
│ │
│ Space left: shrinking... │
└─────────────────────────────────┘
Every item takes room. Instructions take room. Project files take room. Tool results take room. Old mistakes you already fixed *still take room*, because they are sitting in the history. The model's own draft takes room too.
The backpack has a fixed size — that is the context window, which you will study in the next lesson. Tokens are the things filling it. When the backpack overflows, the oldest or least-attended items effectively fall out, or the whole session gets slower and sloppier. And with API pricing, which becomes the focus of Class 12, every item in the backpack also adds to the bill.
Why one paste can change everything
Compare two requests to a coding agent:
1. "In pricing.js, rename the trialDays variable to trial_period_days and update its two references." 2. "Here is my entire 40-file project plus the last 300 lines of server logs. Something is broken somewhere. Fix it."
Request 1 uses a small, known file set. The model reads little, writes little, and reasons briefly. Request 2 loads dozens of files the model may not need, adds thousands of lines of log noise, forces long reasoning over mostly irrelevant text, and invites a huge output. It is slower, less focused, and more expensive — before the model has even made its first decision.
Agent loops multiply this. An agent that reads files, runs commands, reads the output, retries, and continues is spending tokens on *every step*. A loop that retries five times on a bloated context can easily cost ten times what a single focused request costs. That is not a pricing trick. It is the meter doing exactly what it was designed to do.
Exercise: estimate the heaviest backpack
Look at these five inputs. Rank them from most to least context they would consume, and write one sentence for each explaining why. You do not need exact numbers — the reasoning is the skill.
1. A two-sentence question with no attachments. 2. A single 200-line component file plus a one-paragraph task. 3. A 3,000-line production log pasted in full with "find the bug." 4. A ten-message back-and-forth where you changed your mind twice about the design. 5. An agent task that reads five files, runs the test suite twice, and retries after two failures.
Done looks like: a ranked list (1–5) with a reason per item, saved in your project notes.
Quick check: if you ranked the full log (#3) or the retrying agent loop (#5) at the top, you are thinking correctly. Raw machine output and repeated loops are the fastest way to fill a backpack. If you ranked the two-sentence question highest, re-read the token-types table above.
Common mistake: assuming output is free. A model that writes a 1,000-line file nobody asked for just spent more than the careful prompt that constrained it to 50 lines.
Check your understanding
1. What is a token, roughly, in plain English? 2. Which token type covers the model's private thinking before it answers? 3. Why does a pasted server log cost more than it looks like it should? 4. What is the difference between input tokens and tool output tokens? 5. Why can an agent loop cost far more than a single chat reply?
ARTICLE DISCUSSION
JOIN THE
CONVERSATION.
Got a question, a take, or a better way to do this? Log in and leave a comment.
