← Terse Blog
Spell Correction

How Typos Inflate AI Agent Costs

By ·Founder, Terse·Updated

A typo costs more than embarrassment. Misspelled words fall out of the tokenizer's vocabulary and shatter into two to four times as many tokens, and in agent workflows a misspelled identifier or path can cause a failed tool call — which means a full retry loop billed on top of the original attempt. Fixing typos before the prompt is sent is the cheapest optimization there is.

Cost #1: Typos Break Tokenization

Subword tokenizers price text by how familiar it is. Correctly spelled common words match the vocabulary whole: "authentication" is one or two tokens. Misspell it and the greedy matcher can't find the long entry, so the word shatters into fragments:

"authentication"   → 1-2 tokens
"authetnication"   → 4-5 tokens ("aut", "et", "n", "ication")
"the"              → 1 token
"teh"              → 2 tokens
"function"         → 1 token
"funciton"         → 3 tokens

A single transposition typically doubles or triples that word's cost. Sprinkle a handful of typos through a long prompt and you've added a measurable surcharge — while simultaneously making the text statistically weirder and marginally harder for the model to read. (Why fragmentation happens is covered in Tokenization 101.) Models are good at guessing what you meant, but you're paying extra tokens for the privilege of making them guess.

Cost #2: Typos Break Tool Calls

In chat, a typo is a few wasted tokens. In an agent session, it can be a wasted turn — and turns are expensive, because each one re-bills the whole context. The failure chain looks like this:

That recovery loop typically costs one to three extra model turns, each carrying your full conversation history as re-billed input, plus the failed tool output that now sits in the window for the rest of the session (see the context window diet for why stale output keeps costing). A one-character typo in a file path can easily burn 10,000+ tokens of recovery — the single worst cost-per-character ratio in AI usage.

Cost #3: Ambiguity Compounds

There's a quieter third cost. When a prompt mixes typos with intentional oddities — real variable names like usr_cnt, real flags like -rf, project-specific jargon — the model has to decide which unusual strings are mistakes and which are meaningful. Every typo you send erodes its confidence about the strings that matter, occasionally producing "corrections" of things that were correct. Clean input keeps the signal unambiguous: anything unusual that remains is intentional.

The Fix: Correct Before You Send

Fixing typos after the model has misread them costs a round trip. Fixing them before the prompt is sent costs nothing, which is why spell correction is the first stage of Terse's optimization pipeline — it runs in every mode, including the gentlest:

For Claude Code and other agent tools, the payoff is doubled: corrected prompts tokenize cheaper going in, and correctly spelled identifiers and paths mean tool calls succeed on the first attempt instead of the third. Cheap insurance against the most expensive kind of typo.

Fix Typos Before They're Billed

Terse corrects prompt typos on-device before sending — cheaper tokenization in, fewer failed tool calls out. Code and identifiers are never touched. Free to start.

Download Terse

Frequently Asked Questions

How much does a typo cost in tokens?

A misspelled word typically tokenizes into 2-4x as many tokens as its correct form, because it no longer matches the tokenizer's vocabulary whole. In agent sessions the real cost is larger: a typo in a file path or identifier can trigger failed tool calls and retry turns worth thousands of tokens.

Do AI models understand prompts with typos?

Usually yes for prose — models are robust readers. But you pay extra tokens for fragmented words, and in agent workflows a misspelled path or symbol is often taken literally, causing wrong or failed tool calls rather than a graceful guess.

Won't a spellchecker break my variable names and commands?

Not a prompt-aware one. Terse only corrects natural-language regions and treats code, identifiers, file paths, quoted strings, and backticked text as immutable — and shows a diff of every correction so nothing changes silently.

Further Reading

Related reading

Claude Code cost trackers, comparedSeven Claude Code cost trackers compared in 2026: ccusage, Claude-Code-Usage-Monitor, TokenTrack… Why Is Claude Code So Expensive? (2026)Why is Claude Code so expensive? The real cost drivers in 2026 — Opus pricing, context that re-s… Selective Context Pruning — How Terse Removes Redundant Context from AI Selective context pruning removes redundant information from AI conversation history. Learn how … Cursor Pricing 2026: Plans & Real Token CostsCursor pricing in 2026: Hobby $0, Pro $20/mo, Pro+ $60, Ultra $200, Teams $40/user. Each paid pl…