Rex and Herdr launch a terminal recovery protocol, bringing AI coding sessions back after a reboot

Rex, a new terminal tool from Ghostty founder Mitchell Hashimoto, and Herdr have jointly launched OSC 7577, an open terminal protocol that lets terminal apps automatically restore sessions after a service or computer restarts.

Previously, even if tools like tmux kept multiple AI agents running in the background, restarting your computer would terminate all the processes. Restoring terminal windows and layouts is relatively easy, but bringing back each agent’s original session is much harder.

OSC 7577 takes a simple approach: apps tell the terminal how to restore them. For example, Claude Code can provide the terminal with a recovery command, session ID, and working directory in advance. After a computer restarts, the terminal automatically relaunches Claude Code and resumes the previous session.

The protocol isn’t limited to AI agents; regular terminal apps like Neovim can also adopt it. As long as an app and terminal both support the protocol, there’s no need to write custom integrations for each tool.

Terminal tool Otty previously proposed a similar protocol, OSC 88. OSC 7577 adds key verification and timestamps to reduce the risk of malicious apps forging recovery instructions. Users can also specify which apps are allowed to restore automatically in Rex.

Rex already includes recovery support for Claude Code and has preset trust rules for Codex and OpenCode, though the latter two have yet to adopt the protocol. Herdr will add support in its next update, and Pi has also begun adapting to it.

$ANT

What do you think? 👇