Docs / Agents
GitHub Copilot
Updated
Tokenade covers the GitHub Copilot CLI (copilot, from the @github/copilot package) through its hooks, with the full feature set. The Copilot extension in VS Code is a different product: it exposes no hook Tokenade can attach to, so only MCP optimisation applies there, and the tokenade commands are used by hand or by the agent after reading the rules.
Copilot CLI: what install writes
Copilot keeps its files in ~/.copilot/ (%USERPROFILE%\.copilot\ on Windows).
| File | What Tokenade adds |
|---|---|
~/.copilot/hooks/tokenade.json | A hook file of its own (Tokenade does not edit your other hook files) |
~/.copilot/copilot-instructions.md | A short Tokenade rules section |
~/.copilot/mcp-config.json | Third-party MCP servers rewritten to start behind tokenade mcp-wrap |
The hooks
| Event | Role |
|---|---|
PreToolUse | Rewrites a shell command to go through tokenade wrap |
postToolUse | Folds large tool results before the model reads them |
UserPromptSubmit | Style note before each prompt |
SessionStart | Session context |
PreCompact | Runs before Copilot compacts the conversation |
subagentStart | Subagent context |
Each entry carries a _tag starting with tokenade-copilot-, which is how upgrades refresh them and uninstall finds them. Like every Tokenade hook, they never block the agent: if Tokenade is missing or fails, the hook exits cleanly.
What the Copilot CLI gets
All columns of the compatibility matrix are covered: command output, web search, MCP results, code search, context optimisation, re-read dedup, documents and media, and secret redaction.
Hooks switched off
Copilot honours disableAllHooks in ~/.copilot/config.json. If it is true, no hook runs, Tokenade's included. Since 1.2.1 Tokenade reads this switch when deciding what the LLM proxy should cover.
Copilot in VS Code
The VS Code extension (GitHub.copilot / Copilot Chat) runs inside VS Code, which Tokenade cannot put a hook in front of. What you get:
- MCP optimisation:
tokenade mcp-wrap installwraps the MCP servers declared in VS Code'smcp.json(~/.config/Code/User/mcp.jsonon Linux,~/Library/Application Support/Code/User/mcp.jsonon macOS,%APPDATA%\Code\User\mcp.jsonon Windows). See Wrap MCP servers. - Manual commands: code search (
tokenade map,skeleton,query,semantic),tokenade readfor documents,tokenade wrapfor a noisy command,tokenade searchfor the web. The agent can call them from its terminal tool when your project rules mention them.
Command output, web search and document reading are therefore partial in VS Code; see the "Copilot in VS Code" row of the compatibility matrix.
Verify
tokenade hooks tail # recent hook fires
tokenade gain # savings ledger
Then run a Copilot CLI session with a noisy command and check the ledger grows. See your first session.
Remove
tokenade uninstall
Uninstall deletes ~/.copilot/hooks/tokenade.json, restores your MCP servers in ~/.copilot/mcp-config.json and VS Code's mcp.json, and strips the rules section. To restore only the MCP entries: tokenade unwrap-mcps. See Upgrade and uninstall.