session-recovery

Detect and resume interrupted Copilot CLI sessions by querying the session_store SQLite database.

1|Updated Jul 7, 2026
One-click install
npx skills add https://github.com/seiggy/maf-copilot-studio-demo --skill session-recovery-seiggy
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: session-recovery
Source: https://github.com/seiggy/maf-copilot-studio-demo/tree/main/.copilot/skills/session-recovery
Command: npx skills add https://github.com/seiggy/maf-copilot-studio-demo --skill session-recovery-seiggy

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? When Copilot CLI sessions are interrupted by terminal crashes, network drops, or machine restarts, work is left in a partially-completed state with uncommitted branches, stale in-progress issues, and unfinished checkpoints. This Skill teaches agents how to query the session_store SQLite database to find those interrupted sessions and resume the work. ## Core Features & Use Cases - Session Discovery: Query recent sessions with their last checkpoint, filter out automated keep-alive and heartbeat sessions, and search by topic using the FTS5 search_index table. - Context Inspection: Retrieve conversation turns, checkpoint progress, touched files, and linked PRs/issues for a session before resuming it. - Orphaned Work Detection: Cross-reference sessions linked to issues with gh issue list --label "status:in-progress" to find abandoned work. - Use Case: After a laptop crash during PR creation, query sessions by branch name, check the last checkpoint to see whether the code was committed and the PR created, then resume with copilot --resume SESSION_ID. ## Quick Start Find my Copilot CLI sessions from the last 24 hours that were interrupted and show me where each one stopped so I can resume the unfinished work.

Frequently Asked Questions about session-recovery

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I recover an interrupted Copilot CLI session?

Query the sessions table in the session_store SQLite database for recent sessions, inspect the last checkpoint to see where work stopped, then run copilot --resume SESSION_ID with the full session UUID to continue.

How to search Copilot CLI session history by keyword?

Use the search_index FTS5 table with a MATCH query joined to the sessions table. Since FTS5 is keyword-based rather than semantic, expand queries with synonyms such as 'auth OR login OR token OR JWT'.

How do I find sessions working on a specific GitHub issue?

Join the sessions table with session_refs where ref_type equals 'issue' to list sessions linked to issues. Cross-reference with gh issue list --label status:in-progress to detect orphaned work with no active session.

Why do automated sessions flood my session history queries?

Monitor, keep-alive, and heartbeat agents create high-volume sessions that obscure human work. Exclude them by filtering out sessions whose first turn message contains keep-alive or heartbeat keywords.

What are the limitations of FTS5 search in session_store?

FTS5 performs keyword matching, not semantic search, so queries must include synonym expansions to catch related terms. Special characters in MATCH expressions need escaping, and paths should be wrapped in double quotes.