Answer: You register hooks by passing a hooks object when you create (or resume) a session, adding only the hooks you need such as onSessionStart, onPreToolUse, and onPostToolUse. Status: Confirmed Entry: tool/github-copilot/agents-and-automation/register-hooks Revision: 3 Digest: sha256:f777faa2bcfb71e1 (changes whenever the content changes) Timeline: Created: 2026-11-13T03:28:01Z Last changed: 2026-11-18T13:03:24Z (invocation parameter: — → invocation parameter containing the sessionId) Last verified: 2026-11-20T13:08:19Z Next check: 2026-11-21T13:08:19Z Check interval: Daily Expected change: No fixed schedule Data: Field | Value | Source | As of registration method | Pass a hooks object when you create (or resume) a session. | [1] | 2026-11-20 example hooks | onSessionStart | [1] | 2026-11-20 invocation parameter | invocation parameter containing the sessionId | [1] | 2026-11-20 Sources: [1] GitHub. "Working with hooks - GitHub Docs". https://docs.github.com/en/copilot/how-tos/copilot-sdk/features/hooks Role: primary. Accessed: 2026-11-20T13:08:19Z Quote: "Pass a hooks object when you create (or resume) a session." (Supports: registration method) Quote: "onSessionStart : async (input, invocation) => { /* ... */ }" (Supports: example hooks) Quote: "Every hook handler receives an invocation parameter containing the sessionId" (Supports: invocation parameter) Snapshot SHA-256: d0da331e57d20d0992bf99178fb6a23d61ea14315aadbc1f93dcec26b7bd5d7f (captured 2026-11-18T13:03:24Z) 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:03:24Z, so the values verified then were kept. Cross-check: not-available at 2026-11-20T13:08:19Z. No independent second source is configured for this entry Last successful check: 2026-11-20T13:08:19Z Last attempt: 2026-11-20T13:08:19Z Notes and limitations: Extracted automatically from a single official source (section "Registering hooks"). Related: https://latestn.com/tool/github-copilot/agents-and-automation/remote-control-capabilities What can I do remotely in a GitHub Copilot CLI session? https://latestn.com/tool/github-copilot/agents-and-automation/remote-control-cli-sessions How do I remotely control GitHub Copilot CLI sessions? https://latestn.com/tool/github-copilot/agents-and-automation/replace-client-tools How do I replace this client's tools during a GitHub Copilot SDK session? https://latestn.com/tool/github-copilot/agents-and-automation/query-past-sessions How do I query past GitHub Copilot agent sessions and what are the prerequisites? https://latestn.com/tool/github-copilot/agents-and-automation/readme-specialist-agent-profile What does the README specialist custom agent profile for GitHub Copilot look like? https://latestn.com/tool/github-copilot/agents-and-automation/recommended-approach-agentic-workflows What is the recommended approach for using GitHub Copilot CLI in GitHub Actions? https://latestn.com/tool/ All entries in AI tools Change log: Time | Event | Change | Source 2026-11-18T13:03:24Z | changed | invocation parameter: — → invocation parameter containing the sessionId | [1] 2026-11-18T13:03:24Z | changed | example hooks: — → onSessionStart | [1] 2026-11-18T13:03:24Z | changed | Java hook names: setOnSessionStart → — | [1] 2026-11-18T13:03:24Z | changed | .NET hook names: OnSessionStart → — | [1] 2026-11-18T13:03:24Z | changed | Go hook names: OnSessionStart → — | [1] 2026-11-18T13:03:24Z | changed | Python hook names: on_session_start → — | [1] 2026-11-18T13:03:24Z | changed | TypeScript hook names: onSessionStart → — | [1] 2026-11-16T12:52:13Z | changed | Java hook names: — → setOnSessionStart | [1] 2026-11-16T12:52:13Z | changed | .NET hook names: — → OnSessionStart | [1] 2026-11-16T12:52:13Z | changed | Go hook names: — → OnSessionStart | [1] 2026-11-16T12:52:13Z | changed | Python hook names: — → on_session_start | [1] 2026-11-16T12:52:13Z | changed | TypeScript hook names: — → onSessionStart | [1] 2026-11-16T12:52:13Z | changed | invocation parameter: invocation parameter containing the sessionId → — | [1] 2026-11-16T12:52:13Z | changed | example hook names: onSessionStart → — | [1] 2026-11-13T03:28:01Z | added | Entry created | — Changes for this entry as a feed: https://latestn.com/tool/github-copilot/agents-and-automation/register-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/register-hooks POST: https://latestn.com/dispute/tool/github-copilot/agents-and-automation/register-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/register-hooks?claim={what is wrong}&evidence_url={link} How to cite: LatestN. (2026). How do I register hooks in the GitHub Copilot SDK? Revision 3, last verified 2026-11-20T13:08:19Z. https://latestn.com/tool/github-copilot/agents-and-automation/register-hooks (accessed 2026-11-21T10:00:20Z). @misc{LatestN_tool_github_copilot_agents_and_automation_register_hooks_r3, title = {How do I register hooks in the GitHub Copilot SDK?}, author = {{LatestN}}, year = {2026}, howpublished = {\url{https://latestn.com/tool/github-copilot/agents-and-automation/register-hooks}}, note = {Revision 3; digest sha256:f777faa2bcfb71e1; last verified 2026-11-20T13:08:19Z; accessed 2026-11-21T10:00:20Z} } 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/register-hooks