> ## Documentation Index
> Fetch the complete documentation index at: https://rakumux.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Restarts and recovery

> What survives a server restart, a crash or a reboot, and how sessions come back.

Sessions run in the background server, `rakumux-ptyd`, so what happens to them depends on how that
server stops.

| Event | Running programs | How sessions come back |
| - | - | - |
| **Restart in place**: `rakumux daemon restart`, `S` in Rakumux mode, **Settings → Restart server**, `rakumux --new-server` | Keep running, with the same process ids | Nothing to do. The new server takes over the terminals, screens and history, windows reconnect, and a window in session mode goes back in. |
| **Crash, reboot**, `kill -9` or `SIGTERM` | End | The next server start revives every session that was running, each with its resume command. |
| **`rakumux daemon stop`** | End | Not revived, since you ended them. They show as dead; `Enter` revives one. |

## Resume commands

While a session runs, Rakumux keeps track of how to bring it back:

* **Claude Code** resumes the same conversation (`claude --resume <id>`), with the flags it was
  started with, such as its permission mode and model.
* **Codex** resumes the same thread (`codex resume <id>`).
* **OpenCode** resumes the same session (`opencode -s <id>`, or `opencode2` when started under that
  name).
* **Any other program** has its last command typed at the prompt on revive, but not run, so you can
  check it first. A shell that's been back at its prompt for 15 seconds clears it.
* **Startup commands** you gave the session always run again.

An agent can also report its own resume command with `rakumux session report --resume -- PROGRAM ARGS`.

## Replacing the server

`rakumux --new-server` replaces the running server with the one from the Rakumux you're running,
in place when it can, then opens the UI. When an older server can't restart in place, Rakumux asks
before stopping it, since stopping ends every session.

After an update, the UI can tell when the running server lacks features this version shows, and
offers a restart: in place when the server supports it (sessions keep running), otherwise by stopping
it.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.