SSH Long Session
Use this when a remote command may run longer than one response window.
When To Use
- The remote job may take minutes or hours.
- You need to come back later and inspect the latest output.
- A plain
ssh host 'cmd'call would likely timeout or produce too much output.
Main Tools
start_remote_tmux_sessionget_remote_tmux_session_statuslist_remote_tmux_sessionsterminate_remote_tmux_session
Recommended Flow
- Use normal
execfor short remote commands. - For a long job, call
start_remote_tmux_sessionwith:hostcommand- optional
remote_cwd - optional
session_name
- Save the returned
session_idin your reasoning and user response when relevant. - Later, call
get_remote_tmux_session_status(session_id=...)to inspect progress. - Prefer the returned log tail. The tool only falls back to
tmux capture-paneif the log is unavailable. - When the job is no longer needed, call
terminate_remote_tmux_session.
Important Notes
- Prefer stable
session_namevalues only when you intentionally want a recognizable remote tmux name. - Do not start a duplicate remote session if
list_remote_tmux_sessionsalready shows the same job running. - Keep commands non-interactive. Interactive prompts will stall inside tmux.
- The remote job writes output to a remote log file so status checks stay bounded.
- Use
tail_linesinget_remote_tmux_session_statusto keep output concise.