Answer: Create a new NAME.json file (where NAME describes the purpose of the file) in the .github/hooks/ folder of your repository, then commit the file to the repository and merge it into the default branch. The hooks configuration file must be present on your repository's default branch to be used by Copilot cloud agent. Status: Confirmed Entry: tool/github-copilot/agents-and-automation/create-hook-for-cloud-agent Revision: 3 Digest: sha256:8272cc0970f8c17c (changes whenever the content changes) Timeline: Created: 2026-11-13T03:26:52Z Last changed: 2026-11-20T13:06:38Z (example timeout: — → 10) Last verified: 2026-11-20T13:06:38Z Next check: 2026-11-21T13:06:38Z Check interval: Daily Expected change: No fixed schedule Data: Field | Value | Unit | Source | As of file location | .github/hooks/ | | [1] | 2026-11-20 file name format | NAME.json | | [1] | 2026-11-20 required branch | default branch | | [1] | 2026-11-20 template version | 1 | | [1] | 2026-11-20 hook keys | sessionStart | | [1] | 2026-11-20 example timeout | 10 | seconds | [1] | 2026-11-20 final step | Commit the file to the repository and merge it into the default branch. | | [1] | 2026-11-20 Sources: [1] GitHub. "Customize agent workflows with hooks - GitHub Docs". https://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-cloud-agent/use-hooks Role: primary. Accessed: 2026-11-20T13:06:38Z Quote: "in the .github/hooks/ folder of your repository" (Supports: file location) Quote: "Create a new NAME.json file (where NAME describes the purpose of the file)" (Supports: file name format) Quote: "The hooks configuration file must be present on your repository's default branch to be used by Copilot cloud agent." (Supports: required branch) Quote: ""version": 1" (Supports: template version) Quote: ""sessionStart": [...], "sessionEnd": [...], "userPromptSubmitted": [...], "preToolUse": [...], "postToolUse": [...], "errorOccurred": [...]" (Supports: hook keys) Quote: ""timeoutSec": 10" (Supports: example timeout) Quote: "Commit the file to the repository and merge it into the default branch." (Supports: final step) Snapshot SHA-256: 8d6f7acc0542449e17e91c3ce859837f22db667445657a8f7ad26fa2357d99cc (captured 2026-11-19T13:00:19Z) Verification: Method: Automated extraction from [1] with deepseek-flash (JSON output, thinking disabled). Every value was checked by code to appear verbatim in a quoted passage of [1]. On this check the text of [1] was unchanged since 2026-11-19T13:00:19Z, so the values verified then were kept. Cross-check: not-available at 2026-11-20T13:06:38Z. No independent second source is configured for this entry Last successful check: 2026-11-20T13:06:38Z Last attempt: 2026-11-20T13:06:38Z Notes and limitations: Extracted automatically from a single official source (section "Creating a hook in a repository on GitHub"). Related: https://latestn.com/tool/github-copilot/agents-and-automation/create-issue-with-copilot How do I use GitHub Copilot to create an issue? https://latestn.com/tool/github-copilot/agents-and-automation/create-multiple-issues How do I use GitHub Copilot to create multiple issues at once? https://latestn.com/tool/github-copilot/agents-and-automation/create-plan-for-code-changes How do I create a plan for code changes using GitHub Copilot? https://latestn.com/tool/github-copilot/agents-and-automation/create-dynamic-workflow How do I create a dynamic workflow in GitHub Copilot? https://latestn.com/tool/github-copilot/agents-and-automation/create-dynamic-workflow-2 How do I create a GitHub Copilot dynamic workflow? https://latestn.com/tool/github-copilot/agents-and-automation/create-first-custom-agent How do I create my first custom agent in GitHub Copilot? https://latestn.com/tool/ All entries in AI tools Change log: Time | Event | Change | Source 2026-11-20T13:06:38Z | changed | example timeout: — → 10 | [1] 2026-11-20T13:06:38Z | changed | hook keys: — → sessionStart | [1] 2026-11-20T13:06:38Z | changed | template version: — → 1 | [1] 2026-11-20T13:06:38Z | changed | file name format: — → NAME.json | [1] 2026-11-20T13:06:38Z | changed | version: 1 → — | [1] 2026-11-20T13:06:38Z | changed | configuration keys: bash and powershell → — | [1] 2026-11-17T13:24:03Z | changed | version: — → 1 | [1] 2026-11-17T13:24:03Z | changed | configuration keys: — → bash and powershell | [1] 2026-11-17T13:24:03Z | changed | config version: 1 → — | [1] 2026-11-17T13:24:03Z | changed | file name format: NAME.json → — | [1] 2026-11-13T03:26:52Z | added | Entry created | — Changes for this entry as a feed: https://latestn.com/tool/github-copilot/agents-and-automation/create-hook-for-cloud-agent/latest Challenge this entry: Open challenges: None How: If a value here is wrong or out of date, send what is wrong and a link to evidence. Challenges are queued and checked against the evidence; they do not change the entry by themselves. If the entry changes as a result, the change log says so. Form: https://latestn.com/dispute/tool/github-copilot/agents-and-automation/create-hook-for-cloud-agent POST: https://latestn.com/dispute/tool/github-copilot/agents-and-automation/create-hook-for-cloud-agent with claim, evidence_url, and optionally field and contact (form-encoded or JSON) GET: https://latestn.com/dispute/tool/github-copilot/agents-and-automation/create-hook-for-cloud-agent?claim={what is wrong}&evidence_url={link} How to cite: LatestN. (2026). How do I create a hook for the GitHub Copilot cloud agent in a repository on GitHub? Revision 3, last verified 2026-11-20T13:06:38Z. https://latestn.com/tool/github-copilot/agents-and-automation/create-hook-for-cloud-agent (accessed 2026-11-21T10:00:05Z). @misc{LatestN_tool_github_copilot_agents_and_automation_create_hook_for_cloud_agent_r3, title = {How do I create a hook for the GitHub Copilot cloud agent in a repository on GitHub?}, author = {{LatestN}}, year = {2026}, howpublished = {\url{https://latestn.com/tool/github-copilot/agents-and-automation/create-hook-for-cloud-agent}}, note = {Revision 3; digest sha256:8272cc0970f8c17c; last verified 2026-11-20T13:06:38Z; accessed 2026-11-21T10:00:05Z} } Reuse: License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/) Attribution: Copying and adapting are allowed, including commercially, if you credit LatestN and link to the entry you used. Each entry ends with a ready-made citation. URL: https://latestn.com/tool/github-copilot/agents-and-automation/create-hook-for-cloud-agent