Your AI Context Control Center for GitHub Copilot and Cursor. Analyse prompts, trim noisy tabs, track session cost, and send better context — all locally, no data leaves your machine.
What You Get
📋 Context Tab
- Token status — See how many tokens your open tabs consume (green/yellow/red)
- Token-Optimized Prompt — Mentions a function like
processPayment? TokenDock inlines the exact code so Copilot doesn't load whole files. Shows token savings vs full-file context - Uncommitted Changes — Lists files with git changes so you can open them for Copilot to see your latest work
- Large Open Tabs — Big files eating your token budget. Close the ones you don't need
- Git History Insights — Scan your repo's commit history to find files that usually change together with what you're working on
- Mode Recommendation — Suggests Ask vs Agent vs Plan based on prompt complexity (Ask is 25× cheaper than Agent for simple questions)
✏️ Prompt Tips Tab
- 12+ rule-based checks — Catches vague language, missing
#file:refs, filler phrases, multi-task prompts, no stopping condition, missing output format, and more - Suggested Prompt — A rewritten version of your prompt that's clearer and more specific. Copy or send to chat with one click
- Local AI enhancement — Optionally use Qwen via Ollama for smarter prompt rewrites (rule-based works without it)
📊 Session Tab
- 💰 Session cost — Real $ spent in your current chat session
- ⚡ Response speed — Tracks how fast Copilot responds. If it's slowing down, start a new chat
- 🧠 Context window fill — How full your chat memory is. Over 80% = Copilot starts forgetting earlier messages
- ♻️ Cache reuse — % of tokens reused from cache. Higher = cheaper follow-ups. Stay in one chat to keep this high
- 🔧 Tool usage — Which Copilot tools (file reads, edits, terminal) are used most in your session
- 📜 Cross-session history — Aggregate stats across all your past Copilot chats in this workspace
How to Use
- Click the 🤖 TokenDock icon in the Activity Bar (left sidebar)
- Paste your prompt → click 🔍 Analyse (or
Cmd+Shift+J/Ctrl+Shift+J) - Context tab — close noisy tabs, open missing files, review inline code extraction
- Prompt Tips tab — expand any tip for details, copy the suggested prompt
- Session tab — monitor cost, speed, and cache reuse
Works With
- VS Code — full support
- Cursor — works with fallback for Cursor's chat commands
Local AI Setup (Optional)
TokenDock is fully functional without Ollama — rule-based suggestions work out of the box. Enable Ollama only if you want Qwen 2.5 Coder to rewrite your prompts.
One-time install
brew install ollama
ollama pull qwen2.5-coder:7b
Turning Ollama ON
Cmd+Shift+P→ TokenDock: Start Ollama (Qwen) (or open a terminal and runollama serveyourself)- Settings (
Cmd+,) → enablecopilotAdvisor.enableLocalAiSuggestedPrompt - Suggested prompts now show 🤖 Qwen + rules
Turning Ollama OFF
- Disable
copilotAdvisor.enableLocalAiSuggestedPrompt(this alone stops all HTTP calls) Cmd+Shift+P→ TokenDock: Stop Ollama to kill the daemon (or runpkill -f "ollama serve"— Ollama has no built-in stop subcommand)- Suggested prompts fall back to 📋 Rule-based
Settings
| Setting | Default | Description |
|---|---|---|
copilotAdvisor.enableLocalAiSuggestedPrompt |
false |
Enable Qwen AI enhancement (requires Ollama running) |
copilotAdvisor.localAiModel |
qwen2.5-coder:7b |
Ollama model name |
copilotAdvisor.localAiTimeoutMs |
30000 |
Timeout for AI response (ms) |
copilotAdvisor.fileExtensions |
[php, js, ts, ...] |
File types to scan |
copilotAdvisor.maxFilesToScan |
50 |
Max workspace files to analyse |
Keyboard Shortcuts
| Shortcut | Action |
|---|---|
Cmd+Shift+J (Mac) / Ctrl+Shift+J (Win/Linux) |
Run analysis |
Cmd+Enter in sidebar input |
Run analysis |