§01 · The Model

Token

The unit a model reads and writes in — a word fragment, a little shorter than a word — and the unit every limit and price uses.

A token is the chunk of text a model actually processes. Text is split by a tokenizer into pieces that are usually a word, part of a word, or a punctuation mark, and the model reads and writes these pieces rather than characters. In English prose a token averages around four characters, so a thousand words is roughly 1,300 tokens. Code tokenizes worse: indentation, brackets and symbols each cost their own tokens.

Every limit and every price is in tokens. The context window is a token count. Input tokens and output tokens are billed separately. Your usage limit drains in tokens. That's why a pasted log file or a giant JSON blob can quietly wreck a session: it looks like one message to you, but to the model it's tens of thousands of tokens competing for space.

You don't need to count precisely, but you do need a sense of scale. A typical source file is a few thousand tokens; a test run's output can be more; a whole repo is usually far beyond the window. Load what the task touches, use search instead of reading everything, and trim noisy tool output before it lands in context.

In the tools
  • Claude Code/context and /cost show how many tokens the session has used and where they went.
  • Codex/status reports token usage for the current session.
  • Anthropic APIThe count-tokens endpoint tells you a prompt's size before you send it.
In conversation

I pasted the full stack trace and the whole package-lock. Was that bad?

The lock file alone is probably fifty thousand tokens. That's a chunk of the window gone on something it didn't need.

Related terms
Learn it in the school
Words are the easy part

Course 01 puts every one of these terms to work: you install Claude Code, run the loop, and ship a real project — permission modes, compaction, hooks and all.

Start Course 01 →