Skip to content
Back to skills

Recover

ASecurity

Recover orphaned Claude Code sessions after a crash or terminal close. Lists dead sessions, lets user pick which to resume, launches them in new terminal tabs.

  • 7 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added May 26, 2026
toolsgobash

Works with

  • claude code
  • terminal

Security analysis

A100/100

Scanned May 27, 2026

npx -y skills add Voxos-ai-Inc/tas --skill recover --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Recover?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Recover
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/voxos-ai-inc-recover/badge)](https://www.skillsdirectory.com/skills/voxos-ai-inc-recover)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: recover
description: Recover orphaned Claude Code sessions after a crash or terminal close. Lists dead sessions, lets user pick which to resume, launches them in new terminal tabs.
---

# /recover — Session Recovery

Recovers orphaned Claude Code sessions by resuming them in new terminal tabs.

## Instructions

### Step 1: Discover orphaned sessions

Run the recovery script to get a JSON list of orphaned sessions:

```bash
bash ~/.claude/hooks/cc-recover.sh list
```

### Step 2: Present sessions to user

Parse the JSON output. For each session, display a numbered table with:

| # | Session ID (first 8 chars) | Model | Started | Last Active | Transcript Size | CWD |
|---|---------------------------|-------|---------|-------------|-----------------|-----|

- **Last Active**: Convert `last_active_epoch` to a human-readable relative time (e.g., "2 hours ago", "yesterday")
- **CWD**: Show only the last 2 path components for readability
- Sort by Last Active descending (most recent first) — the script already does this

If zero orphaned sessions are found, tell the user "No orphaned sessions to recover" and stop.

### Step 3: Ask the user what to recover

Use AskUserQuestion with options:

1. **Resume all recent** — Resume sessions active within the last 6 hours
2. **Resume all** — Resume every orphaned session
3. **Let me pick** — User will specify which session numbers to resume

If the user picks "Let me pick", ask them to specify session numbers (e.g., "1, 3, 5-8").

### Step 4: Launch selected sessions

For each selected session, run:

```bash
bash ~/.claude/hooks/cc-recover.sh launch <full_session_id>
```

This opens a new terminal tab with `claude --resume <id>`.

Add a 0.5s delay between launches to avoid overwhelming the terminal.

### Step 5: Clean up dismissed sessions

For sessions that were NOT selected for recovery, offer to clean them up:

```bash
bash ~/.claude/hooks/cc-recover.sh clean <id1> <id2> ...
```

This marks them as `ended` with reason `recovered-dismissed` so they don't clutter future recovery attempts.

### Step 6: Report

Summarize:
- N sessions resumed (with tab names)
- M sessions dismissed
- Any sessions left untouched

## Notes

- Sessions are identified as orphaned when their tracking status is "active" but the process PID is dead
- After a full terminal restart or crash, ALL previously-active sessions appear orphaned (correct behavior)
- Transcript size helps identify substantial sessions (>1MB = heavy work) vs. quick one-offs (<100KB)

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.