Search panes¶
search_panes¶
search_panesSearch for text across all pane contents.
- Returns:
Use when you need to find specific text across multiple panes — locating which pane has an error, finding a running process, or checking output without knowing which pane to look in.
Avoid when you already know the target pane — use capture_pane
directly.
Side effects: None. Readonly.
Example:
{
"tool": "search_panes",
"arguments": {
"pattern": "FAIL",
"session_name": "dev"
}
}
Response is a SearchPanesResult wrapper: the matching panes live under
matches, and the wrapper fields (truncated, truncated_panes,
total_panes_matched, offset, limit) support pagination. For larger
result sets, iterate by re-calling with offset += len(matches); stop when
truncated == false and truncated_panes == [].
Note
Migrating from the flat-list shape
Earlier alpha releases returned a bare list[PaneContentMatch].
Clients iterating the old shape directly (e.g. for m in search_panes(...))
must switch to for m in search_panes(...).matches. See the
CHANGES entry for context.
{
"matches": [
{
"pane_id": "%0",
"pane_current_command": "zsh",
"pane_current_path": "/home/user/myproject",
"window_id": "@0",
"window_name": "editor",
"session_id": "$0",
"session_name": "dev",
"matched_lines": [
"FAIL: test_upload (AssertionError)",
"3 tests: 2 passed, 1 failed"
],
"is_caller": false
}
],
"truncated": false,
"truncated_panes": [],
"total_panes_matched": 1,
"offset": 0,
"limit": 500
}
Parameters
Parameter |
Type |
Required |
Default |
Description |
|---|---|---|---|---|
|
yes |
— |
Text to search for in pane contents. Treated as literal text by default. Set |
|
|
no |
|
Whether to interpret pattern as a regular expression. Default False (literal text matching). |
|
|
no |
— |
Limit search to panes in this session. |
|
|
no |
— |
Limit search to panes in this session (by ID). |
|
|
no |
|
Whether to match case. Default False (case-insensitive). |
|
|
no |
— |
Start line for capture. Negative values reach into scrollback. |
|
|
no |
— |
End line for capture. |
|
|
no |
|
Per-pane cap on |
|
|
no |
|
Maximum matching panes returned on this call. Defaults to :data: |
|
|
no |
|
Skip this many matching panes from the start. Use with |
|
|
no |
— |
tmux socket name. |