/rex:rex [orient | view <file> | read <block>]from rex
Drives the Rex terminal multiplexer: manages tabs, panes, splits, and hosts. Automatically orients in the current session and handles splits, file viewing, and web page display.
Ships in rex. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Rex hosts this session's tabs and panes. A tab is a window and a pane is a block. For general mechanics (IDs, flags, client actions), run rex __internal skill.
!bun "${CLAUDE_SKILL_DIR}/scripts/orient.ts"
One line per tab, then one per block: ID, label, foreground cwd, and program. *this* marks the block running this session. If it prints a failure instead of a listing, stop here and use ordinary tools.
Default to a sibling split of this pane that leaves focus where it is:
rex split --split=right --focus=false -c <cwd> --json
Rex scopes every command to this session and anchors splits on this pane from REX_BLOCK, which names this pane's block. Rex no longer sets REX_SESSION in new terminals, so take this session's ID from the listing above or rex whoami --json. Write each argument literally: <cwd> is the absolute working directory, and <block> is a block ID. A worktree session refuses a rex command that contains a shell variable. Add -s <session> only to target another session.
Split right on a wide pane and below on a tall one, alternating direction across successive splits. A new tab, session, or host needs the user to ask for it. Take the new block from .block_ids[0].
Close a block with rex block close <block>, and only blocks you opened. A pane you split for the user to read counts as theirs.
Open the file beside this pane so the user watches it change. Use markless --watch for markdown and $EDITOR for everything else:
rex split --split=right --ratio 40 --focus=false -c <cwd> --json -- markless --watch path/to/file.md
Confirm the viewer started before telling the user to look at it:
rex capture -b <block> --trim --unwrap
Show a web page, a local dev server, or rendered HTML beside this pane with terminal-browser:
terminal-browser open <url|port|file.html> --split right
It splits this pane from REX_BLOCK, or opens a new tab when a browser pane already sits beside it. To drive the page, load the terminal-browser skill.
Put a dev server, log tail, build, or REPL the user should watch in a sibling split instead of run_in_background:
rex split --split=below --ratio 30 --focus=false -c <cwd> --json -- bun run dev
Reserve run_in_background for work the user has no reason to see. rex wait <block> --for 120s blocks until the process exits and returns its status. To wait for a line of output, run a Monitor until-loop over rex capture.
Read with rex capture -b <block> --trim --unwrap. A block ID lasts only as long as its pane, so take IDs from the listing above or a fresh rex block ls.
The ❯ line at the bottom of a Claude pane shows Claude Code's own prompt suggestion, ghost text the harness wrote rather than input the user typed. Take a pane's content from above that line and leave the line out of what you report.
Move a tab to another session with rex window move <window> --to <session>. Its panes keep running with their scrollback. Move a tab you opened, or one the user asks you to move. A pane moves with its tab.
Keep at most 4 tiled panes visible in a tab. Float an extra pane, then minimize its layer:
rex api call -s <session> session.float_block '{"block_id":"<block>","bounds":[0.2,0.15,0.6,0.7]}'
rex api call -s <session> session.set_layer_state '{"layer_id":"<layer_id>","state":"minimized"}'
Take <layer_id> from the first call's layer_id.
Put -S <label> on every command that touches a saved host. Commands run on that machine, so paths and programs must exist there. When a command fails to connect, report "host <label> is unreachable".
Run a one-off command on a saved host through Rex rather than ssh, then read its output and close the block:
rex -S <label> run --wait --keep-open --focus=false -c <cwd> --json -- <command>
rex -S <label> capture -b <block> --trim --unwrap
After starting a server on another host, open it on this machine with rex -S <label> forward open <block>. Rex forwards a local port to the port the server's terminal listens on and opens the URL.
When more than one Rex app is connected, client actions such as rex do need -C <client>, a label from rex client ls.
Talk to Claude sessions with SendMessage and ListAgents. Use rex send and rex send-key only for non-Claude programs and for keys the user asked for. Read another session's approval dialog and hand it to the user, who answers it.
worktrunk:wt-switch-create re-roots this session. New PR-bound work goes to dispatch:dispatch, which defaults to Rex when run inside Rex.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub bendrucker/claude --plugin rexOther plugins' skills for the same job