SSH & remote sessions
Full-fidelity SSH sessions — and turning one into a remote agent.
SSH in Mel works like any terminal, and one keystroke (Ctrl+Enter) turns the session into an agent whose tools run on the remote machine, with nothing installed there. Type ssh user@host and you get a real interactive remote shell — password or key auth, full keyboard, full-screen TUIs — rendered live in the pane.
SSH as a live session
When Mel detects ssh (like other interactive CLIs — vim, top, and coding agents such as claude and codex), the pane switches to a live terminal grid: a full terminal emulator with alt-screen, cursor addressing, scroll regions, and 256-color support, with TERM=xterm-256color set. When the session ends, it collapses into a finished block holding the final screen, right in your scrollback.
Keyboard fidelity
Remote TUIs need exact bytes, and Mel takes this seriously:
- ctrl+C and ctrl+X are forwarded as real control bytes (0x03/0x18) — this is how remote programs expect to be interrupted.
- shift+tab sends the reverse-tab sequence; arrow keys honor the terminal's cursor-key mode.
- Pastes are wrapped in bracketed paste when the remote program enables it.
- Terminal status queries (cursor position, device attributes) are answered so full-screen apps don't stall.
- Mel's single-modifier global shortcuts are suspended while a TUI is active, so your keys go to the remote program, not to Mel.
Melt into a remote agent
Press Ctrl+Enter (⌘Enter on macOS) inside an SSH session and Mel melts it into an agent conversation targeting the remote host. The landing reads user@host:~, and from there the agent's tools — read_file, list_dir, grep, find_files, run_command, write_file, edit_file — all execute over the existing ssh connection details, invoked as ssh target -- <cmd>. Nothing is installed on the remote machine.
That means "find where this service logs errors and fix the config" works against a server the same way it works locally: the agent reads remote files, proposes edits, and runs remote commands — with the same approval cards as local work. Web search and plan-writing tools work in remote conversations too.
An agent working over SSH reuses one connection, so its steps run quickly. Background commands are not available over SSH: the agent is told so, rather than having a job run on your own computer by mistake.
You can turn the melt behaviour off with Settings → Melt → Melt SSH sessions if you'd rather Ctrl+Enter do nothing in SSH sessions. The same page holds two lists of command patterns: Added commands always open full screen, and Denylisted commands never do.
What works over SSH
| Feature | Over SSH |
|---|---|
Full interactive remote shell, full-screen programs (vim, htop, tmux) | ✓ |
Password and key sign-in, your ~/.ssh/config | ✓ (it is your own ssh) |
| Blocks for each remote command | ✗ The session is one live terminal; it becomes one block when you exit |
| Chips, ghost autocomplete, block filtering | ✗ Inside the session. They work again in your local shell |
| Agent reads, lists, searches and edits remote files | ✓ Over your ssh connection |
| Agent runs remote commands | ✓ With the same approvals as local work, except that a read-only command asks too |
A time limit (timeout_ms) on a remote command | ✗ Not applied; the agent is told |
| Background jobs | ✗ The agent runs commands normally instead |
create_pdf, pictures from commands | ✗ They run only on your computer |
| Web search and reading pages | ✓ They run on Mel's server, as always |
| Plans, tasks, approvals | ✓ |
Keyboard shortcuts
| Action | Windows and Linux | Mac |
|---|---|---|
| Melt the SSH session into a remote agent | Ctrl+Enter | ⌘↵ |
| Interrupt the remote program | Ctrl+C | ⌃C |
FAQ
How do I use an AI agent on a remote server over SSH? ssh to the server in Mel, then press Ctrl+Enter (⌘↵ on a Mac). The agent's file and command tools run on that server through your connection.
Do I need to install anything on the server? No. Mel uses your own ssh and the commands already there.
Does my code leave the server? What the agent reads goes to the model to answer you, as with local work. Secrets in tool results are masked first. See Security & privacy.
Related
- Sessions — how sessions and scrollback behave
- Environment — what local commands see
- Input and the prompt — starting local agent conversations