session-recovery

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

Updated Jun 2, 2026
One-click install
npx skills add https://github.com/codebytes/btt --skill session-recovery-codebytes
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: session-recovery
Source: https://github.com/codebytes/btt/tree/main/.copilot/skills/session-recovery
Command: npx skills add https://github.com/codebytes/btt --skill session-recovery-codebytes

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Copilot CLI sessions can be interrupted by terminal crashes, network drops, or machine restarts, leaving work in a partially-completed state with uncommitted branches, orphaned in-progress issues, and unfinalized checkpoints. This Skill teaches agents how to query the session_store SQLite database to find interrupted sessions and resume them. ## Core Features & Use Cases - Session Discovery: Query recent sessions by time window, working directory, or keyword using the FTS5 search_index table, while filtering out high-volume automated sessions like keep-alive and heartbeat agents. - Context Inspection: Retrieve conversation turns, checkpoint progress, touched files, and linked PRs/issues for a session before deciding to resume it. - Orphan Detection: Cross-reference sessions linked to issues with gh issue list --label "status:in-progress" to find abandoned work. - Use Case: After a terminal crash during PR creation, query recent sessions by branch name, check the last checkpoint to see whether code was committed and the PR created, then resume with copilot --resume SESSION_ID. ## Quick Start Ask the agent to find my Copilot CLI sessions from the last 24 hours and show which ones were interrupted before completing their work.

Frequently Asked Questions about session-recovery

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

FAQPage Schema
How do I find interrupted Copilot CLI sessions?

Query the sessions table in the session_store SQLite database filtered by a time window such as the last 24 hours, and join the checkpoints table to see where each session stopped. Exclude automated sessions like keep-alive and heartbeat agents to avoid noise.

How to resume a Copilot CLI session after a crash?

Run `copilot --resume SESSION_ID` with the full session UUID once you have identified the interrupted session. Before resuming, inspect its turns, checkpoints, and touched files to confirm there is pending work worth continuing.

How do I 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' for better recall.

Why does my session search return too many automated sessions?

Automated agents like monitors, keep-alive, and heartbeat processes create high-volume sessions that flood results. Filter them out by excluding sessions whose first turn contains keep-alive or heartbeat keywords in the user message.

What are the limitations of FTS5 search in session_store?

FTS5 performs keyword matching, not semantic search, so queries must include synonyms and exact terms. Special characters in MATCH queries need escaping, and paths should be wrapped in double quotes to avoid syntax errors.