Real-time context monitoring.
Inside your editor.
Track token budgets with real tokenizers, score tab relevance, and manage context — available as a VS Code extension, MCP server, and CLI. v3.1.3
ext install vfaraji89.tokalatorFirst 30 days (Feb 4 – Mar 6, 2026) · 82.98% page-to-acquisition conversion · 124 tests across 6 files
Screenshots



Features
▣ Token Budget Dashboard
Activity bar sidebar panel showing real-time token usage, budget meter, per-file breakdown, and active tokenizer info.
View via sidebar iconVS Code◎ @tokalator Chat Participant
Eleven chat commands for inline budget management directly in Copilot Chat.
@tokalator /count, /optimize, /breakdown, /pin, /unpin, /instructions, /model, /compaction, /preview, /reset, /exitVS Code⬡ Tab Relevance Scoring
Ranks open tabs by relevance using import analysis, path similarity, edit recency, and diagnostics.
tokalator.optimizeVS Code⊕ Model-Specific Tokenizers
Real BPE tokenizers per provider — Claude BPE for Anthropic, o200k_base for OpenAI. No more guessing at 4 chars per token.
@tokalator /modelVS Code◇ 17 Model Profiles
Built-in profiles for Claude Opus/Sonnet/Haiku 4.x, GPT-5.4, GPT-5.4 Mini, GPT-5.2/5.1 Codex, GPT-4.1, o3, o4-mini, Gemini 3.x Pro/Flash, Gemini 2.5 Pro. Context windows and rot thresholds auto-configured.
Settings: tokalator.modelVS Code⚠ Context Rot Warnings
Warns when conversation turns exceed the model's threshold. Each model has its own rot limit based on benchmarks.
AutomaticVS Code⊕ Pinned Files
Pin important files so they are always treated as high-relevance in context scoring.
@tokalator /pin <file>VS Code◈ Instruction File Scanner
Detects and tokenizes instruction files silently injected into every prompt: .github/copilot-instructions.md, CLAUDE.md, AGENTS.md, .cursorrules, and .instructions.md. Reveals hidden per-file token cost.
@tokalator /instructionsVS Code▹ Next Turn Preview
See estimated token cost of your next message before sending. Dashboard shows a live preview box with growth projections and overflow warnings.
@tokalator /previewVS Code◉ Session Management
Track per-turn context growth with compaction analysis. Reset sessions, save summaries, and see last session stats on activation.
@tokalator /compaction, /reset, /exitVS Code⬡ MCP Server for Claude Code
Brings real Claude BPE token counting into Claude Code and any MCP-capable agent via stdio transport. Four tools: count_tokens, estimate_budget, preview_turn, list_models. Zero API calls — fully offline.
claude mcp add --transport stdio tokalator -- node tokalator-mcp/build/index.jsMCP◆ CLI — tokalator count, budget, preview, models
Standalone terminal tool for non-VS Code workflows. Count tokens in files, get full budget breakdowns, preview next-turn cost, and list Claude model profiles — all from the command line.
npm install -g . (from tokalator-mcp/) · tokalator count src/main.ts · tokalator budget src/**/*.tsCLIConfiguration
| Setting | Default | Description |
|---|---|---|
tokalator.model | claude-opus-4.6 | AI model to calculate context budget against. Sets tokenizer, context window, and rot threshold automatically. |
tokalator.relevanceThreshold | 0.3 | Tabs below this relevance score are marked as distractors (0–1) |
tokalator.windowSize | 1,000,000 | Override context window size in tokens. Leave at default to use the selected model's window. |
tokalator.contextRotWarningTurns | 20 | Warn about context rot after this many chat turns |
tokalator.autoRefreshInterval | 2000 | Dashboard refresh interval in milliseconds |
MCP Server & CLI
Real Claude BPE token counting inside Claude Code via stdio MCP transport, plus a standalone terminal CLI for SSH sessions, containers, and non-VS Code workflows.
█████ ███ █ █ █ █ █ █████ ███ ████ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ ███ █████ █ █████ █ █ █ ████ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ ███ █ █ █ █ █████ █ █ █ ███ █ █
Architecture
6 layers inside the extension:
Core Engine
Subscribes to VS Code editor events (active editor, tab open/close, document edits, diagnostics). Builds ContextSnapshot records, manages pinned files and model selection via workspaceState. All handlers debounced 300 ms.
Tokenizer Service
Provider-specific BPE tokenizers — claude-tokenizer for Anthropic, o200k_base (js-tiktoken) for OpenAI, heuristic (~4 chars/token) for Gemini. Lazy-loaded and cached per document URI + version.
Relevance Scorer
Scores each open tab R ∈ [0, 1]: language match (0.25), import analysis (0.30), path similarity (0.20), edit recency (0.15), diagnostics (0.10). Pinned and active tabs override to R = 1.0.
Context Optimizer
Identifies distractor tabs (R < 0.3) and closes them via /optimize or the Optimize Tabs button. Reduces attention dilution by removing files unlikely to contribute to the current task.
Chat Participant
@tokalator with 11 slash commands — /count, /optimize, /breakdown, /pin, /unpin, /instructions, /model, /compaction, /preview, /reset, /exit.
MCP Server & CLI (tokalator-mcp)
Separate component: exposes count_tokens, estimate_budget, preview_turn, list_models to Claude Code via stdio MCP transport. Also ships a standalone CLI binary for terminal workflows.
Tokenizers
Each provider uses its own tokenizer for accurate token counts:
| Provider | Models | Tokenizer | Source |
|---|---|---|---|
| Anthropic | Opus 4.6, Opus 4.5, Sonnet 4.6, Sonnet 4.5, Sonnet 4, Haiku 4.5 | Claude BPE | @anthropic-ai/tokenizer |
| OpenAI | GPT-5.4, GPT-5.4 Mini, GPT-5.2 Codex, GPT-5.1 Codex, GPT-4.1, o3, o4-mini | o200k_base | js-tiktoken |
| Gemini 3.1 Pro, Gemini 3 Pro, Gemini 3 Flash, Gemini 2.5 Pro | Heuristic | ~4 chars/token (no official JS tokenizer) |
Installation
◉ Marketplace
ext install vfaraji89.tokalatorRequires VS Code 1.99+
◇ VSIX
- Download tokalator-3.1.3.vsix from releases
- Cmd+Shift+P → Extensions: Install from VSIX...
- Select the downloaded .vsix file
code --install-extension tokalator-3.1.3.vsix◆ Build from Source
git clone https://github.com/vfaraji89/tokalator.git cd tokalator/tokalator-extension-vs npm install npm run compile
◆ CLI (npm)
Requires Node.js 18+
- git clone https://github.com/vfaraji89/tokalator.git
- cd tokalator/tokalator-mcp && npm install && npm run build
- npm install -g .
tokalator count src/main.ts tokalator budget src/**/*.ts tokalator preview 42000 tokalator models
⬡ MCP Server (Claude Code)
Requires Node.js 18+ and Claude Code
- Build the CLI first (see above)
- claude mcp add --transport stdio tokalator -- node tokalator-mcp/build/index.js
- In Claude Code: /mcp → verify tokalator is listed
claude mcp add --transport stdio tokalator -- node tokalator-mcp/build/index.js