Detect tmux pane
detect_tmux_paneDetect the actual tmux pane hosting a coding agent UI, even when the calling shell runs in a different pane, by mapping panes to ttys and inspecting real processes.
Instructions
Detect the tmux pane that is actually hosting a coding agent UI, even when the shell calling tools lives in a different pane. The detector scans tmux panes globally, maps each pane to its tty, then inspects real tty processes instead of trusting $TMUX_PANE or tmux focus state alone. Use agent to pick a built-in matcher for Codex, Claude Code, or opencode. Optional cwd, tty, and title_contains narrow the search and make cross-directory multi-agent sessions much more reliable. Returns either a single best pane, or an ambiguity/not-found result with candidates for debugging.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"agent": "<agent>"
},
"name": "detect_tmux_pane"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cwd | No | ||
| tty | No | ||
| agent | Yes | ||
| title_contains | No | ||
| process_pattern | No |