Create session¶
create_session¶
create_sessionCreate a new tmux session.
- Returns:
Use when you need a new isolated workspace. Sessions are the top-level container — create one before creating windows or panes.
Avoid when a session with the target name already exists — check with
list_sessions first, or the command will fail.
Side effects: Creates a new tmux session with one window and one pane.
Example:
{
"tool": "create_session",
"arguments": {
"session_name": "dev"
}
}
Response:
{
"session_id": "$1",
"session_name": "dev",
"window_count": 1,
"session_attached": "0",
"session_created": "1774521872",
"active_pane_id": "%0"
}
Tip
The returned active_pane_id is the pane ID (%N) of the
session’s initial pane. It’s guaranteed non-None immediately
after create_session (libtmux always creates the session with
one initial pane), so you can target subsequent send_keys /
split_window / capture_pane calls directly without a
follow-up list_panes round-trip — saving an MCP call
in the most common “new session, then act on it” workflow.
Parameters
Parameter |
Type |
Required |
Default |
Description |
|---|---|---|---|---|
|
no |
— |
Name for the new session. |
|
|
no |
— |
Name for the initial window. |
|
|
no |
— |
Working directory for the session. |
|
|
no |
— |
Width of the initial window. |
|
|
no |
— |
Height of the initial window. |
|
|
no |
— |
Environment variables to set. Accepts either a dict of env vars or a JSON-serialized string of the same — the latter is the cursor-composer-1 workaround described in :func: |
|
|
no |
— |
tmux socket name. Defaults to LIBTMUX_SOCKET env var. |