Creator · microsoft
Last updated · Sep 2, 2026
Find and resume interrupted Copilot CLI sessions using session_store queries
Creator · microsoft
Last updated · Sep 2, 2026
Find and resume interrupted Copilot CLI sessions using session_store queries
Creator · microsoft
Last updated · Sep 2, 2026
Find and resume interrupted Copilot CLI sessions using session_store queries
Creator · microsoft
Last updated · Sep 2, 2026
Find and resume interrupted Copilot CLI sessions using session_store queries
Install targets
Codex install prompt
Install the "session-recovery" agent skill from https://github.com/microsoft/waza/tree/main/.copilot/skills/session-recovery. Read its SKILL.md or equivalent instructions first, install only the files needed for this workspace, and summarize any required setup before using it. Skill purpose: Find and resume interrupted Copilot CLI sessions using session_store queries After the install attempt, report the result to https://www.openagentskill.com/api/agent/outcome with POST JSON {"event_id":"install_<unique-id>","skill_slug":"microsoft-session-recovery","task":"Install session-recovery","agent":"codex","outcome":"success","install_used":true}. Replace event_id with a unique value and outcome with success or failed. Report success only after the skill is installed and a minimal verification passes.Supply asset profile
Code review, repo analysis, testing, CI, GitHub, DevOps, and developer workflow skills.
Scenario
Database and SQL
I need my agent to inspect database schemas, write SQL, and explain query results.
Agent fit
Claude Code + CLI + Codex
Codex, Claude Code, Cursor, CLI, or custom agents.
Install
Ready
npx skills add microsoft/waza --skill session-recovery
Maintenance
fresh
2d since push
Risk
Needs review
Dependency or permission surface needs review
GitHub quality
1.3K
78/100 Quality · 75/100 Trust
Coverage tags
Review notes
Dependency or permission surface needs review · Permission surface may require sandboxing
Agent adoption scorecard
These scores combine public repository metadata, OpenAgentSkill review signals, maintenance freshness, and install readiness. They are a shortlist signal, not a replacement for human review.
Quality
StrongSolid option that is likely worth shortlisting for production workflows.
Trust
Sandbox onlyUseful candidate with missing or mixed trust signals. Keep it in an isolated workspace until the outcome loop proves task fit.
Audit
Needs reviewA machine-readable review of install readiness, security metadata, maintenance, and adoption risk.
OpenAgentSkill Trust Score v5
Run only in a sandbox and compare close alternatives before using it for real work.
Stars
1.3K GitHub stars
Repo activity
1.3K stars, 81 forks
Maintenance
2d since push
License
MIT
Install
npx skills add microsoft/waza --skill session-recovery
Install safety
Agent-readable metadata
Use this block or the embedded JSON to decide whether an agent should install this skill, choose an alternative, or ask for human review first.
Suited tasks
Suited agents
Install decision
Trust and risk
Outcome loop
Install command
npx skills add microsoft/waza --skill session-recoveryDo not use when
Agent safety v2
This skill should not be selected by an agent without explicit human security review.
Do not auto-install. Inspect the source, dependencies, and permission surface first.
high
Skill metadata references terminal, CLI, shell, subprocess, or command execution workflows.
medium
Skill likely fetches remote pages, APIs, repositories, or external services.
medium
Skill may read or write project files, documents, generated artifacts, or local workspace state.
high
Skill metadata references credentials, tokens, environment variables, or secret-bearing workflows.
Agent resolve plan
The Resolve API returns the selected skill, alternatives, safety policy, audit notes, install target, and copy-paste prompt an agent can follow without scraping this page.
Open JSON
/api/agent/resolve?task=Use%20session-recovery%20for%20an%20agent%20workflow&agent=codex&max_risk=medium
Resolve text
/api/agent/resolve?task=Use%20session-recovery%20for%20an%20agent%20workflow&agent=codex&max_risk=medium&format=text
Install handoff
/api/skills/microsoft-session-recovery/install
Agent should check
Copy prompt
Task: Use session-recovery in this workspace.
Resolve first: https://www.openagentskill.com/api/agent/resolve?task=Use%20session-recovery%20for%20an%20agent%20workflow&agent=codex&max_risk=medium
Review install handoff: https://www.openagentskill.com/api/skills/microsoft-session-recovery/install
Install command: npx skills add microsoft/waza --skill session-recovery
Before running it, summarize audit warnings, required permissions, and the fallback skill if install is risky.Agent handoff
Use the public install endpoint to fetch the command, safety checklist, target prompts, and canonical links for this skill.
Install handoff
/api/skills/microsoft-session-recovery/install
LLM text format
/api/skills/microsoft-session-recovery/install?format=text
Find alternatives
/api/skills/search?q=session-recovery&limit=3
Agent prompt
Use session-recovery for this task. Review https://www.openagentskill.com/api/skills/microsoft-session-recovery/install, then install with: npx skills add microsoft/waza --skill session-recoveryRegistry metadata
This page exposes the same decision, trust, audit, use-case, and install signals through the Registry API, so agents can rank this skill without scraping the UI.
Manifest
/api/registry/manifest/microsoft-session-recovery
LLM text
/api/registry/manifest/microsoft-session-recovery?format=text
Install alias
/api/registry/install/microsoft-session-recovery
Recommend
/api/registry/recommend?task=Use%20session-recovery%20in%20an%20agent%20workflow&limit=3
Agent fit
Database and SQL
Use-case tags
Platforms
Claude Code
Audit report
A machine-readable review of install readiness, security metadata, maintenance, and adoption risk.
Agent decision cockpit
Use this as a leading candidate, then validate the README and install path in your own agent stack.
Role in stack
Primary pick
Primary fit
Database and SQL
Trust label
Production-ready
Install path
Command ready
Use when
Evidence
review first
Implementation path
Trust profile
Useful candidate with missing or mixed trust signals. Keep it in an isolated workspace until the outcome loop proves task fit.
GitHub adoption
PASS1.3K GitHub stars
Stars/forks activity
INFO1.3K stars, 81 forks; issue activity unavailable in current metadata
Recent maintenance
PASS2d since push
License clarity
PASSMIT
Good signals
Review before install
Recommended action
Run only in a sandbox and compare close alternatives before using it for real work.
Quality profile
Solid option that is likely worth shortlisting for production workflows.
Workflow fit
Work with data stores
I need my agent to inspect database schemas, write SQL, and explain query results.
Operate local tools
I need my agent to operate local files and desktop apps in a repeatable workflow.
Investigate faster
I need my agent to research a topic, compare sources, and produce a concise report.
Workflow fit
Turn skills into distribution
A workflow for turning newly indexed skills into SEO briefs, social drafts, comparison pages, and reusable publishing workflows.
Find, compare, and synthesize
A workflow for agents that gather sources, compare claims, summarize long material, and draft useful research briefs.
Inspect, patch, and verify code
A workflow for software agents that inspect repositories, review pull requests, generate tests, and turn findings into shippable patches.
Alternative shortlist
Similar skills that may fit this task.
Run multimodal agents that operate desktop interfaces
Connect agents to hundreds of workflow automations
利用AI大模型,一键生成高清短视频 Generate short videos with one click using AI LLM.
Alternative firmware for ESP8266 and ESP32 based devices with easy configuration using webUI, OTA updates, automation using timers or rules, expandability and entirely local control over MQTT, HTTP, Serial or KNX. Full documentation at
--- name: "session-recovery" description: "Find and resume interrupted Copilot CLI sessions using session_store queries" domain: "workflow-recovery" confidence: "high" source: "earned" tools: - name: "sql" description: "Query session_store database for past session history" when: "Always — session_store is the source of truth for session history" ---
## Context
Squad agents run in Copilot CLI sessions that can be interrupted — terminal crashes, network drops, machine restarts, or accidental window closes. When this happens, in-progress work may be left in a partially-completed state: branches with uncommitted changes, issues marked in-progress with no active agent, or checkpoints that were never finalized.
Copilot CLI stores session history in a SQLite database called `session_store` (read-only, accessed via the `sql` tool with `database: "session_store"`). This skill teaches agents how to query that store to detect interrupted sessions and resume work.
## Patterns
### 1. Find Recent Sessions
Query the `sessions` table filtered by time window. Include the last checkpoint to understand where the session stopped:
```sql SELECT s.id, s.summary, s.cwd, s.branch, s.updated_at, (SELECT title FROM checkpoints WHERE session_id = s.id ORDER BY checkpoint_number DESC LIMIT 1) AS last_checkpoint FROM sessions s WHERE s.updated_at >= datetime('now', '-24 hours') ORDER BY s.updated_at DESC; ```
### 2. Filter Out Automated Sessions
Automated agents (monitors, keep-alive, heartbeat) create high-volume sessions that obscure human-initiated work. Exclude them:
```sql SELECT s.id, s.summary, s.cwd, s.updated_at, (SELECT title FROM checkpoints WHERE session_id = s.id ORDER BY checkpoint_number DESC LIMIT 1) AS last_checkpoint FROM sessions s WHERE s.updated_at >= datetime('now', '-24 hours') AND s.id NOT IN ( SELECT DISTINCT t.session_id FROM turns t WHERE t.turn_index = 0 AND (LOWER(t.user_message) LIKE '%keep-alive%' OR LOWER(t.user_message) LIKE '%heartbeat%') ) ORDER BY s.updated_at DESC; ```
### 3. Search by Topic (FTS5)
Use the `search_index` FTS5 table for keyword search. Expand queries with synonyms since this is keyword-based, not semantic:
```sql SELECT DISTINCT s.id, s.summary, s.cwd, s.updated_at FROM search_index si JOIN sessions s ON si.session_id = s.id WHERE search_index MATCH 'auth OR login OR token OR JWT' AND s.updated_at >= datetime('now', '-48 hours') ORDER BY s.updated_at DESC LIMIT 10; ```
### 4. Search by Working Directory
```sql SELECT s.id, s.summary, s.updated_at, (SELECT title FROM checkpoints WHERE session_id = s.id ORDER BY checkpoint_number DESC LIMIT 1) AS last_checkpoint FROM sessions s WHERE s.cwd LIKE '%my-project%' AND s.updated_at >= datetime('now', '-48 hours') ORDER BY s.updated_at DESC; ```
### 5. Get Full Session Context Before Resuming
Before resuming, inspect what the session was doing:
```sql -- Conversation turns SELECT turn_index, substr(user_message, 1, 200) AS ask, timestamp FROM turns WHERE session_id = 'SESSION_ID' ORDER BY turn_index;
-- Checkpoint progress SELECT checkpoint_number, title, overview FROM checkpoints WHERE session_id = 'SESSION_ID' ORDER BY checkpoint_number;
-- Files touched SELECT file_path, tool_name FROM session_files WHERE session_id = 'SESSION_ID';
-- Linked PRs/issues/commits SELECT ref_type, ref_value FROM session_refs WHERE session_id = 'SESSION_ID'; ```
### 6. Detect Orphaned Issue Work
Find sessions that were working on issues but may not have completed:
```sql SELECT DISTINCT s.id, s.branch, s.summary, s.updated_at, sr.ref_type, sr.ref_value FROM sessions s JOIN session_refs sr ON s.id = sr.session_id WHERE sr.ref_type = 'issue' AND s.updated_at >= datetime('now', '-48 hours') ORDER BY s.updated_at DESC; ```
Cross-reference with `gh issue list --label "status:in-progress"` to find issues that are marked in-progress but have no active session.
### 7. Resume a Session
Once you have the session ID:
```bash # Resume directly copilot --resume SESSION_ID ```
## Examples
**Recovering from a crash during PR creation:** 1. Query recent sessions filtered by branch name 2. Find the session that was working on the PR 3. Check its last checkpoint — was the code committed? Was the PR created? 4. Resume or manually complete the remaining steps
**Finding yesterday's work on a feature:** 1. Use FTS5 search with feature keywords 2. Filter to the relevant working directory 3. Review checkpoint progress to see how far the session got 4. Resume if work remains, or start fresh with the context
## Anti-Patterns
- ❌ Searching by partial session IDs — always use full UUIDs - ❌ Resuming sessions that completed successfully — they have no pending work - ❌ Using `MATCH` with special characters without escaping — wrap paths in double quotes - ❌ Skipping the automated-session filter — high-volume automated sessions will flood results - ❌ Assuming FTS5 is semantic search — it's keyword-based; always expand queries with synonyms - ❌ Ignoring checkpoint data — checkpoints show exactly where the session stopped
Source provenance
Decision snapshot
1,291 GitHub stars
Audit
Install and adoption review
Agent-proven evidence
Outcome reports after resolve, review, install, and one narrow run.
No agent outcome data yet. The first agent run can report success, setup needs, risk blocks, failure, or not-relevant through /api/agent/outcome.
Install
Free and open source. Review the report before installing into production agents.
Growth loop
Scenario-led draft for session-recovery, ready for a manual X post.
A practical pick for a repeatable workflow: session-recovery: Find and resume interrupted Copilot CLI sessions using session_store queries 1.3K stars https://www.openagentskill.com/skills/microsoft-session-recovery?ref=x
Listing + install path for session-recovery: https://www.openagentskill.com/skills/microsoft-session-recovery?ref=x Install: npx skills add microsoft/waza --skill session-recovery
Listing source
This listing was indexed from public sources and is not marked official until a maintainer claim is approved.
Attribution links to the public repository or creator profile. Creators can claim the listing to update ownership signals.
Claim this skillOwner claim
This Registry indexed listing is attributed to microsoft but is not marked official yet. Claim it to add a verified owner signal and make future launch, install, and audit updates easier to trust.
Creator backlink kit
Show the canonical listing, current trust and audit signals, and real Agent-Proven evidence where developers evaluate the repository.
[](https://www.openagentskill.com/skills/microsoft-session-recovery?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)
[](https://www.openagentskill.com/skills/microsoft-session-recovery?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)
[](https://www.openagentskill.com/skills/microsoft-session-recovery/audit)
[](https://www.openagentskill.com/skills/microsoft-session-recovery?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)microsoft
@microsoft
Share whether this skill looks useful for your agent workflow. Aggregated feedback improves rankings over time.
Sandbox only
UI-TARS Desktop
Run multimodal agents that operate desktop interfaces
37.0K Starsn8n
Connect agents to hundreds of workflow automations
194.1K StarsMoneyPrinterTurbo
利用AI大模型,一键生成高清短视频 Generate short videos with one click using AI LLM.
88.5K StarsTasmota
Alternative firmware for ESP8266 and ESP32 based devices with easy configuration using webUI, OTA updates, automation using timers or rules, expandability and entirely local control over MQTT, HTTP, Serial or KNX. Full documentation at
24.7K StarsInstall targets
Codex install prompt
Install the "session-recovery" agent skill from https://github.com/microsoft/waza/tree/main/.copilot/skills/session-recovery. Read its SKILL.md or equivalent instructions first, install only the files needed for this workspace, and summarize any required setup before using it. Skill purpose: Find and resume interrupted Copilot CLI sessions using session_store queries After the install attempt, report the result to https://www.openagentskill.com/api/agent/outcome with POST JSON {"event_id":"install_<unique-id>","skill_slug":"microsoft-session-recovery","task":"Install session-recovery","agent":"codex","outcome":"success","install_used":true}. Replace event_id with a unique value and outcome with success or failed. Report success only after the skill is installed and a minimal verification passes.Supply asset profile
Code review, repo analysis, testing, CI, GitHub, DevOps, and developer workflow skills.
Scenario
Database and SQL
I need my agent to inspect database schemas, write SQL, and explain query results.
Agent fit
Claude Code + CLI + Codex
Codex, Claude Code, Cursor, CLI, or custom agents.
Install
Ready
npx skills add microsoft/waza --skill session-recovery
Maintenance
fresh
2d since push
Risk
Needs review
Dependency or permission surface needs review
GitHub quality
1.3K
78/100 Quality · 75/100 Trust
Coverage tags
Review notes
Dependency or permission surface needs review · Permission surface may require sandboxing
Agent adoption scorecard
These scores combine public repository metadata, OpenAgentSkill review signals, maintenance freshness, and install readiness. They are a shortlist signal, not a replacement for human review.
Quality
StrongSolid option that is likely worth shortlisting for production workflows.
Trust
Sandbox onlyUseful candidate with missing or mixed trust signals. Keep it in an isolated workspace until the outcome loop proves task fit.
Audit
Needs reviewA machine-readable review of install readiness, security metadata, maintenance, and adoption risk.
OpenAgentSkill Trust Score v5
Run only in a sandbox and compare close alternatives before using it for real work.
Stars
1.3K GitHub stars
Repo activity
1.3K stars, 81 forks
Maintenance
2d since push
License
MIT
Install
npx skills add microsoft/waza --skill session-recovery
Install safety
Agent-readable metadata
Use this block or the embedded JSON to decide whether an agent should install this skill, choose an alternative, or ask for human review first.
Suited tasks
Suited agents
Install decision
Trust and risk
Outcome loop
Install command
npx skills add microsoft/waza --skill session-recoveryDo not use when
Agent safety v2
This skill should not be selected by an agent without explicit human security review.
Do not auto-install. Inspect the source, dependencies, and permission surface first.
high
Skill metadata references terminal, CLI, shell, subprocess, or command execution workflows.
medium
Skill likely fetches remote pages, APIs, repositories, or external services.
medium
Skill may read or write project files, documents, generated artifacts, or local workspace state.
high
Skill metadata references credentials, tokens, environment variables, or secret-bearing workflows.
Agent resolve plan
The Resolve API returns the selected skill, alternatives, safety policy, audit notes, install target, and copy-paste prompt an agent can follow without scraping this page.
Open JSON
/api/agent/resolve?task=Use%20session-recovery%20for%20an%20agent%20workflow&agent=codex&max_risk=medium
Resolve text
/api/agent/resolve?task=Use%20session-recovery%20for%20an%20agent%20workflow&agent=codex&max_risk=medium&format=text
Install handoff
/api/skills/microsoft-session-recovery/install
Agent should check
Copy prompt
Task: Use session-recovery in this workspace.
Resolve first: https://www.openagentskill.com/api/agent/resolve?task=Use%20session-recovery%20for%20an%20agent%20workflow&agent=codex&max_risk=medium
Review install handoff: https://www.openagentskill.com/api/skills/microsoft-session-recovery/install
Install command: npx skills add microsoft/waza --skill session-recovery
Before running it, summarize audit warnings, required permissions, and the fallback skill if install is risky.Agent handoff
Use the public install endpoint to fetch the command, safety checklist, target prompts, and canonical links for this skill.
Install handoff
/api/skills/microsoft-session-recovery/install
LLM text format
/api/skills/microsoft-session-recovery/install?format=text
Find alternatives
/api/skills/search?q=session-recovery&limit=3
Agent prompt
Use session-recovery for this task. Review https://www.openagentskill.com/api/skills/microsoft-session-recovery/install, then install with: npx skills add microsoft/waza --skill session-recoveryRegistry metadata
This page exposes the same decision, trust, audit, use-case, and install signals through the Registry API, so agents can rank this skill without scraping the UI.
Manifest
/api/registry/manifest/microsoft-session-recovery
LLM text
/api/registry/manifest/microsoft-session-recovery?format=text
Install alias
/api/registry/install/microsoft-session-recovery
Recommend
/api/registry/recommend?task=Use%20session-recovery%20in%20an%20agent%20workflow&limit=3
Agent fit
Database and SQL
Use-case tags
Platforms
Claude Code
Audit report
A machine-readable review of install readiness, security metadata, maintenance, and adoption risk.
Agent decision cockpit
Use this as a leading candidate, then validate the README and install path in your own agent stack.
Role in stack
Primary pick
Primary fit
Database and SQL
Trust label
Production-ready
Install path
Command ready
Use when
Evidence
review first
Implementation path
Trust profile
Useful candidate with missing or mixed trust signals. Keep it in an isolated workspace until the outcome loop proves task fit.
GitHub adoption
PASS1.3K GitHub stars
Stars/forks activity
INFO1.3K stars, 81 forks; issue activity unavailable in current metadata
Recent maintenance
PASS2d since push
License clarity
PASSMIT
Good signals
Review before install
Recommended action
Run only in a sandbox and compare close alternatives before using it for real work.
Quality profile
Solid option that is likely worth shortlisting for production workflows.
Workflow fit
Work with data stores
I need my agent to inspect database schemas, write SQL, and explain query results.
Operate local tools
I need my agent to operate local files and desktop apps in a repeatable workflow.
Investigate faster
I need my agent to research a topic, compare sources, and produce a concise report.
Workflow fit
Turn skills into distribution
A workflow for turning newly indexed skills into SEO briefs, social drafts, comparison pages, and reusable publishing workflows.
Find, compare, and synthesize
A workflow for agents that gather sources, compare claims, summarize long material, and draft useful research briefs.
Inspect, patch, and verify code
A workflow for software agents that inspect repositories, review pull requests, generate tests, and turn findings into shippable patches.
Alternative shortlist
Similar skills that may fit this task.
Run multimodal agents that operate desktop interfaces
Connect agents to hundreds of workflow automations
利用AI大模型,一键生成高清短视频 Generate short videos with one click using AI LLM.
Alternative firmware for ESP8266 and ESP32 based devices with easy configuration using webUI, OTA updates, automation using timers or rules, expandability and entirely local control over MQTT, HTTP, Serial or KNX. Full documentation at
--- name: "session-recovery" description: "Find and resume interrupted Copilot CLI sessions using session_store queries" domain: "workflow-recovery" confidence: "high" source: "earned" tools: - name: "sql" description: "Query session_store database for past session history" when: "Always — session_store is the source of truth for session history" ---
## Context
Squad agents run in Copilot CLI sessions that can be interrupted — terminal crashes, network drops, machine restarts, or accidental window closes. When this happens, in-progress work may be left in a partially-completed state: branches with uncommitted changes, issues marked in-progress with no active agent, or checkpoints that were never finalized.
Copilot CLI stores session history in a SQLite database called `session_store` (read-only, accessed via the `sql` tool with `database: "session_store"`). This skill teaches agents how to query that store to detect interrupted sessions and resume work.
## Patterns
### 1. Find Recent Sessions
Query the `sessions` table filtered by time window. Include the last checkpoint to understand where the session stopped:
```sql SELECT s.id, s.summary, s.cwd, s.branch, s.updated_at, (SELECT title FROM checkpoints WHERE session_id = s.id ORDER BY checkpoint_number DESC LIMIT 1) AS last_checkpoint FROM sessions s WHERE s.updated_at >= datetime('now', '-24 hours') ORDER BY s.updated_at DESC; ```
### 2. Filter Out Automated Sessions
Automated agents (monitors, keep-alive, heartbeat) create high-volume sessions that obscure human-initiated work. Exclude them:
```sql SELECT s.id, s.summary, s.cwd, s.updated_at, (SELECT title FROM checkpoints WHERE session_id = s.id ORDER BY checkpoint_number DESC LIMIT 1) AS last_checkpoint FROM sessions s WHERE s.updated_at >= datetime('now', '-24 hours') AND s.id NOT IN ( SELECT DISTINCT t.session_id FROM turns t WHERE t.turn_index = 0 AND (LOWER(t.user_message) LIKE '%keep-alive%' OR LOWER(t.user_message) LIKE '%heartbeat%') ) ORDER BY s.updated_at DESC; ```
### 3. Search by Topic (FTS5)
Use the `search_index` FTS5 table for keyword search. Expand queries with synonyms since this is keyword-based, not semantic:
```sql SELECT DISTINCT s.id, s.summary, s.cwd, s.updated_at FROM search_index si JOIN sessions s ON si.session_id = s.id WHERE search_index MATCH 'auth OR login OR token OR JWT' AND s.updated_at >= datetime('now', '-48 hours') ORDER BY s.updated_at DESC LIMIT 10; ```
### 4. Search by Working Directory
```sql SELECT s.id, s.summary, s.updated_at, (SELECT title FROM checkpoints WHERE session_id = s.id ORDER BY checkpoint_number DESC LIMIT 1) AS last_checkpoint FROM sessions s WHERE s.cwd LIKE '%my-project%' AND s.updated_at >= datetime('now', '-48 hours') ORDER BY s.updated_at DESC; ```
### 5. Get Full Session Context Before Resuming
Before resuming, inspect what the session was doing:
```sql -- Conversation turns SELECT turn_index, substr(user_message, 1, 200) AS ask, timestamp FROM turns WHERE session_id = 'SESSION_ID' ORDER BY turn_index;
-- Checkpoint progress SELECT checkpoint_number, title, overview FROM checkpoints WHERE session_id = 'SESSION_ID' ORDER BY checkpoint_number;
-- Files touched SELECT file_path, tool_name FROM session_files WHERE session_id = 'SESSION_ID';
-- Linked PRs/issues/commits SELECT ref_type, ref_value FROM session_refs WHERE session_id = 'SESSION_ID'; ```
### 6. Detect Orphaned Issue Work
Find sessions that were working on issues but may not have completed:
```sql SELECT DISTINCT s.id, s.branch, s.summary, s.updated_at, sr.ref_type, sr.ref_value FROM sessions s JOIN session_refs sr ON s.id = sr.session_id WHERE sr.ref_type = 'issue' AND s.updated_at >= datetime('now', '-48 hours') ORDER BY s.updated_at DESC; ```
Cross-reference with `gh issue list --label "status:in-progress"` to find issues that are marked in-progress but have no active session.
### 7. Resume a Session
Once you have the session ID:
```bash # Resume directly copilot --resume SESSION_ID ```
## Examples
**Recovering from a crash during PR creation:** 1. Query recent sessions filtered by branch name 2. Find the session that was working on the PR 3. Check its last checkpoint — was the code committed? Was the PR created? 4. Resume or manually complete the remaining steps
**Finding yesterday's work on a feature:** 1. Use FTS5 search with feature keywords 2. Filter to the relevant working directory 3. Review checkpoint progress to see how far the session got 4. Resume if work remains, or start fresh with the context
## Anti-Patterns
- ❌ Searching by partial session IDs — always use full UUIDs - ❌ Resuming sessions that completed successfully — they have no pending work - ❌ Using `MATCH` with special characters without escaping — wrap paths in double quotes - ❌ Skipping the automated-session filter — high-volume automated sessions will flood results - ❌ Assuming FTS5 is semantic search — it's keyword-based; always expand queries with synonyms - ❌ Ignoring checkpoint data — checkpoints show exactly where the session stopped
Source provenance
Decision snapshot
1,291 GitHub stars
Audit
Install and adoption review
Agent-proven evidence
Outcome reports after resolve, review, install, and one narrow run.
No agent outcome data yet. The first agent run can report success, setup needs, risk blocks, failure, or not-relevant through /api/agent/outcome.
Install
Free and open source. Review the report before installing into production agents.
Growth loop
Scenario-led draft for session-recovery, ready for a manual X post.
A practical pick for a repeatable workflow: session-recovery: Find and resume interrupted Copilot CLI sessions using session_store queries 1.3K stars https://www.openagentskill.com/skills/microsoft-session-recovery?ref=x
Listing + install path for session-recovery: https://www.openagentskill.com/skills/microsoft-session-recovery?ref=x Install: npx skills add microsoft/waza --skill session-recovery
Listing source
This listing was indexed from public sources and is not marked official until a maintainer claim is approved.
Attribution links to the public repository or creator profile. Creators can claim the listing to update ownership signals.
Claim this skillOwner claim
This Registry indexed listing is attributed to microsoft but is not marked official yet. Claim it to add a verified owner signal and make future launch, install, and audit updates easier to trust.
Creator backlink kit
Show the canonical listing, current trust and audit signals, and real Agent-Proven evidence where developers evaluate the repository.
[](https://www.openagentskill.com/skills/microsoft-session-recovery?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)
[](https://www.openagentskill.com/skills/microsoft-session-recovery?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)
[](https://www.openagentskill.com/skills/microsoft-session-recovery/audit)
[](https://www.openagentskill.com/skills/microsoft-session-recovery?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)microsoft
@microsoft
Share whether this skill looks useful for your agent workflow. Aggregated feedback improves rankings over time.
Sandbox only
UI-TARS Desktop
Run multimodal agents that operate desktop interfaces
37.0K Starsn8n
Connect agents to hundreds of workflow automations
194.1K StarsMoneyPrinterTurbo
利用AI大模型,一键生成高清短视频 Generate short videos with one click using AI LLM.
88.5K StarsTasmota
Alternative firmware for ESP8266 and ESP32 based devices with easy configuration using webUI, OTA updates, automation using timers or rules, expandability and entirely local control over MQTT, HTTP, Serial or KNX. Full documentation at
24.7K StarsInstall targets
Codex install prompt
Install the "session-recovery" agent skill from https://github.com/microsoft/waza/tree/main/.copilot/skills/session-recovery. Read its SKILL.md or equivalent instructions first, install only the files needed for this workspace, and summarize any required setup before using it. Skill purpose: Find and resume interrupted Copilot CLI sessions using session_store queries After the install attempt, report the result to https://www.openagentskill.com/api/agent/outcome with POST JSON {"event_id":"install_<unique-id>","skill_slug":"microsoft-session-recovery","task":"Install session-recovery","agent":"codex","outcome":"success","install_used":true}. Replace event_id with a unique value and outcome with success or failed. Report success only after the skill is installed and a minimal verification passes.Supply asset profile
Code review, repo analysis, testing, CI, GitHub, DevOps, and developer workflow skills.
Scenario
Database and SQL
I need my agent to inspect database schemas, write SQL, and explain query results.
Agent fit
Claude Code + CLI + Codex
Codex, Claude Code, Cursor, CLI, or custom agents.
Install
Ready
npx skills add microsoft/waza --skill session-recovery
Maintenance
fresh
2d since push
Risk
Needs review
Dependency or permission surface needs review
GitHub quality
1.3K
78/100 Quality · 75/100 Trust
Coverage tags
Review notes
Dependency or permission surface needs review · Permission surface may require sandboxing
Agent adoption scorecard
These scores combine public repository metadata, OpenAgentSkill review signals, maintenance freshness, and install readiness. They are a shortlist signal, not a replacement for human review.
Quality
StrongSolid option that is likely worth shortlisting for production workflows.
Trust
Sandbox onlyUseful candidate with missing or mixed trust signals. Keep it in an isolated workspace until the outcome loop proves task fit.
Audit
Needs reviewA machine-readable review of install readiness, security metadata, maintenance, and adoption risk.
OpenAgentSkill Trust Score v5
Run only in a sandbox and compare close alternatives before using it for real work.
Stars
1.3K GitHub stars
Repo activity
1.3K stars, 81 forks
Maintenance
2d since push
License
MIT
Install
npx skills add microsoft/waza --skill session-recovery
Install safety
Agent-readable metadata
Use this block or the embedded JSON to decide whether an agent should install this skill, choose an alternative, or ask for human review first.
Suited tasks
Suited agents
Install decision
Trust and risk
Outcome loop
Install command
npx skills add microsoft/waza --skill session-recoveryDo not use when
Agent safety v2
This skill should not be selected by an agent without explicit human security review.
Do not auto-install. Inspect the source, dependencies, and permission surface first.
high
Skill metadata references terminal, CLI, shell, subprocess, or command execution workflows.
medium
Skill likely fetches remote pages, APIs, repositories, or external services.
medium
Skill may read or write project files, documents, generated artifacts, or local workspace state.
high
Skill metadata references credentials, tokens, environment variables, or secret-bearing workflows.
Agent resolve plan
The Resolve API returns the selected skill, alternatives, safety policy, audit notes, install target, and copy-paste prompt an agent can follow without scraping this page.
Open JSON
/api/agent/resolve?task=Use%20session-recovery%20for%20an%20agent%20workflow&agent=codex&max_risk=medium
Resolve text
/api/agent/resolve?task=Use%20session-recovery%20for%20an%20agent%20workflow&agent=codex&max_risk=medium&format=text
Install handoff
/api/skills/microsoft-session-recovery/install
Agent should check
Copy prompt
Task: Use session-recovery in this workspace.
Resolve first: https://www.openagentskill.com/api/agent/resolve?task=Use%20session-recovery%20for%20an%20agent%20workflow&agent=codex&max_risk=medium
Review install handoff: https://www.openagentskill.com/api/skills/microsoft-session-recovery/install
Install command: npx skills add microsoft/waza --skill session-recovery
Before running it, summarize audit warnings, required permissions, and the fallback skill if install is risky.Agent handoff
Use the public install endpoint to fetch the command, safety checklist, target prompts, and canonical links for this skill.
Install handoff
/api/skills/microsoft-session-recovery/install
LLM text format
/api/skills/microsoft-session-recovery/install?format=text
Find alternatives
/api/skills/search?q=session-recovery&limit=3
Agent prompt
Use session-recovery for this task. Review https://www.openagentskill.com/api/skills/microsoft-session-recovery/install, then install with: npx skills add microsoft/waza --skill session-recoveryRegistry metadata
This page exposes the same decision, trust, audit, use-case, and install signals through the Registry API, so agents can rank this skill without scraping the UI.
Manifest
/api/registry/manifest/microsoft-session-recovery
LLM text
/api/registry/manifest/microsoft-session-recovery?format=text
Install alias
/api/registry/install/microsoft-session-recovery
Recommend
/api/registry/recommend?task=Use%20session-recovery%20in%20an%20agent%20workflow&limit=3
Agent fit
Database and SQL
Use-case tags
Platforms
Claude Code
Audit report
A machine-readable review of install readiness, security metadata, maintenance, and adoption risk.
Agent decision cockpit
Use this as a leading candidate, then validate the README and install path in your own agent stack.
Role in stack
Primary pick
Primary fit
Database and SQL
Trust label
Production-ready
Install path
Command ready
Use when
Evidence
review first
Implementation path
Trust profile
Useful candidate with missing or mixed trust signals. Keep it in an isolated workspace until the outcome loop proves task fit.
GitHub adoption
PASS1.3K GitHub stars
Stars/forks activity
INFO1.3K stars, 81 forks; issue activity unavailable in current metadata
Recent maintenance
PASS2d since push
License clarity
PASSMIT
Good signals
Review before install
Recommended action
Run only in a sandbox and compare close alternatives before using it for real work.
Quality profile
Solid option that is likely worth shortlisting for production workflows.
Workflow fit
Work with data stores
I need my agent to inspect database schemas, write SQL, and explain query results.
Operate local tools
I need my agent to operate local files and desktop apps in a repeatable workflow.
Investigate faster
I need my agent to research a topic, compare sources, and produce a concise report.
Workflow fit
Turn skills into distribution
A workflow for turning newly indexed skills into SEO briefs, social drafts, comparison pages, and reusable publishing workflows.
Find, compare, and synthesize
A workflow for agents that gather sources, compare claims, summarize long material, and draft useful research briefs.
Inspect, patch, and verify code
A workflow for software agents that inspect repositories, review pull requests, generate tests, and turn findings into shippable patches.
Alternative shortlist
Similar skills that may fit this task.
Run multimodal agents that operate desktop interfaces
Connect agents to hundreds of workflow automations
利用AI大模型,一键生成高清短视频 Generate short videos with one click using AI LLM.
Alternative firmware for ESP8266 and ESP32 based devices with easy configuration using webUI, OTA updates, automation using timers or rules, expandability and entirely local control over MQTT, HTTP, Serial or KNX. Full documentation at
--- name: "session-recovery" description: "Find and resume interrupted Copilot CLI sessions using session_store queries" domain: "workflow-recovery" confidence: "high" source: "earned" tools: - name: "sql" description: "Query session_store database for past session history" when: "Always — session_store is the source of truth for session history" ---
## Context
Squad agents run in Copilot CLI sessions that can be interrupted — terminal crashes, network drops, machine restarts, or accidental window closes. When this happens, in-progress work may be left in a partially-completed state: branches with uncommitted changes, issues marked in-progress with no active agent, or checkpoints that were never finalized.
Copilot CLI stores session history in a SQLite database called `session_store` (read-only, accessed via the `sql` tool with `database: "session_store"`). This skill teaches agents how to query that store to detect interrupted sessions and resume work.
## Patterns
### 1. Find Recent Sessions
Query the `sessions` table filtered by time window. Include the last checkpoint to understand where the session stopped:
```sql SELECT s.id, s.summary, s.cwd, s.branch, s.updated_at, (SELECT title FROM checkpoints WHERE session_id = s.id ORDER BY checkpoint_number DESC LIMIT 1) AS last_checkpoint FROM sessions s WHERE s.updated_at >= datetime('now', '-24 hours') ORDER BY s.updated_at DESC; ```
### 2. Filter Out Automated Sessions
Automated agents (monitors, keep-alive, heartbeat) create high-volume sessions that obscure human-initiated work. Exclude them:
```sql SELECT s.id, s.summary, s.cwd, s.updated_at, (SELECT title FROM checkpoints WHERE session_id = s.id ORDER BY checkpoint_number DESC LIMIT 1) AS last_checkpoint FROM sessions s WHERE s.updated_at >= datetime('now', '-24 hours') AND s.id NOT IN ( SELECT DISTINCT t.session_id FROM turns t WHERE t.turn_index = 0 AND (LOWER(t.user_message) LIKE '%keep-alive%' OR LOWER(t.user_message) LIKE '%heartbeat%') ) ORDER BY s.updated_at DESC; ```
### 3. Search by Topic (FTS5)
Use the `search_index` FTS5 table for keyword search. Expand queries with synonyms since this is keyword-based, not semantic:
```sql SELECT DISTINCT s.id, s.summary, s.cwd, s.updated_at FROM search_index si JOIN sessions s ON si.session_id = s.id WHERE search_index MATCH 'auth OR login OR token OR JWT' AND s.updated_at >= datetime('now', '-48 hours') ORDER BY s.updated_at DESC LIMIT 10; ```
### 4. Search by Working Directory
```sql SELECT s.id, s.summary, s.updated_at, (SELECT title FROM checkpoints WHERE session_id = s.id ORDER BY checkpoint_number DESC LIMIT 1) AS last_checkpoint FROM sessions s WHERE s.cwd LIKE '%my-project%' AND s.updated_at >= datetime('now', '-48 hours') ORDER BY s.updated_at DESC; ```
### 5. Get Full Session Context Before Resuming
Before resuming, inspect what the session was doing:
```sql -- Conversation turns SELECT turn_index, substr(user_message, 1, 200) AS ask, timestamp FROM turns WHERE session_id = 'SESSION_ID' ORDER BY turn_index;
-- Checkpoint progress SELECT checkpoint_number, title, overview FROM checkpoints WHERE session_id = 'SESSION_ID' ORDER BY checkpoint_number;
-- Files touched SELECT file_path, tool_name FROM session_files WHERE session_id = 'SESSION_ID';
-- Linked PRs/issues/commits SELECT ref_type, ref_value FROM session_refs WHERE session_id = 'SESSION_ID'; ```
### 6. Detect Orphaned Issue Work
Find sessions that were working on issues but may not have completed:
```sql SELECT DISTINCT s.id, s.branch, s.summary, s.updated_at, sr.ref_type, sr.ref_value FROM sessions s JOIN session_refs sr ON s.id = sr.session_id WHERE sr.ref_type = 'issue' AND s.updated_at >= datetime('now', '-48 hours') ORDER BY s.updated_at DESC; ```
Cross-reference with `gh issue list --label "status:in-progress"` to find issues that are marked in-progress but have no active session.
### 7. Resume a Session
Once you have the session ID:
```bash # Resume directly copilot --resume SESSION_ID ```
## Examples
**Recovering from a crash during PR creation:** 1. Query recent sessions filtered by branch name 2. Find the session that was working on the PR 3. Check its last checkpoint — was the code committed? Was the PR created? 4. Resume or manually complete the remaining steps
**Finding yesterday's work on a feature:** 1. Use FTS5 search with feature keywords 2. Filter to the relevant working directory 3. Review checkpoint progress to see how far the session got 4. Resume if work remains, or start fresh with the context
## Anti-Patterns
- ❌ Searching by partial session IDs — always use full UUIDs - ❌ Resuming sessions that completed successfully — they have no pending work - ❌ Using `MATCH` with special characters without escaping — wrap paths in double quotes - ❌ Skipping the automated-session filter — high-volume automated sessions will flood results - ❌ Assuming FTS5 is semantic search — it's keyword-based; always expand queries with synonyms - ❌ Ignoring checkpoint data — checkpoints show exactly where the session stopped
Source provenance
Decision snapshot
1,291 GitHub stars
Audit
Install and adoption review
Agent-proven evidence
Outcome reports after resolve, review, install, and one narrow run.
No agent outcome data yet. The first agent run can report success, setup needs, risk blocks, failure, or not-relevant through /api/agent/outcome.
Install
Free and open source. Review the report before installing into production agents.
Growth loop
Scenario-led draft for session-recovery, ready for a manual X post.
A practical pick for a repeatable workflow: session-recovery: Find and resume interrupted Copilot CLI sessions using session_store queries 1.3K stars https://www.openagentskill.com/skills/microsoft-session-recovery?ref=x
Listing + install path for session-recovery: https://www.openagentskill.com/skills/microsoft-session-recovery?ref=x Install: npx skills add microsoft/waza --skill session-recovery
Listing source
This listing was indexed from public sources and is not marked official until a maintainer claim is approved.
Attribution links to the public repository or creator profile. Creators can claim the listing to update ownership signals.
Claim this skillOwner claim
This Registry indexed listing is attributed to microsoft but is not marked official yet. Claim it to add a verified owner signal and make future launch, install, and audit updates easier to trust.
Creator backlink kit
Show the canonical listing, current trust and audit signals, and real Agent-Proven evidence where developers evaluate the repository.
[](https://www.openagentskill.com/skills/microsoft-session-recovery?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)
[](https://www.openagentskill.com/skills/microsoft-session-recovery?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)
[](https://www.openagentskill.com/skills/microsoft-session-recovery/audit)
[](https://www.openagentskill.com/skills/microsoft-session-recovery?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)microsoft
@microsoft
Share whether this skill looks useful for your agent workflow. Aggregated feedback improves rankings over time.
Sandbox only
UI-TARS Desktop
Run multimodal agents that operate desktop interfaces
37.0K Starsn8n
Connect agents to hundreds of workflow automations
194.1K StarsMoneyPrinterTurbo
利用AI大模型,一键生成高清短视频 Generate short videos with one click using AI LLM.
88.5K StarsTasmota
Alternative firmware for ESP8266 and ESP32 based devices with easy configuration using webUI, OTA updates, automation using timers or rules, expandability and entirely local control over MQTT, HTTP, Serial or KNX. Full documentation at
24.7K StarsInstall targets
Codex install prompt
Install the "session-recovery" agent skill from https://github.com/microsoft/waza/tree/main/.copilot/skills/session-recovery. Read its SKILL.md or equivalent instructions first, install only the files needed for this workspace, and summarize any required setup before using it. Skill purpose: Find and resume interrupted Copilot CLI sessions using session_store queries After the install attempt, report the result to https://www.openagentskill.com/api/agent/outcome with POST JSON {"event_id":"install_<unique-id>","skill_slug":"microsoft-session-recovery","task":"Install session-recovery","agent":"codex","outcome":"success","install_used":true}. Replace event_id with a unique value and outcome with success or failed. Report success only after the skill is installed and a minimal verification passes.Supply asset profile
Code review, repo analysis, testing, CI, GitHub, DevOps, and developer workflow skills.
Scenario
Database and SQL
I need my agent to inspect database schemas, write SQL, and explain query results.
Agent fit
Claude Code + CLI + Codex
Codex, Claude Code, Cursor, CLI, or custom agents.
Install
Ready
npx skills add microsoft/waza --skill session-recovery
Maintenance
fresh
2d since push
Risk
Needs review
Dependency or permission surface needs review
GitHub quality
1.3K
78/100 Quality · 75/100 Trust
Coverage tags
Review notes
Dependency or permission surface needs review · Permission surface may require sandboxing
Agent adoption scorecard
These scores combine public repository metadata, OpenAgentSkill review signals, maintenance freshness, and install readiness. They are a shortlist signal, not a replacement for human review.
Quality
StrongSolid option that is likely worth shortlisting for production workflows.
Trust
Sandbox onlyUseful candidate with missing or mixed trust signals. Keep it in an isolated workspace until the outcome loop proves task fit.
Audit
Needs reviewA machine-readable review of install readiness, security metadata, maintenance, and adoption risk.
OpenAgentSkill Trust Score v5
Run only in a sandbox and compare close alternatives before using it for real work.
Stars
1.3K GitHub stars
Repo activity
1.3K stars, 81 forks
Maintenance
2d since push
License
MIT
Install
npx skills add microsoft/waza --skill session-recovery
Install safety
Agent-readable metadata
Use this block or the embedded JSON to decide whether an agent should install this skill, choose an alternative, or ask for human review first.
Suited tasks
Suited agents
Install decision
Trust and risk
Outcome loop
Install command
npx skills add microsoft/waza --skill session-recoveryDo not use when
Agent safety v2
This skill should not be selected by an agent without explicit human security review.
Do not auto-install. Inspect the source, dependencies, and permission surface first.
high
Skill metadata references terminal, CLI, shell, subprocess, or command execution workflows.
medium
Skill likely fetches remote pages, APIs, repositories, or external services.
medium
Skill may read or write project files, documents, generated artifacts, or local workspace state.
high
Skill metadata references credentials, tokens, environment variables, or secret-bearing workflows.
Agent resolve plan
The Resolve API returns the selected skill, alternatives, safety policy, audit notes, install target, and copy-paste prompt an agent can follow without scraping this page.
Open JSON
/api/agent/resolve?task=Use%20session-recovery%20for%20an%20agent%20workflow&agent=codex&max_risk=medium
Resolve text
/api/agent/resolve?task=Use%20session-recovery%20for%20an%20agent%20workflow&agent=codex&max_risk=medium&format=text
Install handoff
/api/skills/microsoft-session-recovery/install
Agent should check
Copy prompt
Task: Use session-recovery in this workspace.
Resolve first: https://www.openagentskill.com/api/agent/resolve?task=Use%20session-recovery%20for%20an%20agent%20workflow&agent=codex&max_risk=medium
Review install handoff: https://www.openagentskill.com/api/skills/microsoft-session-recovery/install
Install command: npx skills add microsoft/waza --skill session-recovery
Before running it, summarize audit warnings, required permissions, and the fallback skill if install is risky.Agent handoff
Use the public install endpoint to fetch the command, safety checklist, target prompts, and canonical links for this skill.
Install handoff
/api/skills/microsoft-session-recovery/install
LLM text format
/api/skills/microsoft-session-recovery/install?format=text
Find alternatives
/api/skills/search?q=session-recovery&limit=3
Agent prompt
Use session-recovery for this task. Review https://www.openagentskill.com/api/skills/microsoft-session-recovery/install, then install with: npx skills add microsoft/waza --skill session-recoveryRegistry metadata
This page exposes the same decision, trust, audit, use-case, and install signals through the Registry API, so agents can rank this skill without scraping the UI.
Manifest
/api/registry/manifest/microsoft-session-recovery
LLM text
/api/registry/manifest/microsoft-session-recovery?format=text
Install alias
/api/registry/install/microsoft-session-recovery
Recommend
/api/registry/recommend?task=Use%20session-recovery%20in%20an%20agent%20workflow&limit=3
Agent fit
Database and SQL
Use-case tags
Platforms
Claude Code
Audit report
A machine-readable review of install readiness, security metadata, maintenance, and adoption risk.
Agent decision cockpit
Use this as a leading candidate, then validate the README and install path in your own agent stack.
Role in stack
Primary pick
Primary fit
Database and SQL
Trust label
Production-ready
Install path
Command ready
Use when
Evidence
review first
Implementation path
Trust profile
Useful candidate with missing or mixed trust signals. Keep it in an isolated workspace until the outcome loop proves task fit.
GitHub adoption
PASS1.3K GitHub stars
Stars/forks activity
INFO1.3K stars, 81 forks; issue activity unavailable in current metadata
Recent maintenance
PASS2d since push
License clarity
PASSMIT
Good signals
Review before install
Recommended action
Run only in a sandbox and compare close alternatives before using it for real work.
Quality profile
Solid option that is likely worth shortlisting for production workflows.
Workflow fit
Work with data stores
I need my agent to inspect database schemas, write SQL, and explain query results.
Operate local tools
I need my agent to operate local files and desktop apps in a repeatable workflow.
Investigate faster
I need my agent to research a topic, compare sources, and produce a concise report.
Workflow fit
Turn skills into distribution
A workflow for turning newly indexed skills into SEO briefs, social drafts, comparison pages, and reusable publishing workflows.
Find, compare, and synthesize
A workflow for agents that gather sources, compare claims, summarize long material, and draft useful research briefs.
Inspect, patch, and verify code
A workflow for software agents that inspect repositories, review pull requests, generate tests, and turn findings into shippable patches.
Alternative shortlist
Similar skills that may fit this task.
Run multimodal agents that operate desktop interfaces
Connect agents to hundreds of workflow automations
利用AI大模型,一键生成高清短视频 Generate short videos with one click using AI LLM.
Alternative firmware for ESP8266 and ESP32 based devices with easy configuration using webUI, OTA updates, automation using timers or rules, expandability and entirely local control over MQTT, HTTP, Serial or KNX. Full documentation at
--- name: "session-recovery" description: "Find and resume interrupted Copilot CLI sessions using session_store queries" domain: "workflow-recovery" confidence: "high" source: "earned" tools: - name: "sql" description: "Query session_store database for past session history" when: "Always — session_store is the source of truth for session history" ---
## Context
Squad agents run in Copilot CLI sessions that can be interrupted — terminal crashes, network drops, machine restarts, or accidental window closes. When this happens, in-progress work may be left in a partially-completed state: branches with uncommitted changes, issues marked in-progress with no active agent, or checkpoints that were never finalized.
Copilot CLI stores session history in a SQLite database called `session_store` (read-only, accessed via the `sql` tool with `database: "session_store"`). This skill teaches agents how to query that store to detect interrupted sessions and resume work.
## Patterns
### 1. Find Recent Sessions
Query the `sessions` table filtered by time window. Include the last checkpoint to understand where the session stopped:
```sql SELECT s.id, s.summary, s.cwd, s.branch, s.updated_at, (SELECT title FROM checkpoints WHERE session_id = s.id ORDER BY checkpoint_number DESC LIMIT 1) AS last_checkpoint FROM sessions s WHERE s.updated_at >= datetime('now', '-24 hours') ORDER BY s.updated_at DESC; ```
### 2. Filter Out Automated Sessions
Automated agents (monitors, keep-alive, heartbeat) create high-volume sessions that obscure human-initiated work. Exclude them:
```sql SELECT s.id, s.summary, s.cwd, s.updated_at, (SELECT title FROM checkpoints WHERE session_id = s.id ORDER BY checkpoint_number DESC LIMIT 1) AS last_checkpoint FROM sessions s WHERE s.updated_at >= datetime('now', '-24 hours') AND s.id NOT IN ( SELECT DISTINCT t.session_id FROM turns t WHERE t.turn_index = 0 AND (LOWER(t.user_message) LIKE '%keep-alive%' OR LOWER(t.user_message) LIKE '%heartbeat%') ) ORDER BY s.updated_at DESC; ```
### 3. Search by Topic (FTS5)
Use the `search_index` FTS5 table for keyword search. Expand queries with synonyms since this is keyword-based, not semantic:
```sql SELECT DISTINCT s.id, s.summary, s.cwd, s.updated_at FROM search_index si JOIN sessions s ON si.session_id = s.id WHERE search_index MATCH 'auth OR login OR token OR JWT' AND s.updated_at >= datetime('now', '-48 hours') ORDER BY s.updated_at DESC LIMIT 10; ```
### 4. Search by Working Directory
```sql SELECT s.id, s.summary, s.updated_at, (SELECT title FROM checkpoints WHERE session_id = s.id ORDER BY checkpoint_number DESC LIMIT 1) AS last_checkpoint FROM sessions s WHERE s.cwd LIKE '%my-project%' AND s.updated_at >= datetime('now', '-48 hours') ORDER BY s.updated_at DESC; ```
### 5. Get Full Session Context Before Resuming
Before resuming, inspect what the session was doing:
```sql -- Conversation turns SELECT turn_index, substr(user_message, 1, 200) AS ask, timestamp FROM turns WHERE session_id = 'SESSION_ID' ORDER BY turn_index;
-- Checkpoint progress SELECT checkpoint_number, title, overview FROM checkpoints WHERE session_id = 'SESSION_ID' ORDER BY checkpoint_number;
-- Files touched SELECT file_path, tool_name FROM session_files WHERE session_id = 'SESSION_ID';
-- Linked PRs/issues/commits SELECT ref_type, ref_value FROM session_refs WHERE session_id = 'SESSION_ID'; ```
### 6. Detect Orphaned Issue Work
Find sessions that were working on issues but may not have completed:
```sql SELECT DISTINCT s.id, s.branch, s.summary, s.updated_at, sr.ref_type, sr.ref_value FROM sessions s JOIN session_refs sr ON s.id = sr.session_id WHERE sr.ref_type = 'issue' AND s.updated_at >= datetime('now', '-48 hours') ORDER BY s.updated_at DESC; ```
Cross-reference with `gh issue list --label "status:in-progress"` to find issues that are marked in-progress but have no active session.
### 7. Resume a Session
Once you have the session ID:
```bash # Resume directly copilot --resume SESSION_ID ```
## Examples
**Recovering from a crash during PR creation:** 1. Query recent sessions filtered by branch name 2. Find the session that was working on the PR 3. Check its last checkpoint — was the code committed? Was the PR created? 4. Resume or manually complete the remaining steps
**Finding yesterday's work on a feature:** 1. Use FTS5 search with feature keywords 2. Filter to the relevant working directory 3. Review checkpoint progress to see how far the session got 4. Resume if work remains, or start fresh with the context
## Anti-Patterns
- ❌ Searching by partial session IDs — always use full UUIDs - ❌ Resuming sessions that completed successfully — they have no pending work - ❌ Using `MATCH` with special characters without escaping — wrap paths in double quotes - ❌ Skipping the automated-session filter — high-volume automated sessions will flood results - ❌ Assuming FTS5 is semantic search — it's keyword-based; always expand queries with synonyms - ❌ Ignoring checkpoint data — checkpoints show exactly where the session stopped
Source provenance
Decision snapshot
1,291 GitHub stars
Audit
Install and adoption review
Agent-proven evidence
Outcome reports after resolve, review, install, and one narrow run.
No agent outcome data yet. The first agent run can report success, setup needs, risk blocks, failure, or not-relevant through /api/agent/outcome.
Install
Free and open source. Review the report before installing into production agents.
Growth loop
Scenario-led draft for session-recovery, ready for a manual X post.
A practical pick for a repeatable workflow: session-recovery: Find and resume interrupted Copilot CLI sessions using session_store queries 1.3K stars https://www.openagentskill.com/skills/microsoft-session-recovery?ref=x
Listing + install path for session-recovery: https://www.openagentskill.com/skills/microsoft-session-recovery?ref=x Install: npx skills add microsoft/waza --skill session-recovery
Listing source
This listing was indexed from public sources and is not marked official until a maintainer claim is approved.
Attribution links to the public repository or creator profile. Creators can claim the listing to update ownership signals.
Claim this skillOwner claim
This Registry indexed listing is attributed to microsoft but is not marked official yet. Claim it to add a verified owner signal and make future launch, install, and audit updates easier to trust.
Creator backlink kit
Show the canonical listing, current trust and audit signals, and real Agent-Proven evidence where developers evaluate the repository.
[](https://www.openagentskill.com/skills/microsoft-session-recovery?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)
[](https://www.openagentskill.com/skills/microsoft-session-recovery?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)
[](https://www.openagentskill.com/skills/microsoft-session-recovery/audit)
[](https://www.openagentskill.com/skills/microsoft-session-recovery?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)microsoft
@microsoft
Share whether this skill looks useful for your agent workflow. Aggregated feedback improves rankings over time.
Sandbox only
UI-TARS Desktop
Run multimodal agents that operate desktop interfaces
37.0K Starsn8n
Connect agents to hundreds of workflow automations
194.1K StarsMoneyPrinterTurbo
利用AI大模型,一键生成高清短视频 Generate short videos with one click using AI LLM.
88.5K StarsTasmota
Alternative firmware for ESP8266 and ESP32 based devices with easy configuration using webUI, OTA updates, automation using timers or rules, expandability and entirely local control over MQTT, HTTP, Serial or KNX. Full documentation at
24.7K StarsPermission surface
secrets or environment access, shell or command execution
Agent outcomes
No agent outcome data yet
Docs
Usable metadata, review docs
Risk summary
Install readiness
Permission surface
secrets or environment access, shell or command execution
Agent outcomes
No agent outcome data yet
Docs
Usable metadata, review docs
Risk summary
Install readiness
Permission surface
secrets or environment access, shell or command execution
Agent outcomes
No agent outcome data yet
Docs
Usable metadata, review docs
Risk summary
Install readiness
Permission surface
secrets or environment access, shell or command execution
Agent outcomes
No agent outcome data yet
Docs
Usable metadata, review docs
Risk summary
Install readiness