Claude Code tokens: what they are and how they're counted

Dev.to AI
Generative AI NLP

You might have noticed that Claude Code tracks usage via "tokens" consumed, which you've probably seen from the /cost or /context commands, your Anthropic dash, or just in Claude convos. Tokens are the constant, foundational unit that Claude uses to read and generate text. They're not exclusive to Claude, as Claude tokens are the same as NLP tokens, which are what LLMs use to process input and generate. Tokenization in NLP LLMs break text content down into tokens, which are chunks of text that might be somewhere between a character and a full word long.