You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Hooks not loaded when session is resumed via --resume #1503
When a session is resumed using --resume, hooks configured in .github/hooks/*.json are never loaded.
In the source code (index.js v0.0.411-1), createSession() calls loadHooks() to discover and register hook files from .github/hooks/. However, getSession() — which handles the --resume code path — does not call loadHooks(). This means any tool or wrapper that uses --resume will never trigger any configured hooks (sessionEnd, agentStop, etc.).
Affected version
GitHub Copilot CLI 0.0.411-1 (Windows_NT)
Steps to reproduce the behavior
Install a hook via a .github/hooks/*.json file (e.g. toasty --install copilot creates ~/.github/hooks/toasty.json with a sessionEnd hook).
Start Copilot CLI with --resume <sessionId>.
Complete a session or trigger the hook event.
Observe that the hook command is never executed.
Without --resume (fresh createSession path), the same hook file works correctly.
Expected behavior
getSession() should call loadHooks() (or equivalent) so that hooks from .github/hooks/*.json are loaded for resumed sessions, just as they are for new sessions.
Additional context
Impact: Any wrapper that always passes --resume (e.g. Agency / Microsoft Agent Platform) will never fire hooks. This completely breaks the hooks feature for those users.
Root cause location: In the minified index.js, createSession contains a call to this.loadHooks(e) while getSession has zero references to loadHooks, hooks, or the hook-loading helpers (B3t, Tee).
Hook file format is correct: The .github/hooks/toasty.json file validates against the zod schema (version: 1, hooks.sessionEnd array with type: "command", powershell/bash fields, timeoutSec).
Hook file location is correct: Copilot CLI globs <gitRoot>/.github/hooks/**/*.json (or <cwd>/.github/hooks/ if not in a git repo). The file is at ~/.github/hooks/toasty.json.
Verified across 5 Agency sessions that --resume is always passed, confirming hooks never load.
I believe this issue has been fixed. I'm going to close it out, but if using the latest version you're still having issues, please feel free to re-open. Thanks.
Activity
nhickster commentedon Mar 3, 2026
This is a technically a duplicate of #1084 , but you have a lot of good context here and maybe having two of these bugs open will get them to fix it.
stephentoub commentedon Apr 6, 2026
I believe this issue has been fixed. I'm going to close it out, but if using the latest version you're still having issues, please feel free to re-open. Thanks.