/session-teleport:remote <launch|pull|list|check|doctor> [cluster] [args]from session-teleport
Session Teleport for Claude Code. Launch the active Claude session on a remote machine, check it, pull it back locally, and troubleshoot the handoff over SSH, SCP, and tmux.
Ships in session-teleport. 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.
None: SKILL.md is the whole skill.
Move an active Claude Code workflow between machines without restarting from scratch.
This skill treats a Claude session as a bundle:
~/.claude/projects/<project-slug>/<session-id>.jsonl~/.claude/projects/<project-slug>/<session-id>/Teleport works by copying that bundle to another machine, resuming it there with
claude --resume <session-id> --fork-session, and recording enough metadata to
pull the resulting fork back later.
Resolve the cluster registry in this order:
.claude/remote-clusters.json in the current project~/.config/session-teleport/clusters.jsonWrite launch history to .claude/remote-sessions.json in the current project.
Create the file on first use if it does not exist.
Each cluster entry should look like:
{
"my-gpu-server": {
"ssh_alias": "gpu-server",
"repo_base": "/home/username/repos",
"claude_projects": "/home/username/.claude/projects",
"project_slug": "auto",
"default_cwd": "/home/username/repos/my-project"
}
}
Fields:
ssh_alias: required SSH host aliasclaude_projects: required remote ~/.claude/projects rootdefault_cwd: required remote repo path to run Claude fromproject_slug: optional. Use "auto" to derive the slug from default_cwdrepo_base: optional documentation/convenience field for human readersnotes: optional freeform notesBefore any subcommand, compute:
LOCAL_CWD: pwd -PLOCAL_PROJECT_SLUG: resolved local cwd with / replaced by -LOCAL_PROJECTS: $HOME/.claude/projects/<LOCAL_PROJECT_SLUG>STATE_FILE: .claude/remote-sessions.json in the current projectFor the selected cluster, compute:
REMOTE_PROJECT_SLUG: explicit project_slug, or if it is "auto", derive it from default_cwd using the same / to - ruleREMOTE_DEST: <claude_projects>/<REMOTE_PROJECT_SLUG>Use Python for slug generation and JSON reads/writes when practical. A portable slug helper is:
python3 - <<'PY'
import pathlib
print(str(pathlib.Path.cwd().resolve()).replace("/", "-"))
PY
When reading cluster config, fail with a clear error if the registry is missing, the cluster is not found, or required fields are absent.
Parse the first argument as one of:
launch <cluster> "<task>" - teleport the current local session to the remote machine and start it in tmuxpull <cluster> [session-id] - pull a remote forked session back to local storagelist [cluster] - inspect configured machines and recent session artifactscheck <cluster> [session-id] - inspect one launched sessiondoctor [cluster] - run health checks and surface portability issues/remote list [cluster]If no cluster is provided, iterate over every configured cluster.
For each cluster:
REMOTE_PROJECT_SLUG plus REMOTE_DEST.ssh -o ConnectTimeout=5 <ssh_alias> echo ok 2>&1
ssh <ssh_alias> "tmux list-sessions 2>/dev/null"
ssh <ssh_alias> "ls -lt <REMOTE_DEST>/*.jsonl 2>/dev/null | head -10"
ssh <ssh_alias> "pgrep -a -f 'claude.*resume' 2>/dev/null || echo 'No active Claude processes'"
/remote launch <cluster> "<task>"Teleport the current local session to a remote machine and continue it there.
Read the cluster registry, select the requested cluster, and compute:
LOCAL_CWDLOCAL_PROJECT_SLUGLOCAL_PROJECTSSTATE_FILEREMOTE_PROJECT_SLUGREMOTE_DESTREMOTE_CWD from default_cwdFail fast on missing prerequisites:
ssh -o ConnectTimeout=5 <ssh_alias> echo ok
ssh <ssh_alias> "claude --version 2>&1"
CLAUDECODE=1 claude --version 2>&1
ssh <ssh_alias> "claude --help 2>&1 | grep -q -- '--fork-session'"
ssh <ssh_alias> "which tmux"
ssh <ssh_alias> "test -d <REMOTE_CWD> && echo ok || echo MISSING"
ssh <ssh_alias> "mkdir -p '<REMOTE_DEST>'"
Compare local and remote Claude versions. Warn on mismatches, especially if the remote version is older.
Detect whether the remote CLI advertises --rc:
ssh <ssh_alias> "claude --help 2>&1 | grep -q -- '--rc'"
Only append --rc if that check passes. Otherwise tell the user to run /rc manually after attaching.
Find the newest session bundle in LOCAL_PROJECTS:
ls -t "<LOCAL_PROJECTS>"/*.jsonl | head -1
Extract:
SID: filename stemBUNDLE_FILE: <LOCAL_PROJECTS>/<SID>.jsonlBUNDLE_DIR: <LOCAL_PROJECTS>/<SID>/If no local session exists for the current project, stop and explain that the user needs an existing Claude session in this repo first.
Report what will be copied:
ls -lh "<BUNDLE_FILE>"
du -sh "<BUNDLE_DIR>" 2>/dev/null || echo "No sibling directory"
Copy both the JSONL log and the sibling directory when present:
scp "<BUNDLE_FILE>" <ssh_alias>:"<REMOTE_DEST>/<SID>.jsonl"
if [ -d "<BUNDLE_DIR>" ]; then
scp -r "<BUNDLE_DIR>" <ssh_alias>:"<REMOTE_DEST>/"
fi
Use a short, stable tmux session name:
SHORT_SID="<first 8 chars of SID>"
TMUX_NAME="teleport-${SHORT_SID}"
Launch:
ssh <ssh_alias> "tmux new-session -d -s <TMUX_NAME> \
'cd <REMOTE_CWD> && claude --resume <SID> --fork-session --dangerously-skip-permissions <OPTIONAL_RC_FLAG>'"
Then verify:
sleep 3
ssh <ssh_alias> "tmux has-session -t <TMUX_NAME> 2>&1 && echo RUNNING || echo FAILED"
Update .claude/remote-sessions.json with Python. Create the file if needed and append a launch entry like:
{
"launches": [
{
"timestamp": "<ISO datetime>",
"source_session": "<SID>",
"cluster": "<cluster>",
"ssh_alias": "<ssh_alias>",
"tmux_session": "<TMUX_NAME>",
"local_project_slug": "<LOCAL_PROJECT_SLUG>",
"remote_project_slug": "<REMOTE_PROJECT_SLUG>",
"remote_project_path": "<REMOTE_DEST>",
"remote_cwd": "<REMOTE_CWD>",
"status": "launched",
"task": "<task description>"
}
]
}
Include:
--rc was enabled automaticallyssh <ssh_alias> && tmux attach -t <TMUX_NAME>/remote check <cluster>/remote pull <cluster>/remote pull <cluster> [session-id]Pull a remote forked session back to local storage.
If the user passed a session ID, use it.
Otherwise:
.claude/remote-sessions.json"launched" record for the clusterssh <ssh_alias> "ls -t <REMOTE_DEST>/*.jsonl | head -5"
source_sessionEnsure the local project directory exists, then copy the remote JSONL and sibling directory:
mkdir -p "<LOCAL_PROJECTS>"
scp <ssh_alias>:"<REMOTE_DEST>/<REMOTE_SID>.jsonl" "<LOCAL_PROJECTS>/<REMOTE_SID>.jsonl"
if ssh <ssh_alias> "test -d '<REMOTE_DEST>/<REMOTE_SID>'"; then
scp -r <ssh_alias>:"<REMOTE_DEST>/<REMOTE_SID>" "<LOCAL_PROJECTS>/"
fi
Update the most relevant launch record:
status to "pulled"pulled_session_id to the remote session IDpulled_at to the current timestampInclude:
claude --resume <REMOTE_SID> --fork-session
git pull, git push, or the user's normal repo sync flow/remote check <cluster> [session-id]Inspect the status of one launched remote session.
.claude/remote-sessions.jsonssh <ssh_alias> "tmux has-session -t <TMUX_NAME> 2>&1"
ssh <ssh_alias> "pgrep -a -f 'claude.*resume' 2>/dev/null"
ssh <ssh_alias> "cd <REMOTE_CWD> && git log --oneline -5 2>/dev/null"
running, completed, or crashed, and cite the evidence used./remote doctor [cluster]Run health checks for one cluster or all configured clusters.
For each target:
ssh -o ConnectTimeout=5 <ssh_alias> echo ok
CLAUDECODE=1 claude --version 2>&1
ssh <ssh_alias> "claude --version 2>&1"
ssh <ssh_alias> "claude --help 2>&1 | grep -q -- '--fork-session'"
ssh <ssh_alias> "which tmux"
ssh <ssh_alias> "test -d <REMOTE_CWD> && echo ok || echo MISSING"
ssh <ssh_alias> "df -h <REMOTE_CWD> | tail -1"
ssh <ssh_alias> "tmux list-sessions 2>/dev/null | grep 'teleport-' || true"
"launched"Report pass, warn, and fail items clearly.
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
Generated from the plugin's indexed repository (zongmin-yu/session-teleport) — no native marketplace selected
npx claudepluginhub p/zongmin-yu-session-teleport