---
title: "How do I capture every skill in VS Code and GitHub Copilot?"
answer: "Copilot skills cannot carry hooks, so save one hook file at ~/.copilot/hooks/coolhand-capture.json that runs `coolhand capture-turn --agent copilot --skill 'acme-*'` after each chat message. A Step 0 block at the top of each skill installs it once per machine, after asking the user's consent."
category: "Coding agents"
tags: ["coolhand-cli","capture","hooks","skills","copilot"]
published: 2026-11-04T18:34:54Z
updated: 2026-11-08T15:22:52Z
canonical_url: https://coolhandlabs.com/help/capture-every-skill-in-vs-code-github-copilot
index_url: https://coolhandlabs.com/help.md
---

# How do I capture every skill in VS Code and GitHub Copilot?

Copilot skills cannot carry hooks, so save one hook file at ~/.copilot/hooks/coolhand-capture.json that runs `coolhand capture-turn --agent copilot --skill 'acme-*'` after each chat message. A Step 0 block at the top of each skill installs it once per machine, after asking the user's consent.

A VS Code GitHub Copilot skill cannot carry its own hook: a `hooks:` block in `SKILL.md` is ignored. Instead, one hook file in `~/.copilot/hooks/` runs `coolhand capture-turn` after every chat message, and `capture-turn` works out from the chat transcript whether one of your skills was used. This guide shows how to install that file once per machine, from the first step of each skill, so the people running your skills never open a terminal. For what capture sends and how to turn it off, see [How do I capture my agent skills' runs in Coolhand?](https://coolhandlabs.com/help/capture-agent-skill-runs-with-coolhand-cli.md).

## Before you start

- Your Coolhand **public** API key (never the private key).
- `coolhand-cli` 0.13.1 or later on every machine that runs the skills (0.13.3 or later if you join alternatives with `|`): `npm i -g coolhand-cli@latest`. An older install treats `'acme-*'` as a literal skill name and sends nothing. The hook runs after every message of every chat, so without a global install each message starts `npx -y coolhand-cli`.
- Skills whose `name:` matches your pattern. On Copilot a pattern is matched against the skill's declared `name:`.

## How the hook behaves

The hook file is the same for every skill. It runs `capture-turn --agent copilot --skill 'PATTERN'` after every chat message in every chat. `capture-turn` reads the chat's transcript, works out which skill was invoked, and sends the turn only if that skill matches the pattern. The skill is recorded under its own name and workload. A chat that never invoked a matching skill sends nothing.

Pick the pattern:

| Pattern | Captures |
|---|---|
| `'acme-*'` | Every skill whose name starts with `acme-`. Use this for a library, with a shared name prefix. |
| `'*'` | Every skill invoked on the machine, including people's own skills that are not in your library, and each one gets a workload on your Coolhand account. Only use it if the people running your skills have agreed. |
| `'qa-*\|skill-for-qas'` | Several alternatives joined with `\|`, each a prefix pattern ending in `*` or an exact name: every skill starting with `qa-`, plus the skill `skill-for-qas`. Use this when a library's skills do not share one prefix. |
| `'qa-login'` | Just that one skill. |

Always quote the pattern: the shell would expand an unquoted `*`, and an unquoted `|` starts a pipeline.

## Add Step 0 to each skill

Paste the block below as the first section of every skill you want to track. It is the same text for every skill. Fill in the four placeholders once and reuse the filled-in text:

- `YOUR_PUBLIC_API_KEY`: your Coolhand **public** API key.
- `YOUR_SKILL_PATTERN`: from the table above, for example `acme-*`.
- `YOUR_TEAM`: who reviews the results, as the user will read it, for example `the Acme QA team`.
- `YOUR_SKILL_SCOPE`: which skills the hook covers, as the user will read it, so the consent text is true: for example `skills whose names start with acme-` for `'acme-*'`, `skills whose names start with qa-, plus skill-for-qas` for `'qa-*|skill-for-qas'`, or `any skill you run` for `'*'`.

````text
## Step 0: make sure capture is installed (GitHub Copilot only; do this first, every time)

Skip this whole step if you are not GitHub Copilot.

The user may not use a terminal, so do this for them. Do not ask them to run anything.

1. Check, silently, **with your file-reading tool, not the terminal** (a terminal command makes VS Code ask the user for approval every time): try to read `.github/hooks/coolhand-capture.json` in the workspace, and `~/.copilot/hooks/coolhand-capture.json` in the user's home folder (use the full path, for example `/Users/<name>/.copilot/hooks/coolhand-capture.json`, taking the home folder from the paths you can see in this chat). "File not found" is the normal result when it is not installed, not an error to report.

2. If either file could be read, capture is installed: go straight to the steps below and say nothing about it.

3. If neither exists, first explain to the user, in friendly plain language and in your own words, all of the following (a short message, no jargon, no code):
   - **What it is:** a small settings file, `coolhand-capture.json`, that you are about to save in their Copilot settings folder (`~/.copilot/hooks`).
   - **What it does:** it runs in all their VS Code workspaces and, after each chat message, reads that chat's transcript on their own computer to check whether one of the skills it covers (YOUR_SKILL_SCOPE) was used; nothing leaves the computer unless it was. If it was, it sends that conversation (their messages, the AI's replies, and the steps the AI took) to Coolhand so YOUR_TEAM can review how the skill performed. Secrets such as keys and passwords are automatically removed first where they are recognised (it is a best-effort filter, so they should not paste real secrets into the chat), and the person's git email is attached so results can be traced to them. It sends nothing from chats that do not use one of those skills.
   - **Why they should accept:** without it the results of these skill runs are not recorded at all, so they cannot be reviewed. Nothing else on their computer changes.
   - **What to expect next:** VS Code will ask them to approve a terminal command; they should choose **Allow** (the command only saves that one file). They can undo this at any time by deleting `~/.copilot/hooks/coolhand-capture.json`.

   Then install it by running this in the terminal:

```bash
mkdir -p ~/.copilot/hooks && { [ -e ~/.copilot/hooks/coolhand-capture.json ] || cat > ~/.copilot/hooks/coolhand-capture.json <<'EOF'
{
  "version": 1,
  "hooks": {
    "Stop": [
      {
        "type": "command",
        "bash": "export COOLHAND_API_KEY=YOUR_PUBLIC_API_KEY; if command -v coolhand >/dev/null 2>&1 && coolhand help capture-turn >/dev/null 2>&1; then coolhand capture-turn --agent copilot --skill 'YOUR_SKILL_PATTERN'; else npx -y coolhand-cli capture-turn --agent copilot --skill 'YOUR_SKILL_PATTERN'; fi >/dev/null 2>&1 || true",
        "timeoutSec": 30
      }
    ]
  }
}
EOF
}
test -f ~/.copilot/hooks/coolhand-capture.json
```

4. The install command ends with `test -f`, so it succeeds only if the file is in place. If it succeeded, tell the user: "Done. Please start a new chat and run this skill again so recording starts." and **stop** (Copilot only reads hooks when a chat starts, so this chat will not be recorded). If it failed, tell them the install failed and to ask whoever set up the skill for help. Do not run the steps below in either case.
````

## What the person running the skill sees

The first time they run any of your skills, the agent explains what is being installed, VS Code asks them to approve one terminal command, and the hook file lands in `~/.copilot/hooks/`. The agent then asks them to start a new chat, and every later run of any of your skills is captured. The chat that installed the file is not recorded, because Copilot reads hooks only when a chat starts.

The file is written once per machine; the other skills find it and say nothing. It has one fixed name, so a machine holds one capture file: a second library's Step 0 finds the first library's file and installs nothing, and Step 0 never overwrites an existing file. Two libraries that need different keys or patterns need IT-managed files or a combined pattern.

## Other ways to install the same file

- **IT-managed.** IT saves the file as `~/.copilot/hooks/coolhand-capture.json` (MDM or a login script), filled in. The skills then do not need Step 0. Start from [`coolhand-capture-example.json`](https://github.com/Coolhand-Labs/coolhand-cli/blob/main/examples/hook-capture/copilot/coolhand-capture-example.json).
- **Committed to a workspace.** Commit [`workspace/coolhand-capture-example.json`](https://github.com/Coolhand-Labs/coolhand-cli/blob/main/examples/hook-capture/copilot/workspace/coolhand-capture-example.json) as `.github/hooks/coolhand-capture.json` in the repo that holds the skill. It applies only in workspaces that contain the file, and each person opts in by setting `COOLHAND_CAPTURE_API_KEY` in the environment VS Code runs in, so no key is stored in the file.

## What it costs

The Copilot hook is one process after every message in every chat, whatever the number of skills in the library, because one hook file serves them all. A chat that never used a matching skill sends nothing. If you want to control which version runs with your key in its environment, pin the package in the command (`npx -y coolhand-cli@<version>`, using a release that supports the `--skill` form you use; see Before you start).

Register only the `Stop` event. Copilot also honours `agentStop`, and registering both runs the hook twice.

## Known limits

- Patterns have been checked against recorded transcripts but not yet in a live VS Code chat, and Windows is untested (the examples use the `bash` hook key).
- Whether the agent can read `~/.copilot/hooks/` with its file tool without VS Code prompting is not yet confirmed. If it prompts, Step 0 would ask on every run of every skill, and having IT install the file is the better route.
- A chat that runs two skills of a library is recorded under the first.
- Skills the model loads itself, rather than ones the user invoked with a slash command, have not been tested live.

## Related

- [How do I capture my agent skills' runs in Coolhand?](https://coolhandlabs.com/help/capture-agent-skill-runs-with-coolhand-cli.md): what is sent, privacy controls, limits
- [How do I capture every skill in a Claude Code plugin?](https://coolhandlabs.com/help/capture-every-skill-in-a-claude-code-plugin.md): the same for Claude Code
- Source: [coolhand-cli skills library guide](https://github.com/Coolhand-Labs/coolhand-cli/blob/main/docs/hook-capture-skills-library.md#add-the-hook-to-every-skill-in-vs-code--github-copilot)


---

Related:
- [How do I capture my agent skills' runs in Coolhand?](https://coolhandlabs.com/help/capture-agent-skill-runs-with-coolhand-cli.md)
- [How do I capture every skill in a Claude Code plugin?](https://coolhandlabs.com/help/capture-every-skill-in-a-claude-code-plugin.md)
- [GitHub Copilot best practices](https://coolhandlabs.com/help/github-copilot-best-practices.md)
- [Claude Code best practices](https://coolhandlabs.com/help/claude-code-best-practices.md)

[← All help articles](https://coolhandlabs.com/help.md) · [Coding agents](https://coolhandlabs.com/help/category/coding-agents.md)
