Capture pane

capture_pane

capture_pane
readonly tool

Capture the visible contents of a tmux pane.

Returns:

str

Use when you need to read what’s currently displayed in a terminal — after running a command, checking output, or verifying state.

Avoid when you need to search across multiple panes at once — use search_panes. If you only need pane metadata (not content), use get_pane_info.

Side effects: None. Readonly.

Example:

{
  "tool": "capture_pane",
  "arguments": {
    "pane_id": "%0",
    "start": -50
  }
}

Response (string):

$ echo "Running tests..."
Running tests...
$ echo "PASS: test_auth (0.3s)"
PASS: test_auth (0.3s)
$ echo "FAIL: test_upload (AssertionError)"
FAIL: test_upload (AssertionError)
$ echo "3 tests: 2 passed, 1 failed"
3 tests: 2 passed, 1 failed
$

Parameters

Parameter

Type

Required

Default

Description

pane_id

str

no

Pane ID (e.g. ‘%1’).

session_name

str

no

Session name for pane resolution.

session_id

str

no

Session ID (e.g. ‘$1’) for pane resolution.

window_id

str

no

Window ID for pane resolution.

start

int

no

Start line number. 0 is the first visible line. Negative values reach into scrollback history (e.g. -100 for last 100 lines).

end

int

no

End line number.

max_lines

int

no

500

Maximum number of lines to return. Defaults to :data:CAPTURE_DEFAULT_MAX_LINES. Pass None to return the full capture with no truncation.

socket_name

str

no

tmux socket name.