Beating AI News Flash: Ghostty founder Mitchell Hashimoto's new terminal tools Rex and Herdr have jointly introduced an open terminal protocol OSC 7577, enabling terminal programs to automatically restore sessions after a service or computer restart.
Previously, even with tools like tmux keeping multiple AI Agents running continuously in the background, once the computer restarted, all original processes would exit. Restoring terminal windows and layouts was relatively easy, but recovering each Agent's original session was far more troublesome.
The idea behind OSC 7577 is simple: let programs themselves tell the terminal how to restore. For example, Claude Code can inform the terminal in advance of the restore command, session ID, and working directory. After a computer restart, the terminal automatically relaunches Claude Code and resumes the previous session.
This protocol is not limited to AI Agents; ordinary terminal programs such as Neovim can also integrate. As long as both the program and the terminal support the protocol, there is no need to write separate adaptation code for each tool.
Previously, the terminal tool Otty had proposed a similar OSC 88 protocol. OSC 7577 further introduces key verification and timestamps to reduce the risk of malicious programs forging restore instructions. Users can also specify in Rex which programs are allowed to auto-restore.
Currently, Rex has built-in restore support for Claude Code and has preset trust rules for Codex and OpenCode, though the latter two have not yet integrated the protocol. Herdr will provide support in its next update, and Pi has also begun adaptation.
