Overview of GitHub Copilot SDK hooks
mainThe GitHub Copilot SDK provides several session hooks that allow you to intercept and modify different stages of a Copilot session. These hooks enable you to implement custom logic for tool usage, message filtering, session management, and error handling.
Available hook categories include:
- Pre-tool use: Intercept tool calls to approve, deny, or modify them.
- Post-tool use: Transform the results returned by tools before they reach the model.
- User prompt submitted: Modify or filter user messages before they are processed.
- Session lifecycle: Manage logic triggered at the start and end of a session.
- Error handling: Implement custom logic for handling errors during a session.