Tokalator 🧮Count your tokens like beads on an abacus. A VS Code extension that shows you where your AI context budget is going — and helps you optimize it. The ProblemAI coding assistants (Copilot, Claude, etc.) have finite context windows. A common complaint is "context rot," where performance degrades as conversations exceed a certain number of tokens. Opus 4.6 performs markedly better than its predecessors: on the 8-needle 1M variant of MRCR v2, Opus 4.6 scores 76%, whereas Sonnet 4.5 scores just 18.5%. This is a qualitative shift in how much context a model can actually use while maintaining peak performance. Still, when you have 30 tabs open, your assistant's attention gets diluted across irrelevant files. You can't see what's happening. Until now. FeaturesToken Budget DashboardA sidebar panel that shows your context usage at a glance:
Chat Commands (
|
| Command | Description |
|---|---|
@tokalator /count |
Current token count and budget level |
@tokalator /breakdown |
See where tokens are going |
@tokalator /optimize |
Close low-relevance tabs |
@tokalator /pin <file> |
Pin a file as always-relevant |
@tokalator /unpin <file> |
Unpin a file |
@tokalator /instructions |
List instruction files and their token cost |
@tokalator /model [name] |
Show or switch the active model |
@tokalator /compaction |
Per-turn growth and compaction advice |
@tokalator /preview |
Preview token cost before sending |
@tokalator /reset |
Reset session (clear turn counter) |
@tokalator /exit |
End session and save summary |
Smart Relevance Scoring
Files are scored based on:
- Same language as active file
- Import relationships (active file imports this tab)
- Path similarity (nearby in directory tree)
- Recently edited
- Has diagnostics (errors you're debugging)
What We Fixed
- No fake precision — shows LOW/MEDIUM/HIGH instead of meaningless "67.3%"
- Memory cleanup — token cache clears when documents close
- Turn counter logic — read-only commands don't inflate the counter
- Persistent pins — pinned files survive VS Code restart
Usage
- Sidebar: Click the abacus icon (🧮) in the Activity Bar
- Chat: Type
@tokalatorin Copilot/Claude Chat - Status Bar: Quick budget indicator in bottom-right
Settings
| Setting | Default | Description |
|---|---|---|
tokalator.relevanceThreshold |
0.3 |
Tabs below this are marked low-relevance |
tokalator.windowSize |
1000000 |
Context window size in tokens (1M for Opus 4.6) |
tokalator.contextRotWarningTurns |
20 |
Warn after this many chat turns |
tokalator.autoRefreshInterval |
2000 |
Dashboard refresh interval (ms) |
Known Limitations
- Real BPE tokenizers for Claude and OpenAI; Gemini uses heuristic (~1 token per 4 characters)
- Import parsing uses regex, which misses some edge cases (multi-line imports, dynamic imports)
- Relevance weights are not scientifically tuned
- Conversation cost estimated at ~800 tokens/turn (varies by message length)
Requirements
- VS Code 1.99+
- GitHub Copilot or similar AI extension (for chat features)
License
MIT