How-to guides How-to guide

Recover orphaned sessions

Find and reattach (or kill) durable sessions that were left running with nothing attached.

Because Muxie sessions are durable, a session can survive even when nothing is attached to it. After a crash or a clobbered window, that leaves a session running on its own — an orphan.

How orphans are cleaned up

Muxie garbage-collects orphans after a grace period set by orphanReapGraceMs:

  • The default is 1 hour.
  • Set it to 0 to turn reaping off entirely.

Reaping is deliberately conservative, so closing the app normally never reaps a session — only sessions that are truly orphaned past the grace period are reaped.

Note: If you keep long-lived sessions you reattach to infrequently, consider raising orphanReapGraceMs or setting it to 0.

Recover or kill orphans by hand

To deal with orphans yourself:

  1. Open the command palette with Ctrl+P.
  2. Run Recover Orphan Sessions (the recover-orphan-sessions action).

A modal lists the orphaned sessions and offers a reattach or kill action for each one. Reattach to pick the session back up, or kill it to free its resources.

For background on why sessions outlive their windows, see Durable sessions.