.github/hooks/, for example .github/hooks/midway-notifications.json. The same file can be used by Copilot CLI and Copilot cloud agent, but not all events run on both surfaces.
notification event is available in Copilot CLI, but not Copilot cloud agent. It fires asynchronously for matching system notifications, such as when an agent completes or needs approval. sessionEnd runs when a session terminates; in Copilot cloud agent, it runs once per job.
Copilot CLI runs hooks on your machine. Copilot cloud agent runs hooks inside a temporary Linux environment, not on your desktop. To use sessionEnd there, Midway and its configuration must be made available in that environment. Do not commit notification credentials to the repository; cloud-agent outbound network access may also require an administrator allow rule.
For VS Code, the selected agent harness determines which hook implementation is active. Copilot harness sessions use the Copilot SDK hooks; see the VS Code hooks guide and verify event availability for your VS Code version.