# GitHub Copilot

> Tokenade fully covers the GitHub Copilot CLI through hooks in ~/.copilot/hooks/tokenade.json. The Copilot extension in VS Code gets MCP optimisation only.

Source: https://tokenade.net/en/docs/copilot · Updated: 2026-10-07

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 MCP optimisation applies there (plus the LLM proxy if you set it up), 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](https://tokenade.net/en/docs/compatibility) 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](https://tokenade.net/en/docs/mcp-wrap).
- **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.

- **LLM proxy (opt-in):** `tokenade llm-proxy install --agent copilot-vscode` points the extension's `github.copilot.internal.capiUrl` setting at a local proxy on `127.0.0.1`, which folds tool results in the history it forwards. Install never sets it up on its own for this agent. See [The LLM proxy](https://tokenade.net/en/docs/llm-proxy).

Without the proxy, command output, web search and document reading are partial in VS Code; see the "Copilot in VS Code" row of the [compatibility matrix](https://tokenade.net/en/docs/compatibility).

## Verify

```bash
tokenade healthcheck    # checks ~/.copilot/hooks/tokenade.json resolves and has the expected shape
tokenade hooks tail     # recent hook fires
tokenade dashboard      # local savings report, opens in your browser
```

Then run a Copilot CLI session with a noisy command and check the ledger grows. See [your first session](https://tokenade.net/en/docs/first-session).

## Remove

```bash
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](https://tokenade.net/en/docs/upgrade-uninstall).

## Related

- [Supported agents and compatibility](https://tokenade.net/en/docs/compatibility)
- [How hooks intercept tool calls](https://tokenade.net/en/docs/hooks)
- [Wrap MCP servers](https://tokenade.net/en/docs/mcp-wrap)
- [Other agents](https://tokenade.net/en/docs/other-agents)
