resurrect
Copy pageRestores worktree windows after a tmux or computer crash. Uses persisted agent state files to detect which worktrees had active agents before the crash, then reopens them with each agent’s resume arguments.
workmux resurrect [--dry-run]Options
Section titled “Options”--dry-run: Show what would be restored without actually doing it.
How it works
Section titled “How it works”- Reads agent state files from
~/.local/state/workmux/agents/ - Filters to the current multiplexer backend and instance
- Matches each state file’s working directory to a git worktree in the current repo
- Skips worktrees that are already open, no longer exist, or are the main worktree
- Opens each matched worktree with the resume arguments for the remembered agent
- Uses agent-specific behavior, such as Codex’s resume subcommand with its last-session flag
- Cleans up consumed stale state files
Agent state from known earlier multiplexer boots is compacted to one recovery candidate per exact working directory. Unrestored worktrees remain recoverable across repeated restarts without retaining duplicate records for every boot. Current-boot records, records without a reliable boot identity, malformed files, and state owned by another multiplexer instance or backend are preserved. Each instance compacts its own history when workmux observes that instance with a reliable boot identity.
Examples
Section titled “Examples”# Preview what would be restoredworkmux resurrect --dry-run
# Restore all worktrees that had agents runningworkmux resurrectExample output
Section titled “Example output” continue-flag -> restoring dashboard-fix -> skipping (already open) auth-refactor -> restoring (2 state file(s) from other projects ignored)
✓ Restored 2 worktree(s): continue-flag, auth-refactor