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.tokalator
12Features
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 token budget, next turn preview, and budget breakdown
Sidebar dashboard — live token budget, next turn preview, and budget breakdown
Tokalator /breakdown command in chat showing file token counts and relevance scores
@tokalator /breakdown — per-file token counts and relevance scores in chat
Tokalator chat command autocomplete showing all @tokalator slash commands
11 chat commands via @tokalator — full context management workflow

Features

1

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
2

@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
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, 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
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

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
11

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
12

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.6AI 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
Welcome to Tokalator
CLI Version
~/my-repoclaude-opus-4.6 (3×)
>Type @ to mention files, / for commands, or ? for shortcuts
shift+tab switch mode

Architecture

6 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

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.

5

Chat Participant

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

6

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.3.vsix from releases
  2. Cmd+Shift+P → Extensions: Install from VSIX...
  3. 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+

  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