write_input
Sends text input to a specific iTerm2 session, pressing Enter by default, to drive shells, REPLs, TUIs, or answer interactive prompts in a chosen pane.
Instructions
PREFER SendMessage when the target is another Claude Code session. SendMessage delivers an addressed, queued message straight into that session's conversation; it does not depend on which pane has focus, does not race whatever the session is mid-way through, and is not silently swallowed if the session is busy. Reach for write_input only for terminal work SendMessage cannot do: driving a shell, REPL or TUI, answering an interactive prompt, or starting a program in a pane. Send text input to a specific iTerm2 session. By default presses Enter after the text. When sending to a Claude Code session anyway, set submit: true — this writes the text without a trailing newline, then sends a separate Enter keystroke to trigger submission (Claude Code buffers pasted text and needs a distinct Enter to submit).
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": {
"session_id": "<session_id>",
"text": "<text>"
},
"name": "write_input"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | The text to send to the terminal | |
| submit | No | Set true when sending to a Claude Code prompt. Writes the text without newline first, then sends a separate Enter to trigger submission. | |
| newline | No | Press Enter after the text (default: true) | |
| session_id | Yes | The unique session ID (UUID) from list_sessions |