Read Pane — Capture Tmux Pane Content
Read the visible text content of a tmux pane so you can see what the user sees — command output, error messages, logs, code in an editor, etc.
How to Use
Step 1: Write the capture request
Read ~/.claude/skills/runtime.json to get the runtime_dir value, then write to <runtime_dir>/claude-panes/requests/pane-capture.json.
{
"target": "{last}",
"lines": 50,
"clean": true
}
Step 2: Read the result
After writing the request, read the captured content from:
<runtime_dir>/claude-panes/results/pane-capture.txt
Request Fields
| Field | Default | Description |
|---|---|---|
target |
"{last}" |
Tmux pane target — see Target Specifiers below |
name |
(none) | Alternative: a registered pane name (from the pane skill) |
lines |
(all visible) | Limit output to this many lines (from the bottom) |
clean |
true |
Strip ANSI escape codes for clean text |
Use either target or name, not both. When the user says "read my pane" without further context, use {"target": "{last}", "clean": true}.
Target Specifiers
| Target | Meaning |
|---|---|
{last} |
The pane that was active before the current one (most common — this is the user's pane) |
{next} |
Next pane by index |
{previous} |
Previous pane by index |
{top} |
Topmost pane |
{bottom} |
Bottommost pane |
{left} |
Leftmost pane |
{right} |
Rightmost pane |
0, 1, 2... |
Pane by index within the window |
%42 |
Raw tmux pane ID |
Example Workflow
User says: "read my terminal pane"
- Write the capture request:
{"target": "{last}", "clean": true}
Read the result from
results/pane-capture.txtReport the content to the user or use it to inform your work.
Notes
- The
{last}target is almost always correct when the user asks you to "read my pane" — it refers to the pane they were focused on before switching to Claude's pane. - If the user has only one pane (Claude's), the capture will fail. Let them know they need at least two panes.
- The
cleanoption strips terminal color codes and formatting, giving you plain text. Always useclean: trueunless the user specifically wants raw terminal output. - If the user asks about a specific pane (e.g., "the pane on the right"), use the corresponding target specifier.