# create_session

Source: https://libtmux.org/en/ts/latest/mcp/tools/create_session/

> Start a pane's configured process; accepts no command payload. Create a detached session and return it with its first window and pane, so you can start working without listing anything first.

tool MCPlatest

MCP concept example

A working example of the core library. It can change without notice.

[What concept means](https://libtmux.org/en/meta/support/#concept-and-alpha)

* **create_session**( [height](https://libtmux.org/en/ts/latest/mcp/tools/create_session/#mcp.tool.create_session.input%2Fproperties%2Fheight)?: [integer](https://json-schema.org/understanding-json-schema/reference/numeric "numeric (JSON Schema)"), [name](https://libtmux.org/en/ts/latest/mcp/tools/create_session/#mcp.tool.create_session.input%2Fproperties%2Fname)?: [string](https://json-schema.org/understanding-json-schema/reference/string "string (JSON Schema)"), [startDirectory](https://libtmux.org/en/ts/latest/mcp/tools/create_session/#mcp.tool.create_session.input%2Fproperties%2FstartDirectory)?: [string](https://json-schema.org/understanding-json-schema/reference/string "string (JSON Schema)"), [width](https://libtmux.org/en/ts/latest/mcp/tools/create_session/#mcp.tool.create_session.input%2Fproperties%2Fwidth)?: [integer](https://json-schema.org/understanding-json-schema/reference/numeric "numeric (JSON Schema)"), [windowName](https://libtmux.org/en/ts/latest/mcp/tools/create_session/#mcp.tool.create_session.input%2Fproperties%2FwindowName)?: [string](https://json-schema.org/understanding-json-schema/reference/string "string (JSON Schema)"), )

  tool \[[source](https://github.com/libtmux/libtmux-ts/blob/46cccfef2a546de55ce8b308249b8c76339089a0/packages/mcp/src/tools/lifecycle.ts#L68)][¶](https://libtmux.org/en/ts/latest/mcp/tools/create_session/#mcp.tool.create_session)

  Start a pane’s configured process; accepts no command payload. Create a detached session and return it with its first window and pane, so you can start working without listing anything first.

  * MCP request method

    `tools/call` Send `create_session` as the tool name, with the arguments below.

  ## Arguments[#](https://libtmux.org/en/ts/latest/mcp/tools/create_session/#mcp.tool.create_session.parameters)

  * **[`height`](https://libtmux.org/en/ts/latest/mcp/tools/create_session/#mcp.tool.create_session.input%2Fproperties%2Fheight)**? ([integer](https://json-schema.org/understanding-json-schema/reference/numeric "numeric (JSON Schema)"))

    Rows. Default 24, because a detached session has no client to size it.

    * maximum

      `9007199254740991`

    * exclusiveMinimum

      `0`

  * **[`name`](https://libtmux.org/en/ts/latest/mcp/tools/create_session/#mcp.tool.create_session.input%2Fproperties%2Fname)**? ([string](https://json-schema.org/understanding-json-schema/reference/string "string (JSON Schema)"))

    Session name; tmux picks a number when omitted.

  * **[`startDirectory`](https://libtmux.org/en/ts/latest/mcp/tools/create_session/#mcp.tool.create_session.input%2Fproperties%2FstartDirectory)**? ([string](https://json-schema.org/understanding-json-schema/reference/string "string (JSON Schema)"))

    Working directory for the first pane. Defaults to the server’s.

  * **[`width`](https://libtmux.org/en/ts/latest/mcp/tools/create_session/#mcp.tool.create_session.input%2Fproperties%2Fwidth)**? ([integer](https://json-schema.org/understanding-json-schema/reference/numeric "numeric (JSON Schema)"))

    Columns. Default 80, and a program that formats to its terminal width — ps, git log —graph, docker ps — truncates to that at the source, where no capture option can recover it.

    * maximum

      `9007199254740991`

    * exclusiveMinimum

      `0`

  * **[`windowName`](https://libtmux.org/en/ts/latest/mcp/tools/create_session/#mcp.tool.create_session.input%2Fproperties%2FwindowName)**? ([string](https://json-schema.org/understanding-json-schema/reference/string "string (JSON Schema)"))

    Name for the first window, so the session does not open with a stray shell.

  ## Result[#](https://libtmux.org/en/ts/latest/mcp/tools/create_session/#mcp.tool.create_session.result)

  Returns [object](https://json-schema.org/understanding-json-schema/reference/object "object (JSON Schema)")

  * **[`paneId`](https://libtmux.org/en/ts/latest/mcp/tools/create_session/#mcp.tool.create_session.output%2Fproperties%2FpaneId)** ([string](https://json-schema.org/understanding-json-schema/reference/string "string (JSON Schema)"))

    The new session’s first pane. Target this.

    * pattern

      `"^%\\d+$"`

  * **[`session`](https://libtmux.org/en/ts/latest/mcp/tools/create_session/#mcp.tool.create_session.output%2Fproperties%2Fsession)** ([object](https://json-schema.org/understanding-json-schema/reference/object "object (JSON Schema)"))

    * **[`attachedClients`](https://libtmux.org/en/ts/latest/mcp/tools/create_session/#mcp.tool.create_session.output%2Fproperties%2Fsession%2Fproperties%2FattachedClients)** ([integer](https://json-schema.org/understanding-json-schema/reference/numeric "numeric (JSON Schema)"))

      Raw client count from tmux; 0 means detached. Includes control-mode clients - this server’s own [wait_for_text](https://libtmux.org/en/ts/latest/mcp/tools/wait_for_text/) or other live read holds one open while it runs, and another program on this socket may hold others. See humanAttachedClients for a person-only count.

      * minimum

        `-9007199254740991`

      * maximum

        `9007199254740991`

    * **[`humanAttachedClients`](https://libtmux.org/en/ts/latest/mcp/tools/create_session/#mcp.tool.create_session.output%2Fproperties%2Fsession%2Fproperties%2FhumanAttachedClients)** ([integer](https://json-schema.org/understanding-json-schema/reference/numeric "numeric (JSON Schema)"))

      attachedClients minus every control-mode client, this server’s own included.

      * minimum

        `-9007199254740991`

      * maximum

        `9007199254740991`

    * **[`id`](https://libtmux.org/en/ts/latest/mcp/tools/create_session/#mcp.tool.create_session.output%2Fproperties%2Fsession%2Fproperties%2Fid)** ([string](https://json-schema.org/understanding-json-schema/reference/string "string (JSON Schema)"))

      Stable session id, e.g. $1.

      * pattern

        `"^\\$\\d+$"`

    * **[`metadataComplete`](https://libtmux.org/en/ts/latest/mcp/tools/create_session/#mcp.tool.create_session.output%2Fproperties%2Fsession%2Fproperties%2FmetadataComplete)** ([boolean](https://json-schema.org/understanding-json-schema/reference/boolean "boolean (JSON Schema)"))

      Whether the session name is complete.

    * **[`name`](https://libtmux.org/en/ts/latest/mcp/tools/create_session/#mcp.tool.create_session.output%2Fproperties%2Fsession%2Fproperties%2Fname)** ([string](https://json-schema.org/understanding-json-schema/reference/string "string (JSON Schema)"))

    * **[`omittedMetadataBytes`](https://libtmux.org/en/ts/latest/mcp/tools/create_session/#mcp.tool.create_session.output%2Fproperties%2Fsession%2Fproperties%2FomittedMetadataBytes)** ([integer](https://json-schema.org/understanding-json-schema/reference/numeric "numeric (JSON Schema)"))

      UTF-8 bytes omitted from the session name.

      * minimum

        `0`

      * maximum

        `9007199254740991`

    * **[`windows`](https://libtmux.org/en/ts/latest/mcp/tools/create_session/#mcp.tool.create_session.output%2Fproperties%2Fsession%2Fproperties%2Fwindows)** ([integer](https://json-schema.org/understanding-json-schema/reference/numeric "numeric (JSON Schema)"))

      How many windows it holds.

      * minimum

        `-9007199254740991`

      * maximum

        `9007199254740991`

    No other properties are accepted.

  * **[`windowId`](https://libtmux.org/en/ts/latest/mcp/tools/create_session/#mcp.tool.create_session.output%2Fproperties%2FwindowId)** ([string](https://json-schema.org/understanding-json-schema/reference/string "string (JSON Schema)"))

    Stable window id, e.g. @1.

    * pattern

      `"^@\\d+$"`

  No other properties are accepted.

  ## Annotations[#](https://libtmux.org/en/ts/latest/mcp/tools/create_session/#mcp.tool.create_session.annotations)

  * [`destructiveHint`](https://libtmux.org/en/ts/latest/mcp/reference/glossary/#destructiveHint)

    `true`

  * [`idempotentHint`](https://libtmux.org/en/ts/latest/mcp/reference/glossary/#idempotentHint)

    `false`

  * [`openWorldHint`](https://libtmux.org/en/ts/latest/mcp/reference/glossary/#openWorldHint)

    `true`

  * [`readOnlyHint`](https://libtmux.org/en/ts/latest/mcp/reference/glossary/#readOnlyHint)

    `false`

  ## Protocol data[#](https://libtmux.org/en/ts/latest/mcp/tools/create_session/#mcp.tool.create_session.schemas)

  Use the complete advertised contract for validation and client integration.

  Input schema

  ```json
  {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "properties": {
      "height": {
        "description": "Rows. Default 24, because a detached session has no client to size it.",
        "exclusiveMinimum": 0,
        "maximum": 9007199254740991,
        "type": "integer"
      },
      "name": {
        "description": "Session name; tmux picks a number when omitted.",
        "type": "string",
        "x-libtmux-tmux-format": "literalized-once"
      },
      "startDirectory": {
        "description": "Working directory for the first pane. Defaults to the server's.",
        "type": "string",
        "x-libtmux-tmux-format": "literalized-once"
      },
      "width": {
        "description": "Columns. Default 80, and a program that formats to its terminal width — ps, git log --graph, docker ps — truncates to that at the source, where no capture option can recover it.",
        "exclusiveMinimum": 0,
        "maximum": 9007199254740991,
        "type": "integer"
      },
      "windowName": {
        "description": "Name for the first window, so the session does not open with a stray shell.",
        "type": "string",
        "x-libtmux-tmux-format": "literalized-once"
      }
    },
    "type": "object"
  }
  ```

  Output schema

  ```json
  {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "additionalProperties": false,
    "properties": {
      "paneId": {
        "description": "The new session's first pane. Target this.",
        "pattern": "^%\\d+$",
        "type": "string"
      },
      "session": {
        "additionalProperties": false,
        "properties": {
          "attachedClients": {
            "description": "Raw client count from tmux; 0 means detached. Includes control-mode clients - this server's own wait_for_text or other live read holds one open while it runs, and another program on this socket may hold others. See humanAttachedClients for a person-only count.",
            "maximum": 9007199254740991,
            "minimum": -9007199254740991,
            "type": "integer"
          },
          "humanAttachedClients": {
            "description": "attachedClients minus every control-mode client, this server's own included.",
            "maximum": 9007199254740991,
            "minimum": -9007199254740991,
            "type": "integer"
          },
          "id": {
            "description": "Stable session id, e.g. $1.",
            "pattern": "^\\$\\d+$",
            "type": "string"
          },
          "metadataComplete": {
            "description": "Whether the session name is complete.",
            "type": "boolean"
          },
          "name": {
            "type": "string"
          },
          "omittedMetadataBytes": {
            "description": "UTF-8 bytes omitted from the session name.",
            "maximum": 9007199254740991,
            "minimum": 0,
            "type": "integer"
          },
          "windows": {
            "description": "How many windows it holds.",
            "maximum": 9007199254740991,
            "minimum": -9007199254740991,
            "type": "integer"
          }
        },
        "required": [
          "attachedClients",
          "humanAttachedClients",
          "id",
          "metadataComplete",
          "name",
          "omittedMetadataBytes",
          "windows"
        ],
        "type": "object"
      },
      "windowId": {
        "description": "Stable window id, e.g. @1.",
        "pattern": "^@\\d+$",
        "type": "string"
      }
    },
    "required": [
      "paneId",
      "session",
      "windowId"
    ],
    "type": "object"
  }
  ```
