Token

A token is the unit into which an AI model such as Claude splits text: a piece of a word, a short word or a symbol. Claude Code counts everything Claude reads and writes in tokens, and both the cost and the usage limits depend on how many are used. In a different sense, “token” also means an access key, a kind of password for programs.

A small piece of text (roughly a short word) used to measure how much Claude reads and writes, and so the cost. Careful: “token” also means an access password.

You’ll also find it as: tokens

How it shows up in Claude Code

Every message sent to Claude carries the whole conversation so far, not just your latest sentence. That’s why the bigger the context, the more tokens each message uses. The /usage command (which also answers to /cost) shows what the current session has used and, on a subscription, how much of your limit is gone. The /context command shows what is taking up space. The documentation recommends a few habits: /clear between unrelated tasks, a short CLAUDE.md, the right model for the job and precise prompts.

Example

The same request, with very different usage:

improve the project
add email address validation to the login function in @src/auth.js

The first request makes Claude read many files to work out what you want, and every file read costs tokens. The second tells it exactly where to work, so it reads little and finishes quickly.

Common mistakes

  • Mixing up the two meanings. In the lesson on GitHub Actions, CLAUDE_CODE_OAUTH_TOKEN is an access key, not a piece of text. A key like that never goes into code or into CLAUDE.md.
  • Conversations that run all day. A short message in a huge conversation still uses tokens for the whole conversation.
  • Opus for everything. Sonnet handles most coding tasks well and costs less; Haiku suits simple subagent tasks.
  • MCP servers left on for nothing. You can turn off the ones you don’t use from /mcp.

Related terms and where you learn it

Tokens fill the context, and /compact reduces them with a summary. Usage differs between Opus, Sonnet and Haiku. You learn it in the lesson “How do you save tokens and money?” in module 11, Pro tips.

Source: Claude Code documentation: Manage costs effectively

How it appears in the course

A “password for programs”. You pay for what you use, counted in tokens (small pieces of text, roughly a syllable or a short word).

How do you sign in to your account? · Module 00, Installation and first steps · free

$MY_TOKEN means: “take the key from a variable on the computer”. You don’t write it directly in the command.

How do you connect a server? · Module 08, MCP: connecting to other apps

${GITHUB_TOKEN} is an empty spot. Claude Code fills it in with the key saved on each colleague’s computer.

How do you share servers with the team? · Module 08, MCP: connecting to other apps

Learn Claude Code from zero, in plain English

12 modules with 1–2 minute lessons, which you can also do on your phone. The first two modules are free.