Answer: Hooks allow you to intercept and customize the behavior of Copilot sessions at key points in the conversation lifecycle. The SDK provides session hooks such as onErrorOccurred, onPostToolUse, onPreToolUse, session lifecycle hooks, onUserPromptSubmitted, and userPromptTransformed. Status: Confirmed Entry: tool/github-copilot/agents-and-automation/use-hooks-with-copilot-sdk Revision: 1 Digest: sha256:966dbae470fba9e5 (changes whenever the content changes) Timeline: Created: 2026-11-13T03:28:26Z Last changed: 2026-11-13T03:28:26Z Last verified: 2026-11-20T13:08:51Z Next check: 2026-11-21T13:08:51Z Check interval: Daily Expected change: No fixed schedule Data: Field | Value | Source | As of Purpose of hooks | intercept and customize the behavior of Copilot sessions at key points in the conversation lifecycle | [1] | 2026-11-20 Error handling hook | onErrorOccurred | [1] | 2026-11-20 Post-tool use hook | onPostToolUse | [1] | 2026-11-20 Pre-tool use hook | onPreToolUse | [1] | 2026-11-20 User prompt submitted hook | onUserPromptSubmitted | [1] | 2026-11-20 User prompt transformed hook | userPromptTransformed | [1] | 2026-11-20 Sources: [1] GitHub. "Use hooks - GitHub Docs". https://docs.github.com/en/copilot/how-tos/copilot-sdk/hooks Role: primary. Accessed: 2026-11-20T13:08:51Z Quote: "Hooks allow you to intercept and customize the behavior of Copilot sessions at key points in the conversation lifecycle." (Supports: Purpose of hooks) Quote: "The onErrorOccurred hook is called when errors occur during session execution." (Supports: Error handling hook) Quote: "The onPostToolUse hook is called after a tool executes successfully ." (Supports: Post-tool use hook) Quote: "The onPreToolUse hook is called before a tool executes." (Supports: Pre-tool use hook) Quote: "The onUserPromptSubmitted hook is called when a user submits a message." (Supports: User prompt submitted hook) Quote: "The userPromptTransformed hook runs after the runtime adds generated context to a submitted prompt, but before the resulting content is persisted to session history or sent to the model." (Supports: User prompt transformed hook) Snapshot SHA-256: 131dd66560e7d332ef9117d742e8ee0360c7ad986710f2f3a3f5ba1369511806 (captured 2026-11-18T13:04:00Z) 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-18T13:04:00Z, so the values verified then were kept. Cross-check: not-available at 2026-11-20T13:08:51Z. No independent second source is configured for this entry Last successful check: 2026-11-20T13:08:51Z Last attempt: 2026-11-20T13:08:51Z Notes and limitations: Extracted automatically from a single official source (section "Use hooks"). Related: https://latestn.com/tool/github-copilot/agents-and-automation/use-implementation-planner-agent How do I use the Implementation planner custom agent in GitHub Copilot? https://latestn.com/tool/github-copilot/agents-and-automation/use-plan-mode-in-ide How do I use plan mode in GitHub Copilot in my IDE? https://latestn.com/tool/github-copilot/agents-and-automation/use-plan-mode-in-ide-2 How do I use plan mode with GitHub Copilot in my IDE? https://latestn.com/tool/github-copilot/agents-and-automation/use-custom-agents-cli How do I use custom agents in GitHub Copilot CLI? https://latestn.com/tool/github-copilot/agents-and-automation/use-custom-agents-in-ide How do I create and use custom agents in GitHub Copilot in my IDE? https://latestn.com/tool/github-copilot/agents-and-automation/use-custom-agents-in-ide-2 How do I use custom agents in GitHub Copilot in my IDE? https://latestn.com/tool/ All entries in AI tools Change log: Time | Event | Change | Source 2026-11-13T03:28:26Z | added | Entry created | — Changes for this entry as a feed: https://latestn.com/tool/github-copilot/agents-and-automation/use-hooks-with-copilot-sdk/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/use-hooks-with-copilot-sdk POST: https://latestn.com/dispute/tool/github-copilot/agents-and-automation/use-hooks-with-copilot-sdk with claim, evidence_url, and optionally field and contact (form-encoded or JSON) GET: https://latestn.com/dispute/tool/github-copilot/agents-and-automation/use-hooks-with-copilot-sdk?claim={what is wrong}&evidence_url={link} How to cite: LatestN. (2026). How do I use hooks with the GitHub Copilot SDK? Revision 1, last verified 2026-11-20T13:08:51Z. https://latestn.com/tool/github-copilot/agents-and-automation/use-hooks-with-copilot-sdk (accessed 2026-11-21T10:01:31Z). @misc{LatestN_tool_github_copilot_agents_and_automation_use_hooks_with_copilot_sdk_r1, title = {How do I use hooks with the GitHub Copilot SDK?}, author = {{LatestN}}, year = {2026}, howpublished = {\url{https://latestn.com/tool/github-copilot/agents-and-automation/use-hooks-with-copilot-sdk}}, note = {Revision 1; digest sha256:966dbae470fba9e5; last verified 2026-11-20T13:08:51Z; accessed 2026-11-21T10:01:31Z} } 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/use-hooks-with-copilot-sdk