Where are repository hooks defined for Copilot CLI and cloud agent?
Why D is the answer
.github/hooks/*.json
GitHub documents repository hooks in that location. Copilot CLI also supports personal hooks in the home directory.
In detail
- Repository hooks are defined in .github/hooks/*.json.
- Review hook changes like code.
Use case
An illustrative scenario, not a real incident.
A team adds a JSON file under .github/hooks, and both Copilot CLI and the cloud agent use its rules for that repository.
See it in different ways
flowchart LR
A["Agent requests a tool"] --> B{"Hook script"}
B -->|"Deny"| C["Tool does not run"]
B -->|"Approve"| D["Tool runs"]mindmap
root((Agent limits))
Identity
Write access to trigger
Repository
One branch
Branch protection
Tools
MCP allow list
Tool permissions
Network
Firewall allowlistflowchart LR S0["Add a JSON file"] --> S1["Commit it"] --> S2["CLI and cloud agent load it"]
Key point: Repository hooks live in .github/hooks.
Why the other options are wrong
- A. In the repository description field
- A description field holds no configuration.
- B. In a pinned issue at the top of the tracker
- An issue does not configure tools.
- C. In the settings page for each developer's profile
- A personal profile is not repository configuration.

