Docs / Agents

GitHub Copilot

Updated

TL;DR — For the Copilot CLI, `tokenade install` writes `~/.copilot/hooks/tokenade.json` and `~/.copilot/copilot-instructions.md`, and wraps `~/.copilot/mcp-config.json`. The VS Code extension has no hook surface: only its MCP servers are folded.

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).

FileWhat Tokenade adds
~/.copilot/hooks/tokenade.jsonA hook file of its own (Tokenade does not edit your other hook files)
~/.copilot/copilot-instructions.mdA short Tokenade rules section
~/.copilot/mcp-config.jsonThird-party MCP servers rewritten to start behind tokenade mcp-wrap

The hooks

EventRole
PreToolUseRewrites a shell command to go through tokenade wrap
postToolUseFolds large tool results before the model reads them
UserPromptSubmitStyle note before each prompt
SessionStartSession context
PreCompactRuns before Copilot compacts the conversation
subagentStartSubagent 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 install wraps the MCP servers declared in VS Code's mcp.json (~/.config/Code/User/mcp.json on Linux, ~/Library/Application Support/Code/User/mcp.json on macOS, %APPDATA%\Code\User\mcp.json on Windows). See Wrap MCP servers.
  • Manual commands: code search (tokenade map, skeleton, query, semantic), tokenade read for documents, tokenade wrap for a noisy command, tokenade search for 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 healthcheck # checks ~/.copilot/hooks/tokenade.json resolves and has the expected shape
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 --dry-run
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.