/session:session-move [destination-session] [--window <label|id> --session <label|id>]from session
Move a Rex window (a tab in the Rex app) from one Rex session to another on the same computer. Rex cannot move a window between sessions, so this recreates it in the destination with the same agent (Claude Code, Codex, Muse, Antigravity, or borg1), the same conversation resumed by ID, the same working directory, and the same window name, then closes the old window. Use when the user says "move this window to <session>", "move this tab to another session", "session move", or wants a running agent conversation relocated between Rex sessions. Not for launching a new side idea in a fresh agent (session-spinoff), continuing work in a new conversation or on another machine (session-handoff), copying a conversation into a new worktree (agent-fork), or general Rex tab and session control (rex).
Ships in session. 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.
Relocate a running agent conversation from one Rex session to another. Rex has
no command for this (rex window move only reorders windows inside one
session), so the move is a recreation: a new window in the destination session
resumes the same conversation, and the old window closes.
ONE CONVERSATION, ONE LIVE COPY. Two agents resumed on the same conversation ID both append to one transcript, and the copy that loaded first never sees the other's turns. The new window therefore waits, the old agent stops, and only then does the new window resume. If the old agent does not exit, nothing resumes.
agy), or borg1. Anything else is refused with the reason.--fork-session, which makes a different
conversation), the working directory, and the window name. A name Rex
generated itself (Window 1a2b3c4d) is not copied; Rex names the new window.scripts/session-move reads Rex and the
agents, applies the refusal rules, builds the launch command, and checks the
result. Do not hand-write rex … -- claude --resume ….--shell=none -- "$SHELL" -ilc '"$@"; exec "$0" -il' "$SHELL" …, the same
launch form session-spinoff uses, so quitting the agent leaves a prompt
instead of closing the tab. When $SHELL is not zsh, bash, sh, dash, or
ksh (fish and tcsh reject that wrapper), the helper uses /bin/zsh.scripts/session-move lives beside this file. Resolve it through the real path
so it works from a symlinked placement:
MOVE="$(dirname "$(realpath "<skill-dir>/SKILL.md")")/scripts/session-move"
T="$(mktemp -d)"; echo "MOVE=$MOVE"; echo "T=$T"
Shell variables do not survive between tool calls, so use the two printed
paths literally wherever $MOVE and $T appear below.
Run it as uv run --script "$MOVE" <verb> ... (stdlib only, Python ≥ 3.11).
Each verb prints JSON; a refusal prints one line to stderr and exits 2. The
commands below save each result for the next verb and print it with the exit
code. The
helper finds Codex, Muse, Antigravity, and borg1 conversations through the sibling
../session-agent-list/scripts/session-inventory (or $ANTIGRAVITY_CONVERSATION_ID
for an Antigravity self-move, $BORG1_SESSION_ID for a borg1 self-move); if that file is missing it
says so in the refusal.
--session and --window.rex session list --json, state the session labels in one line of
visible text, and ask one question immediately after it: up to three
existing sessions (not the source session) plus "New session", whose name
the user types.uv run --script "$MOVE" plan --to "<destination>" > "$T/plan.json"; echo "exit=$?"; cat "$T/plan.json"
# another window: plan --to "<destination>" --session "<S>" --window "<W>"
destination.exists is false and destination.near is not empty: the
name is close to an existing session. Ask whether to use that session or
create the new one. If the user picks the existing session, run plan
again with that session as --to, so plan.json names it. The saved plan
still says "create a new session", and arm does what the plan says.destination.exists is false and near is empty: say the session will
be created. Do not ask.Then state the move in one line: window name, agent, the first eight
characters of conversation_id, cwd, source session, destination session.
If self is true and this agent has background shells, subagents, or scheduled
wakeups running, they end when the window closes. Say which, and ask once
whether to move anyway.
uv run --script "$MOVE" arm < "$T/plan.json" > "$T/armed.json"; echo "exit=$?"; cat "$T/armed.json"
This creates the destination window (and the session, when new). The window
runs the helper's handoff, which waits. Nothing has changed in the source
window yet.
armed true: the handoff is waiting on the same computer, in the
same directory, under the same window name.checks and report which one is false. The helper already
removed the new window (and a session it had just created). Stop.To cancel after this point, run uv run --script "$MOVE" abort < "$T/armed.json".
It removes the waiting window. It refuses once go has run: release and abort
act on one marker file, so only one of them can succeed. Run arm once per
move; if two windows are armed for one source and both are released, only the
first resumes and the other says so and stays at a shell prompt.
Moving another window:
uv run --script "$MOVE" go --wait < "$T/armed.json"; echo "exit=$?"
The handoff closes the old window, waits for the old agent to exit, and resumes
the conversation. go --wait returns when the destination window runs the
agent. Report:
| Field | Meaning |
|---|---|
resumed | The destination window runs the same agent. |
same_conversation | true: the agent's own record shows the same conversation ID (Claude Code, Muse, Antigravity, and borg1). null: Codex keeps no such record, so only the process was checked. false: a different conversation; say so plainly. |
old_window_closed | true: the source window is gone. null: Rex could not list the source session, so it is unknown; say so. |
jump | The command that switches the Rex app to the new window. Print it and offer to run it. It names the app with -C when exactly one is connected; with several, ask which device. |
If source.only_window was true in the plan, add that the source session is
now empty and was left in place. On exit 3, report the fields and tell the user
to look at the destination window: it shows the helper's last message and, if
the resume command failed, a shell prompt with that command printed above it.
Self-move:
uv run --script "$MOVE" go < "$T/armed.json"
Then write the final message and stop. Make no further tool calls.
Moving this conversation to session "". This tab closes when this message ends, and the conversation continues there.
The handoff waits for this turn to end, closes this window, and resumes the
conversation in the destination. It then tries to switch the Rex app to the new
tab: it does so only when exactly one Rex app is connected, and the app may
refuse (its Remote Control setting). Otherwise the user opens the destination
session themselves. A long final message delays the move, and anything after
go that keeps the turn running delays it too.
| The helper says | Tell the user |
|---|---|
runs on a different computer | Moving across computers is out of scope. Suggest session-handoff for continuing elsewhere. |
cannot confirm the window runs on this computer | Rex reported no host for the pane. Nothing was changed. |
has N panes | Only a single-pane window can move. |
not running Claude Code, Codex, Muse, Antigravity, or borg1 | Name the foreground program the helper reported. |
cannot tell which … conversation | Relay the detail. For several live Codex conversations in one directory (or a bare agy session without --conversation), rerun plan with --conversation <id> once the user picks one. |
not idle (status: busy) | The other agent is mid-turn. Wait or ask the user. |
background shell running | The move would end that shell. Ask the user. |
transcript changed Ns ago | The transcript has no turn records, so the helper used six quiet seconds; wait and plan again. |
is mid-turn | The other agent's transcript shows an unfinished turn. Wait or ask the user. |
point at another window | This terminal's Rex IDs name a different conversation's window. Ask the user which window to move and pass --session and --window. |
no Rex window runs conversation | Under Codex, no tab on this computer runs this conversation. Ask for --session and --window. |
already in that session | Nothing to do. |
could not list the windows | Rex did not answer. Nothing was changed; try again. |
not a private directory owned by this user | The helper's marker directory under the temp directory has the wrong owner or permissions. Relay the path; the user removes it. |
no longer armed | go ran after an abort or a failed arm. Plan and arm again. |
already released | abort ran after go. The move is in progress or done; do not close the destination window. |
N sessions are labelled … | Ask which one and pass its session ID. |
claude --resume <id>, codex resume <id>, muse resume <id>,
agy --conversation <id>, or borg1 --resume <id>. A model,
permission mode, or other flag given when the old agent started is not
repeated.task_complete, Muse's run terminal, Antigravity
PLANNER_RESPONSE with status: "DONE" and no tool_calls, borg1
turn_ended), which Muse writes
only after reviewing its answer. Only a transcript with no turn records falls
back to six quiet seconds.REX_SESSION and REX_BLOCK from its shared app-server. The helper ignores
them under Codex and finds the tab by CODEX_THREAD_ID. Do not use
$REX_SESSION or $REX_BLOCK yourself under Codex.| Thought | Reality |
|---|---|
| "Start the new one first, check it, then close the old one" | That is two live copies on one transcript. The new window waits; the helper enforces the order. |
"--fork-session avoids the conflict" | It creates a different conversation ID. The user asked for the same conversation. |
"I'll close my own window with rex window close" | That kills this agent mid-tool-call and the resumed conversation shows an interrupted turn. Run go and end the turn. |
"I'll launch rex window new … -- claude --resume <id> myself" | That tab closes when the agent exits and skips every check. Use arm. |
| "The window opened, so the move worked" | Read resumed and same_conversation from go --wait. |
| "An update or trust prompt is blocking the new window, I'll press Enter" | Those are the user's decisions. Report the prompt. |
session-spinoff — starts a new agent on a side idea in a Rex tab; it
never moves an existing conversation.session-handoff — continues the work in a new conversation, including on
another computer.session-agent-list — lists agent conversations and their resume commands.agent-fork — copies this conversation into a new worktree (not yet available
for Antigravity agy — use session-handoff or session-spinoff instead).rex — the full Rex CLI guide (rex skill show).What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub smorinlabs/smorinlabs-skills --plugin session8 skills in this plugin
/session-agent-listList Claude Code, Codex, Muse, OpenCode, Antigravity (agy), and borg1 sessions on this machine as action-ready cards with resume commands, filterable by tool and by what is running now. Use when the user asks to list, find, or resume a past session, which sessions touched a repo, or which sessions are in use. Not for a saved HTML project/session map or its incremental updates (session-map), or orienting inside the current session (session-recap)./session-handoffPackage the current session into a self-contained handoff that a fresh session, possibly on another machine, can act on cold. Use when the user says "hand this off", "write a handoff", or wants to continue this work in a new session or on another machine. Not for recapping the current session (session-recap), launching a side idea in a new Rex tab (session-spinoff), or moving this same conversation to another Rex session (session-move)./session-loose-endsSweep the session for loose ends such as uncommitted or unpushed work, stale worktrees, zombie background jobs, unkept promises, and tracking drift. Reports each with a recommendation and cleans up only what the user approves. Use when the user asks "any loose ends?", "anything to clean up?", or "tie this off". Not for a full recap (session-recap) or for cleaning up objects registered in brot (brot)./session-mapBuild and maintain a saved HTML map of projects and agent sessions, showing related work, current owners, progress, closure candidates, and copyable tab-navigation commands. Use for "map my sessions", "build a project and session dashboard", "update the session map", or "regenerate the map from its inventory". Supports full inventory, incremental updates, and rendering saved data. Not for a quick session listing (session-agent-list), orientation inside one conversation (session-recap), or executing cleanup (session-loose-ends)./session-recapOrient in a session that was left idle, compacted, or reopened cold, covering what it is about, done versus open, live git and PR state, and ranked next steps. Use when the user asks "catch me up", "where was I", or "what was I doing", or returns to a repo unsure where things stand. Not for mid-flight progress of active work (session-status) or cleanup (session-loose-ends)./session-spinoffSpin an idea that came up mid-session (a bug, feature, or fix, often in another repo) off into a fresh Claude Code, Codex, Muse, Antigravity (agy), or borg1 agent in a Rex tab, on a new worktree, with a self-contained brief as its first prompt, monitoring kickoff in Rex to clear early trust and permission blockers so the current session keeps its focus and context. Use when the user says "spin this off", "launch this in Rex", "start a new session for this in <repo>", or wants a side idea worked on separately. Not for continuing the current work elsewhere (session-handoff), forking this conversation (agent-fork), moving a running conversation to another Rex session (session-move), or general Rex tab and session control (rex).