Real-time context monitoring.
Inside your editor.

Track token budgets, estimate costs per turn, score tab relevance, and manage context — available as a VS Code extension, MCP server, and CLI. v3.1.7

ext install vfaraji89.tokalator
13Features
5Settings
VS Code 1.99+Minimum version
MITLicense
156Total acquisitions
82.98%Conversion rate
220+Community devs
124Unit tests

First 30 days (Feb 4 – Mar 6, 2026) · 82.98% page-to-acquisition conversion · 124 tests across 6 files

~50iLab / Kariyer.netInternal deployment — engineers used the extension for one week
~90SaaS BridgeIstanbul, March 4 2026
~80TechCareerIstanbul, March 5 2026

Screenshots

Tokalator sidebar dashboard showing Context Engineering stats, API Cost Simulation, and budget breakdown
Sidebar dashboard — Context Engineering stats, API Cost Simulation, and budget breakdown
Tokalator running in VS Code — token budget sidebar alongside the editor
Tokalator in VS Code — context budget sidebar alongside your editor

What's New in v3.1.7

%

Context Engineering Stats

A new sidebar panel tracks how your context budget is being spent: context-window percentage used, turns-to-rot, measured tokens/turn growth from your actual history, and estimated turns left. Next-turn and turns-left projections render only from measured turns, never fabricated defaults.

Plus: model auto-detected from your Copilot chat, cost box relabeled API Cost Simulation
/

Generate Glossary

The new /terminology-gen chat command scans your workspace Markdown docs for terminology sources, measures their real token cost, and estimates how much a generated glossary could compress them. Available free from the dashboard feature panel.

Also: redesigned abacus-branded dashboard, 17 models on May 2026 pricing (Claude Opus 4.8, GPT-5.5, Gemini 3.5 Flash)

Features

1

Token Budget Dashboard

Activity bar sidebar panel showing real-time token usage, budget meter, per-file breakdown, cost estimation, and active tokenizer info.

View via sidebar iconVS Code
2

@tokalator Chat Participant

Twelve chat commands for inline budget management directly in Copilot Chat.

@tokalator /count, /optimize, /breakdown, /pin, /unpin, /instructions, /model, /compaction, /preview, /reset, /terminology-gen, /exitVS Code
3

Tab Relevance Scoring

Ranks open tabs by relevance using import analysis, path similarity, edit recency, and diagnostics.

tokalator.optimizeVS Code
4

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
5

17 Model Profiles

Built-in profiles for Claude Opus/Sonnet/Haiku 4.x (incl. Opus 4.8), GPT-5.5, 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, rot thresholds, and per-MTok pricing auto-configured.

Settings: tokalator.modelVS Code
6

Context Rot Warnings

Warns when conversation turns exceed the model's threshold. Each model has its own rot limit based on benchmarks.

AutomaticVS Code
7

Pinned Files

Pin important files so they are always treated as high-relevance in context scoring.

@tokalator /pin <file>VS Code
8

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
9

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
10

$ Price Estimation

Live cost breakdown in the sidebar dashboard — input token cost, output token cost (at max capacity), and total estimated turn cost. Per-MTok rates shown for all 17 models. Also visible in /count and /model chat commands.

Automatic in dashboard, @tokalator /countVS Code
11

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
12

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
13

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/**/*.tsCLI

Configuration

SettingDefaultDescription
tokalator.modelclaude-opus-4.8AI model to calculate context budget against. Sets tokenizer, context window, and rot threshold automatically.
tokalator.relevanceThreshold0.3Tabs below this relevance score are marked as distractors (0–1)
tokalator.windowSize1,000,000Override context window size in tokens. Leave at default to use the selected model's window.
tokalator.contextRotWarningTurns20Warn about context rot after this many chat turns
tokalator.autoRefreshInterval2000Dashboard 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.

tokalator — cli
user@machine ~/my-repo $ tokalator
tokalatorv3.1.7
~/my-repoclaude-opus-4.8
>Type @ to mention files, / for commands, or ? for shortcuts
shift+tab switch mode

Architecture

7 layers inside the extension:

1

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.

2

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.

3

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.

4

Cost Estimator

Computes per-turn cost from model pricing (inputCostPerMTok, outputCostPerMTok) and current token counts. Input cost from files + overhead, output cost from model max output. Displayed in sidebar dashboard and /count command.

5

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.

6

Chat Participant

@tokalator with 11 slash commands — /count, /optimize, /breakdown, /pin, /unpin, /instructions, /model, /compaction, /preview, /reset, /exit.

7

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:

ProviderModelsTokenizerSource
AnthropicOpus 4.6, Opus 4.5, Sonnet 4.6, Sonnet 4.5, Sonnet 4, Haiku 4.5Claude BPE@anthropic-ai/tokenizer
OpenAIGPT-5.4, GPT-5.4 Mini, GPT-5.2 Codex, GPT-5.1 Codex, GPT-4.1, o3, o4-minio200k_basejs-tiktoken
GoogleGemini 3.1 Pro, Gemini 3 Pro, Gemini 3 Flash, Gemini 2.5 ProHeuristic~4 chars/token (no official JS tokenizer)

Installation

Marketplace

ext install vfaraji89.tokalator

Requires VS Code 1.99+

VSIX

  1. Download tokalator-3.1.7.vsix from releases
  2. Cmd+Shift+P → Extensions: Install from VSIX...
  3. Select the downloaded .vsix file
code --install-extension tokalator-3.1.7.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+

  1. git clone https://github.com/vfaraji89/tokalator.git
  2. cd tokalator/tokalator-mcp && npm install && npm run build
  3. 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

  1. Build the CLI first (see above)
  2. claude mcp add --transport stdio tokalator -- node tokalator-mcp/build/index.js
  3. In Claude Code: /mcp → verify tokalator is listed
claude mcp add --transport stdio tokalator -- node tokalator-mcp/build/index.js