████████╗ ██████╗ ██╗ ██╗███████╗███╗ ██╗ ██████╗ ██████╗ ██╗ ██╗███╗ ██╗████████╗███████╗██████╗
╚══██╔══╝██╔═══██╗██║ ██╔╝██╔════╝████╗ ██║ ██╔════╝██╔═══██╗██║ ██║████╗ ██║╚══██╔══╝██╔════╝██╔══██╗
██║ ██║ ██║█████╔╝ █████╗ ██╔██╗ ██║ ██║ ██║ ██║██║ ██║██╔██╗ ██║ ██║ █████╗ ██████╔╝
██║ ██║ ██║██╔═██╗ ██╔══╝ ██║╚██╗██║ ██║ ██║ ██║██║ ██║██║╚██╗██║ ██║ ██╔══╝ ██╔══██╗
██║ ╚██████╔╝██║ ██╗███████╗██║ ╚████║ ╚██████╗╚██████╔╝╚██████╔╝██║ ╚████║ ██║ ███████╗██║ ██║
╚═╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝╚═╝ ╚═══╝ ╚═════╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═══╝ ╚═╝ ╚══════╝╚═╝ ╚═╝
📊 Count tokens • 📈 Track history • 🎯 Manage ignored files
Project Token Counter
VSCode extension that displays the total token count of your workspace in the status bar.
Features
📊 Real-time Token Counting
- Accurate token estimation using tiktoken library (cl100k_base encoding, compatible with GPT-4 and Claude)
- Status bar indicator showing total tokens with human-readable format (K for thousands, M for millions)
- Loading animation while counting tokens
- Auto-refresh on file creation, modification, or deletion
📈 Historical Tracking
- Persistent history stored in
.token-counter/history.json
- Timeline view showing last 30 token count snapshots
- Change percentage with stock-market style indicators (green for increase, red for decrease)
- Show all history button to view complete timeline
- Tracks total tokens and file count for each entry
🎯 Smart File Management
- Automatic exclusion of files/folders from
.gitignore
- Common patterns ignored by default (node_modules, build artifacts, binary files, etc.)
- Binary file detection to skip non-text files
- Custom ignore list with per-file ignore/unignore buttons
- Ignored files view showing excluded files and their token counts
🖥️ Retro ASCII Interface
- ASCII art header with TOKEN COUNTER logo
- Terminal-style tables with monospace fonts
- Side-by-side layout for history and files tables
- ASCII-style buttons with bracket design
[ Ignore ]
Usage
- Open a workspace in VSCode
- The token count appears automatically in the status bar (bottom right)
- Click on the indicator to open the detailed view with:
- Summary statistics (total tokens, files, average)
- Historical timeline with percentage changes
- File-by-file breakdown with percentages
- Ignore/unignore controls for custom exclusions
Token Calculation
Token estimation uses the tiktoken library with cl100k_base encoding, providing accurate counts compatible with:
- GPT-4 / GPT-4 Turbo
- GPT-3.5 Turbo
- Claude 3 family
- Other modern language models
Commands
Project Token Counter: Show Details - Open detailed webview
Project Token Counter: Refresh - Manually refresh token count
Data Storage
The extension stores data in .token-counter/ directory:
history.json - Token count history (max 1000 entries)
ignored-files.json - Custom ignored files list
Add .token-counter/ to your .gitignore to keep this data local.
License
MIT
| |