Token Efficiency Encyclopedia

Token-Aware Formatting

Remove unnecessary whitespace, comments, or metadata. Use shorter variable names in code contexts. Avoid repeating system instructions on every turn if the provider supports prompt caching.

How It Works

The prompt is formatted to minimize token count without changing semantic meaning. Techniques include stripping redundant whitespace, abbreviating identifiers, removing boilerplate comments, and deduplicating repeated instructions.

Techniques

Trade-offs

When to Use

Best for code-heavy prompts where the model needs the logic, not the presentation. Less useful for natural-language tasks where tone and structure matter.

See Also

Tools