A VS Code extension that counts tokens for the active editor using OpenAI tiktoken and shows the result in the status bar.
What This Project Does
vscode-tokencount helps you estimate prompt size while writing code or text by showing live token counts in VS Code.
Shows Tokens: <count> in the status bar for the active editor.
Recomputes count when you type, switch editors, save files, or change extension settings.
Supports two counting sources:
encoding mode (direct tiktoken encoding, such as cl100k_base)
model mode (model mapping, such as gpt-4o-mini)
Uses adaptive debounce for large files to keep the UI responsive.
Optionally includes untitled files and can render on the left or right side of the status bar.
Provides a detailed breakdown (tokens, characters, lines, selected source, resolved encoding) in an output panel.
Only file-backed documents (file:) are counted by default, plus untitled documents when enabled. Non-file schemes (for example git: virtual documents) are intentionally skipped.