Answer: A hook runs a shell command you define at a particular point in an agent's workflow, and unlike skills and custom instructions, hooks execute code at defined events. You should use hooks when you want tool checks, session automation, or custom validation. Status: Confirmed Entry: tool/github-copilot/agents-and-automation/what-are-hooks Revision: 3 Digest: sha256:c19c6ec7e22bdf0a (changes whenever the content changes) Timeline: Created: 2026-11-13T12:43:43Z Last changed: 2026-11-18T12:49:56Z (Supported surfaces: — → Hooks are supported in the GitHub Copilot app, Copilot CLI, Copilot cloud agent, and Visual Studio Code.) Last verified: 2026-11-20T12:56:25Z Next check: 2026-11-21T12:56:25Z Check interval: Daily Expected change: No fixed schedule Data: Field | Value | Source | As of Definition | A hook runs a shell command you define at a particular point in an agent's workflow. | [1] | 2026-11-20 When to use | Use hooks when you want: Tool checks. | [1] | 2026-11-20 Tool checks example | check a proposed command against an allowlist before it runs | [1] | 2026-11-20 Session automation example | record when an agent session starts or ends | [1] | 2026-11-20 Custom validation example | check whether a tool request would change a protected path | [1] | 2026-11-20 Supported surfaces | Hooks are supported in the GitHub Copilot app, Copilot CLI, Copilot cloud agent, and Visual Studio Code. | [1] | 2026-11-20 Sources: [1] GitHub. "Comparing Copilot customization features - GitHub Docs". https://docs.github.com/en/copilot/concepts/customizations/comparing-customizations Role: primary. Accessed: 2026-11-20T12:56:25Z Quote: "A hook runs a shell command you define at a particular point in an agent's workflow." (Supports: Definition) Quote: "Use hooks when you want: Tool checks." (Supports: When to use) Quote: "For example, check a proposed command against an allowlist before it runs." (Supports: Tool checks example) Quote: "For example, record when an agent session starts or ends." (Supports: Session automation example) Quote: "For example, check whether a tool request would change a protected path." (Supports: Custom validation example) Quote: "Hooks are supported in the GitHub Copilot app, Copilot CLI, Copilot cloud agent, and Visual Studio Code." (Supports: Supported surfaces) Snapshot SHA-256: 98a84f0f44fb8d3c0d4ee77704e28c31db082cfe48f64af1f3b9df27db8bdb16 (captured 2026-11-18T12:49:55Z) 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-18T12:49:56Z, so the values verified then were kept. Cross-check: not-available at 2026-11-20T12:56:25Z. No independent second source is configured for this entry Last successful check: 2026-11-20T12:56:25Z Last attempt: 2026-11-20T12:56:25Z Notes and limitations: Extracted automatically from a single official source (section "Hooks"). Related: https://latestn.com/tool/github-copilot/agents-and-automation/what-is-agent What is a GitHub Copilot agent? https://latestn.com/tool/github-copilot/agents-and-automation/when-new-tools-take-effect When do new tools take effect after I change them in the GitHub Copilot SDK? https://latestn.com/tool/github-copilot/agents-and-automation/when-to-use-copilot-cloud-refactoring When should I use GitHub Copilot in the cloud for large-scale refactoring? https://latestn.com/tool/github-copilot/agents-and-automation/user-prompt-transformed-hook-io What input and output does the GitHub Copilot user prompt transformed hook receive and return? https://latestn.com/tool/github-copilot/agents-and-automation/what-are-agent-skills What are agent skills in GitHub Copilot and what can they do? https://latestn.com/tool/github-copilot/agents-and-automation/what-are-copilot-agents What are GitHub Copilot agents and what can they do? https://latestn.com/tool/ All entries in AI tools Change log: Time | Event | Change | Source 2026-11-18T12:49:56Z | changed | Supported surfaces: — → Hooks are supported in the GitHub Copilot app, Copilot CLI, Copilot cloud agent, and Visual Studio Code. | [1] 2026-11-18T12:49:56Z | changed | Custom validation example: — → check whether a tool request would change a protected path | [1] 2026-11-18T12:49:56Z | changed | Session automation example: — → record when an agent session starts or ends | [1] 2026-11-18T12:49:56Z | changed | Tool checks example: — → check a proposed command against an allowlist before it runs | [1] 2026-11-18T12:49:56Z | changed | When to use: — → Use hooks when you want: Tool checks. | [1] 2026-11-18T12:49:56Z | changed | When to use - custom validation: Custom validation. For example, check whether a tool request would change a protected path. → — | [1] 2026-11-18T12:49:56Z | changed | When to use - session automation: Session automation. For example, record when an agent session starts or ends. → — | [1] 2026-11-18T12:49:56Z | changed | When to use - tool checks: Tool checks. For example, check a proposed command against an allowlist before it runs. → — | [1] 2026-11-18T12:49:56Z | changed | Example timing: before a tool is used or when a session ends → — | [1] 2026-11-16T12:39:36Z | changed | Supported surfaces: GitHub Copilot app, Copilot CLI, Copilot cloud agent, and Visual Studio Code → — | [1] 2026-11-16T12:39:36Z | changed | When to use - custom validation: Custom validation. → Custom validation. For example, check whether a tool request would change a protected path. | [1] 2026-11-16T12:39:36Z | changed | When to use - session automation: Session automation. → Session automation. For example, record when an agent session starts or ends. | [1] 2026-11-16T12:39:36Z | changed | When to use - tool checks: Tool checks. → Tool checks. For example, check a proposed command against an allowlist before it runs. | [1] 2026-11-13T12:43:43Z | added | Entry created | — Changes for this entry as a feed: https://latestn.com/tool/github-copilot/agents-and-automation/what-are-hooks/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/what-are-hooks POST: https://latestn.com/dispute/tool/github-copilot/agents-and-automation/what-are-hooks with claim, evidence_url, and optionally field and contact (form-encoded or JSON) GET: https://latestn.com/dispute/tool/github-copilot/agents-and-automation/what-are-hooks?claim={what is wrong}&evidence_url={link} How to cite: LatestN. (2026). What is a hook in GitHub Copilot and when should I use one? Revision 3, last verified 2026-11-20T12:56:25Z. https://latestn.com/tool/github-copilot/agents-and-automation/what-are-hooks (accessed 2026-11-21T09:58:56Z). @misc{LatestN_tool_github_copilot_agents_and_automation_what_are_hooks_r3, title = {What is a hook in GitHub Copilot and when should I use one?}, author = {{LatestN}}, year = {2026}, howpublished = {\url{https://latestn.com/tool/github-copilot/agents-and-automation/what-are-hooks}}, note = {Revision 3; digest sha256:c19c6ec7e22bdf0a; last verified 2026-11-20T12:56:25Z; accessed 2026-11-21T09:58:56Z} } 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/what-are-hooks