Answer: You save session state for resume by using the onSessionEnd hook, which calls saveSessionState with the sessionId and saves endTime, cwd, and reason when the session reason is not "error". Status: Confirmed Entry: tool/github-copilot/agents-and-automation/save-session-state-for-resume Revision: 3 Digest: sha256:b14c7acc0c43cad8 (changes whenever the content changes) Timeline: Created: 2026-11-13T03:28:37Z Last changed: 2026-11-18T13:04:20Z (Saved fields: — → endTime : input. timestamp , cwd : input. cwd , reason : input. reason) Last verified: 2026-11-20T13:09:07Z Next check: 2026-11-21T13:09:07Z Check interval: Daily Expected change: No fixed schedule Data: Field | Value | Source | As of Hook | onSessionEnd | [1] | 2026-11-20 Save function | saveSessionState | [1] | 2026-11-20 Condition | input. reason !== "error" | [1] | 2026-11-20 Saved fields | endTime : input. timestamp , cwd : input. cwd , reason : input. reason | [1] | 2026-11-20 Sources: [1] GitHub. "Session lifecycle hooks - GitHub Docs". https://docs.github.com/en/copilot/how-tos/copilot-sdk/hooks/session-lifecycle Role: primary. Accessed: 2026-11-20T13:09:07Z Quote: "onSessionEnd : async (input, invocation) =>" (Supports: Hook) Quote: "await saveSessionState (invocation. sessionId , { endTime : input. timestamp , cwd : input. cwd , reason : input. reason , });" (Supports: Save function) Quote: "if (input. reason !== "error" )" (Supports: Condition) Quote: "endTime : input. timestamp , cwd : input. cwd , reason : input. reason ," (Supports: Saved fields) Snapshot SHA-256: c3b2940e63c2d5b4375f09e3c10e3dbeda70a4f09f16d8e5858af613f941621b (captured 2026-11-18T13:04:20Z) 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:20Z, so the values verified then were kept. Cross-check: not-available at 2026-11-20T13:09:07Z. No independent second source is configured for this entry Last successful check: 2026-11-20T13:09:07Z Last attempt: 2026-11-20T13:09:07Z Notes and limitations: Extracted automatically from a single official source (section "Save session state for resume"). Related: https://latestn.com/tool/github-copilot/agents-and-automation/schedule-dynamic-workflow How do I schedule a GitHub Copilot dynamic workflow run? https://latestn.com/tool/github-copilot/agents-and-automation/schedule-prompts How do I schedule prompts in GitHub Copilot CLI? https://latestn.com/tool/github-copilot/agents-and-automation/scope-tools-per-agent How do I scope tools to individual agents in the GitHub Copilot SDK? https://latestn.com/tool/github-copilot/agents-and-automation/run-cli-programmatically-2 How do I run GitHub Copilot CLI programmatically in scripts or CI/CD? https://latestn.com/tool/github-copilot/agents-and-automation/run-copilot-cli-in-actions How do I run GitHub Copilot CLI in a GitHub Actions workflow? https://latestn.com/tool/github-copilot/agents-and-automation/run-dynamic-workflow-cli How do I run a GitHub Copilot dynamic workflow from the command line? https://latestn.com/tool/ All entries in AI tools Change log: Time | Event | Change | Source 2026-11-18T13:04:20Z | changed | Saved fields: — → endTime : input. timestamp , cwd : input. cwd , reason : input. reason | [1] 2026-11-18T13:04:20Z | changed | Condition: — → input. reason !== "error" | [1] 2026-11-18T13:04:20Z | changed | Save function: — → saveSessionState | [1] 2026-11-18T13:04:20Z | changed | Hook: — → onSessionEnd | [1] 2026-11-18T13:04:20Z | changed | condition: input. reason !== "error" → — | [1] 2026-11-18T13:04:20Z | changed | saved reason: input. reason → — | [1] 2026-11-18T13:04:20Z | changed | saved cwd: input. cwd → — | [1] 2026-11-18T13:04:20Z | changed | saved endTime: input. timestamp → — | [1] 2026-11-18T13:04:20Z | changed | save function: saveSessionState → — | [1] 2026-11-18T13:04:20Z | changed | hook: onSessionEnd → — | [1] 2026-11-16T12:53:05Z | changed | session id: invocation. sessionId → — | [1] 2026-11-16T12:53:05Z | changed | condition: error → input. reason !== "error" | [1] 2026-11-13T03:28:37Z | added | Entry created | — Changes for this entry as a feed: https://latestn.com/tool/github-copilot/agents-and-automation/save-session-state-for-resume/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/save-session-state-for-resume POST: https://latestn.com/dispute/tool/github-copilot/agents-and-automation/save-session-state-for-resume with claim, evidence_url, and optionally field and contact (form-encoded or JSON) GET: https://latestn.com/dispute/tool/github-copilot/agents-and-automation/save-session-state-for-resume?claim={what is wrong}&evidence_url={link} How to cite: LatestN. (2026). How do I save GitHub Copilot SDK session state so it can be resumed later? Revision 3, last verified 2026-11-20T13:09:07Z. https://latestn.com/tool/github-copilot/agents-and-automation/save-session-state-for-resume (accessed 2026-11-21T10:02:10Z). @misc{LatestN_tool_github_copilot_agents_and_automation_save_session_state_for_resume_r3, title = {How do I save GitHub Copilot SDK session state so it can be resumed later?}, author = {{LatestN}}, year = {2026}, howpublished = {\url{https://latestn.com/tool/github-copilot/agents-and-automation/save-session-state-for-resume}}, note = {Revision 3; digest sha256:b14c7acc0c43cad8; last verified 2026-11-20T13:09:07Z; accessed 2026-11-21T10:02:10Z} } 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/save-session-state-for-resume