Understanding token limits in AI coding tools
Tokens decide how much an AI can read, how much you pay and when you hit a usage limit. Here's how they work across the main AI coding tools, in plain language.
Almost every AI coding tool measures your usage in tokens, directly or behind credits and limits. Understanding them explains why long sessions hit limits, why big projects cost more, and how to stretch your plan.
What a token is
AI models read and write text in chunks called tokens: a word, part of a word or a symbol. OpenAI's rule of thumb is that one token is about four characters, or three-quarters of an English word, so 100 tokens is about 75 words. Anthropic notes it depends on the model and the language, and its newer Claude models use a tokeniser that produces about 30% more tokens for the same text. Code, with its symbols and spacing, often splits into more tokens than plain prose.
There are two kinds:
- Input tokens: everything sent to the model, including your message, the whole conversation so far, the instructions, and every file and tool result it reads.
- Output tokens: what the model writes back, including its hidden reasoning. On Claude's current models, output costs five times as much as input.
Context windows: how much the AI can hold
The context window is the most a model can consider at once. Claude's current Opus, Sonnet and Haiku 5.5 models have a 1-million-token window. In Codex, OpenAI lists a default of 272,000 tokens for GPT-6.2 Astra and 500,000 for GPT-6.2 Sol, configurable up to 1 million. Open models you run yourself are often smaller by default: Qwen3.8-27B handles about 262,000 tokens natively (extendable to 1 million), and Gemma 4 128,000 to 256,000, depending on size.
Bigger isn't automatically better. Anthropic notes that as the token count grows, a model's accuracy and recall degrade. When a session nears the limit, Claude Code and Codex compact it automatically, summarising earlier turns; you can also run /compact yourself.
Usage limits on subscriptions
| Tool | How usage is limited |
|---|---|
| Claude Code (Claude Pro, Max, Ultra) | Pro and Max: a session limit that resets every five hours, plus weekly limits, shared with Claude chat; Max gives 5x Pro's usage. Ultra: 10x Pro's weekly usage, with no five-hour limit on verified accounts |
| Codex (ChatGPT plans) | Local messages per five-hour window on Plus, in ranges that depend on the model (OpenAI says these aren't fixed limits); weekly limits may apply |
| Cursor | An included usage pool that refreshes weekly; third-party models at API prices |
| GitHub Copilot | AI credits (1 credit = $0.01): Pro includes 1,500 a month, Pro+ 7,000; code completions don't use credits |
| Lovable | Credits: 1 per Plan-mode message; Build mode varies with the size of the change |
| Bolt | Tokens directly; most go on reading and syncing your project files |
| Replit | Effort-based pricing per request, drawn from your monthly credits, with top-ups beyond the allowance |
As described in each vendor's documentation in November 2026.
Notice the common thread: the more the AI has to read, the faster you use your allowance. A long conversation re-sends its history every turn, and a big project means more files read per request.
What tokens cost on the API
If you pay per use through an API, prices are per million tokens. Anthropic lists Claude Opus 5.5 at $4 input and $20 output, Sonnet 5.5 at $2 and $10, and Haiku 5.5 from $0.10 and $0.50 (for prompts up to 100,000 tokens). OpenAI lists GPT-6.2 Sol at $2 and $10 (up to 272,000 input tokens). Prompt caching and batch processing reduce these costs further.
How to make your limits go further
From Anthropic's and OpenAI's own advice:
- Start fresh between tasks. In Claude Code,
/cleardrops stale context; in Codex, keep one chat per piece of work. - Compact long sessions with
/compact. - Use a smaller model for simple work, such as Sonnet or Haiku instead of Opus, or lower the reasoning effort.
- Keep instruction files short. Anthropic suggests keeping each CLAUDE.md under 200 lines; OpenAI says a short, accurate AGENTS.md beats a long one.
- Turn off tools you don't use, such as unused MCP servers, which still add their names and instructions to every request.
- Check where your tokens go with Claude Code's
/contextand/usage, or Codex's/status.
Local models: no token bill
When a model runs on your own computer, there's no per-token charge and no usage cap. The limits are different: your computer's memory, and the context length you give the model (more context needs more memory). See what computer you need for local AI.
Tokens in Nexus
Nexus itself never meters your work: there are no Nexus tokens or credits. With a local model, through its built-in MLX engine or Ollama, there's no token bill at all. When you switch to Claude Code by Anthropic or the Codex app by OpenAI in the same chat, they use your own plan's usage limits as described above. Nexus will be a one-time purchase of $199 USD, with no Nexus subscription; it needs an Apple silicon Mac with macOS 12 or later (14 or later for local models and the Codex app, 13 or later for Claude Code). Connecting third-party AI services such as Claude Code or Codex is optional and at your own expense (see Nexus pricing). It's coming soon.
Frequently asked questions
How many words is a token?
Roughly three-quarters of an English word on average, according to OpenAI, though it varies by model and language. Code and newer tokenisers can produce more tokens for the same text.
Why do I hit my Claude Code limit so fast?
Every request sends the whole conversation and the files Claude reads, so long sessions use more tokens each turn. Most of Claude's paid plans have a five-hour session limit, and all have weekly limits, shared between Claude chat and Claude Code.
Do local AI models have token limits?
There's no per-token bill or usage cap with a model running on your own computer. The limits are your computer's memory and the context length you set.