---
title: "Restore Claude Code after a reboot with tmux-resurrect"
description: "After a reboot, tmux-resurrect brings back your tmux windows and hoptail restore resumes each Claude Code session in its window. Setup and fixes."
url: https://hoptail.app/guides/restore-agents-after-reboot
updated: 2026-10-25
---

# How to bring your Claude Code agents back after a reboot

Last updated 25 October 2026

## Short answer

A reboot closes tmux and every agent running in it. tmux-resurrect and tmux-continuum bring back your tmux sessions, windows and folders. Hoptail remembers which Claude Code session ran in each window, and `hoptail restore` resumes each one there with `claude --resume`. Your agents come back to their conversations and wait for you, on a Mac or a Linux machine.

## What a reboot takes away.

Claude Code runs inside tmux, and when your computer restarts, tmux goes with it. The conversations are still on disk, and `claude --resume` can open any of them. The hard part is remembering which session ran in which window, in which folder, with which model and permission mode, for every agent you had open.

## Who brings back what.

- ### tmux-resurrect.

  Saves your tmux sessions, windows and panes with their folders, and restores them. It can also restore what was on screen.
- ### tmux-continuum.

  Saves for tmux-resurrect every 15 minutes and restores the last save when tmux starts.
- ### Hoptail.

  Remembers each Claude Code agent in tmux: its window and pane, folder, session id, model and permission mode. `hoptail restore` starts it again in the same place with `claude --resume`.

tmux-resurrect and tmux-continuum are open-source tmux plugins, not part of Hoptail. Checked on 25 October 2026.

## Set it up

1. Install Hoptail 0.1.10 or later on your Mac or Linux machine and run setup. Already have it? Run `brew upgrade hoptail`, or install the new archive on Linux. Hoptail remembers an agent once it starts or finishes a turn.

   ```
   brew install hoptail-app/tap/hoptail
   hoptail setup
   ```
2. Add tmux-resurrect and tmux-continuum to `~/.tmux.conf` with [TPM](https://github.com/tmux-plugins/tpm), the tmux plugin manager, then press prefix + I in tmux to install them. If a theme sets your status line, keep tmux-continuum last in the list.

   ```
   set -g @plugin 'tmux-plugins/tmux-resurrect'
   set -g @plugin 'tmux-plugins/tmux-continuum'
   set -g @continuum-restore 'on'
   ```
3. Have tmux-resurrect run `hoptail restore` when it finishes. Use the full path that `command -v hoptail` prints: the hook doesn’t see the `PATH` from your shell profile. It’s `/opt/homebrew/bin/hoptail` on a Mac, `/home/linuxbrew/.linuxbrew/bin/hoptail` with Homebrew on Linux, and `/home/<you>/.local/bin/hoptail` from the archive.

   ```
   set -g @resurrect-hook-post-restore-all '/opt/homebrew/bin/hoptail restore'
   ```
4. Take `claude` out of `@resurrect-processes`, if your `~/.tmux.conf` has it there, for example as `~claude->claude --resume`. Otherwise tmux-resurrect starts `claude --resume` without a session id, which opens the session picker, and Hoptail leaves that window alone.
5. Reload the config, then see what Hoptail remembers and what it would start.

   ```
   tmux source-file ~/.tmux.conf
   hoptail restore --list
   hoptail restore --dry-run
   ```

[Full setup guide for Mac →](https://hoptail.app/setup) [For Linux →](https://hoptail.app/setup-linux)

## What happens after a reboot.

When tmux starts, tmux-continuum restores the last saved layout, and tmux-resurrect then runs `hoptail restore`. For each agent it remembers, Hoptail finds the window and pane by their names and numbers. If the pane holds an empty shell, Hoptail types one line there: `cd` to the agent’s folder and `claude --resume` with its session id, model and permission mode. Claude Code opens the conversation and waits, just as after a `claude --resume` of your own. Hoptail types nothing to the agent itself.

`hoptail restore` prints a line for each agent, such as `dev:2: started` or `notes:main: skipped — its session is gone (no transcript)`. Your agents then show up in the Hoptail app on your iPhone as usual. No tmux-resurrect? Run `hoptail restore --create` yourself after a reboot: it makes each missing tmux session or window in the agent’s folder. You get your agents back, though not the rest of your layout.

## What it leaves alone.

- **Agents you quit.** Leave an agent with `/exit` and Hoptail forgets it. Closing the pane or the reboot itself doesn’t.
- **Busy panes.** If a pane runs anything other than an empty shell, Hoptail skips it, so the line can’t land in another program. An agent that tmux-resurrect already started is skipped the same way.
- **Agents without permission prompts.** An agent that ran with `--dangerously-skip-permissions` or in `bypassPermissions` mode never starts by itself. Start one in a terminal with `hoptail restore --allow-bypass` and its name, as `hoptail restore --list` shows it. This guards against an accidental start by a script or a hook; it isn’t a security boundary.
- **Sessions you exclude.** Add a `restoreOff` list of tmux sessions or agent names to Hoptail’s `config.json`, for example `"restoreOff": ["scratch", "dev:experiments"]`. The file is in `~/Library/Application Support/Hoptail` on a Mac and `~/.config/hoptail` on Linux.
- **Other flags.** Hoptail brings back the model and the permission mode. A first prompt, an MCP config and other flags aren’t carried over.

## Troubleshooting

- **An agent didn’t come back?** Run `hoptail restore --dry-run`: it shows each agent and why it would be skipped.
- **The windows came back, the agents didn’t?** Check the path in the hook against `command -v hoptail`.
- **The session picker opened instead of the conversation?** `claude` is still in `@resurrect-processes`. Take it out, as in step 4.
- **The list is empty?** Hoptail notes an agent when it starts or finishes a turn. Check that Hoptail is running and its hooks are in place with `hoptail status`.

## FAQ

### Do I need tmux-resurrect?

No, but it saves you work. Without it, run `hoptail restore --create` after a reboot and Hoptail makes the missing tmux sessions and windows for your agents.

### Does it type into my agents?

No. It types one line into an empty shell, the same `claude --resume` you’d type yourself. The agent opens its conversation and waits for you.

### Does it work with Codex?

Not yet. Today Hoptail remembers Claude Code agents.

## Try it on your own agents.

[Join the beta on TestFlight](https://testflight.apple.com/join/HDr5YEtZ) [Set up your Mac](https://hoptail.app/setup)

On Linux? [Set up a server →](https://hoptail.app/setup-linux)

---

Hoptail is made by Dmitrii Emelianov PR Računarsko programiranje Novi Sad, a sole proprietorship registered in Serbia (APR registration no. 67225627, tax ID 113970406), Novi Sad, Serbia. Contact: [feedback@hoptail.app](mailto:feedback@hoptail.app)

Hoptail isn’t made or endorsed by Anthropic, Apple or Tailscale. Trademarks belong to their owners. [Details](https://hoptail.app/terms#17-trademarks)
