# rename_session

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

> Change tmux state; no client-supplied executable input. Rename a session. Its id does not change, so targets by id keep working.

MCP is in development

Server behavior and tool contracts may change. Tool availability depends on the server configuration.

Change tmux state; no client-supplied executable input. Rename a session. Its id does not change, so targets by id keep working.

[All TypeScript tools](https://libtmux.org/en/ts/latest/mcp/tools/) · [JSON](https://libtmux.org/en/ts/latest/mcp/tools/rename_session.json) · [Source](https://github.com/libtmux/libtmux-ts/blob/b3f338c1a21e614ebf0dd6d55aa36a60db816618/packages/mcp/src/tools/lifecycle.ts#L234)

## Arguments

* `name` required · string

  The session's new name.

* `session` required · string

  Session id ($1) or name.

## Schemas

The schema defines required fields, nested values, defaults, and validation constraints.

Input schema

```json
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "properties": {
    "name": {
      "description": "The session's new name.",
      "type": "string",
      "x-libtmux-tmux-format": "literalized-once"
    },
    "session": {
      "description": "Session id ($1) or name.",
      "type": "string"
    }
  },
  "required": [
    "name",
    "session"
  ],
  "type": "object"
}
```

Output schema

```json
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "additionalProperties": false,
  "properties": {
    "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"
    }
  },
  "required": [
    "session"
  ],
  "type": "object"
}
```

Tool annotations

```json
{
  "destructiveHint": true,
  "idempotentHint": false,
  "openWorldHint": true,
  "readOnlyHint": false
}
```
