| name | recover-after-reboot |
| description | Use when asked to recover after a reboot, restart, OS update, lost tmux sessions, dead Codex agents, reboot-backup restore, tmux relaunch, corrupt git index repair, or stranded local commits from pre-reboot agents. |
Recover After Reboot
Overview
Restore a pre-reboot multi-agent workspace from a reboot backup, usually ~/tmp/reboot-backup: recreate tmux layout, recover repos, relaunch agents with pane context, then remove any temporary recovery block.
Workflow
-
Read local instructions first:
- Open the workspace
AGENTS.md or equivalent agent instruction file and follow any recovery block.
- Open
~/tmp/reboot-backup/REBOOT-INSTRUCTIONS.md if it exists.
- Inspect
tmux-sessions.txt, tmux-windows.txt, tmux-panes.txt, and pane-*.txt.
-
Inventory current state before changing it:
tmux list-sessions
tmux list-windows -a -F '#{session_name}:#{window_index}:#{window_name}:#{pane_current_path}'
- For repo repairs, locate actual checkouts with
find <workspace-root> -path '*/.git' -type d -prune.
- Do not kill an existing live session unless the recovery instructions explicitly require it.
-
Recreate missing tmux sessions/windows:
- Prefer the exact reconstruction script in
REBOOT-INSTRUCTIONS.md.
- If a session already exists, skip or reconcile it; avoid duplicate names.
- Verify with
tmux list-sessions.
-
Repair repos from safest to riskiest:
- Start with
git status --short --branch, git remote -v, and git branch --show-current.
- If only
.git/index is corrupt, try the instruction-provided index rebuild.
- If objects/trees are missing, move the checkout aside as
<repo>.corrupt-YYYYMMDD-HHMMSS, fresh-clone the remote at the original path, overlay the matching *-working-tree.tar.gz, then git add -A.
- Commit recovered changes with
chore: checkpoint before OS update [auto].
- Run
git pull --rebase, then git push.
- If GitHub rejects a file over 100 MB and
git lfs version works, git lfs track <file>, amend, and push again.
- If push fails with permission denied, create/use a writable fork, add a
fork remote, push there, and set local upstream to fork/main. Report the original upstream remains blocked.
-
Relaunch agents:
- For each
pane-*.txt, map it to session:window.pane and cwd using tmux-panes.txt.
- Start Codex in that pane with a prompt that tells the agent to read its captured pane file, check current git state, avoid conflicts, and resume only if the captured work is still actionable.
- Leave windows with no captured pane file as shells unless the instructions say otherwise.
- Verify with
tmux list-panes -a -F '#{session_name}:#{window_index}.#{pane_index} #{pane_current_command} #{pane_current_path}'.
-
Clean the recovery marker:
- After sessions are restored, repos are pushed or fork-pushed, and agents are relaunched, remove the recovery block from the workspace
AGENTS.md or equivalent instruction file.
- Before committing, check whether that file is tracked in the relevant repo. Do not add the whole workspace
AGENTS.md to an unrelated parent repo.
Relaunch Prompt
Use this shape for each pane:
Post-reboot recovery relaunch. First read the captured pane context at <pane-file>; it contains the last screen from your pre-reboot session. Resume the user's latest task from that capture if it is still actionable. Start by checking current repo/git state and avoid conflicting with other relaunched agents. If the capture shows the work was complete or only a slash-command request, summarize the recovered state and wait for Braydon's next instruction. Do not redo unrelated work.
Validation
Before reporting done, verify:
- All expected sessions from
tmux-sessions.txt or REBOOT-INSTRUCTIONS.md exist.
- Every captured
pane-*.txt has a corresponding live Codex pane or a clearly explained exception.
- Repaired repos show clean
git status --short --branch and are up to date with their writable upstream.
- Any oversized recovered files are handled with LFS or explicitly left in the preserved corrupt checkout.
- The AGENTS recovery block is gone.