# Recover context after closing or losing a session

> Find what an agent actually did, in the navigator, the timeline, or the CLI, and bring the agent itself back when you closed it by mistake.

**Goal:** you closed the shard, restarted crystl, or came back after a compaction, and you need what happened back.

## What you need

- Nothing set up. Transcripts are read from Claude Code's own files, and crystl's timeline index builds itself.
- Reading history is **free**. `crystl resurrect list` is free too; the resurrect action itself is a [Guild](/pricing/) control command.

## Steps

1. **Undo the close first, if it was recent.** crystl keeps a short undo-close list per gem for **local** shards:

   ```bash
   crystl resurrect list --gem myapp          # what can come back
   crystl resurrect --gem myapp               # the most recently closed one
   crystl resurrect --gem myapp --shard opal  # a specific one
   ```

   The shard returns with its name, color, isolation, and agent session, resumed best effort. Quest party members and remote shards aren't tracked.

2. **Read the session** when you want the record rather than the shard. Open the gem menu (**⋮** on the gem's tab) and choose **history**. The rail lists past sessions by date, the right pane has **Conversation** and **Tools** tabs, and clicking a moment jumps the pane to that point.
3. **Search across everything** with `Cmd+Shift+F`. The timeline covers every shard's agent turns and every shell command, across all gems, sessions, worktrees, quests, and SSH shards, open **and closed**.
4. **Pull it from the terminal** when you're an agent recovering your own context:

   ```bash
   crystl history                     # navigation index for the active shard
   crystl history --row 47            # fetch one row in full
   crystl history --index --tool Bash # narrow the index
   crystl history search "migration"  # across every shard, past and present
   ```

   Bare `crystl history` prints one line per row with a preview, so you skim first and fetch only what you need. `--all` dumps the whole transcript.

## What you'll see when it works

A resurrected shard comes back as a shell first, then relaunches its own agent the moment something is dispatched to it: a message from the chat dock, a quest turn, the phone, or `crystl send`. That's what lets an overnight fan-out survive quitting crystl. `crystl shards` is explicit about the two failure states, `⏸ no agent — relaunches on dispatch` versus `⚠ no agent — relaunch failed`, so a dispatch is never quietly dropped into a bare shell.

For history, the session summary prints on top: total tokens, tool calls, models, and wall-clock active time. Search results are tagged by kind and open the session at the exact moment.

Two limits worth knowing. The **navigator is Claude Code only** for now, because Codex and Antigravity CLI record history in different formats, and `crystl history` returns nothing on those shards. The **timeline is agent-neutral** and does cover them, so `Cmd+Shift+F` still finds that work. Restore on restart is Claude Code only too, while [resurrect](/docs/resurrect-shards/) reopens Codex and Antigravity conversations as well.

## Go deeper

- [history navigator](/docs/conversation-history/) for the navigator, the CLI flags, and what's stored.
- [resurrecting shards](/docs/resurrect-shards/) for undo-close and deferred relaunch.
- [Settings → Storage](/docs/conversation-history/#whats-stored-and-deleting-it) to see or delete the index.

---
Source: https://crystl.dev/docs/scenario-recover-lost-context/
