Hooks are loaded from a repository folder.

Section: Hooks basics

Store hooks in the repository

text
text
.github/hooks/hooks.json
Explanation

Copilot CLI loads hook configuration files from `.github/hooks/*.json` in the current working directory.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Hooks basics
Minimal command hook template
Start with a JSON hook file.
OpenIn sheetjsonsame section
Run a session-start hook script
Trigger repo automation when a session begins.
OpenIn sheetjsonsame section
Log prompts for auditing
Call a script that records prompt activity.
OpenIn sheetjsonsame section
Project skill directory
Store project skills in the standard directory.
OpenIn sheettext2 tag match
Persistent MCP config location
Store servers in the user MCP config file.
OpenIn sheetjson2 tag match
Add an MCP server for one session from a file
Load additional MCP server config at runtime.
OpenIn sheetbash1 tag match