The whole hunk
from line 248, old and new numbered
/
lines
from line 248
248248
249249#### Return type: `SDKSessionInfo`
250250
251| Property | Type | Description |
252| :-------------- | :------------ | :------------------------------------------------------------------- |
253| `session_id` | `str` | Unique session identifier |
254| `summary` | `str` | Display title: custom title, auto-generated summary, or first prompt |
255| `last_modified` | `int` | Last modified time in milliseconds since epoch |
256| `file_size` | `int \| None` | Session file size in bytes (`None` for remote storage backends) |
257| `custom_title` | `str \| None` | User-set session title |
258| `first_prompt` | `str \| None` | First meaningful user prompt in the session |
259| `git_branch` | `str \| None` | Git branch at the end of the session |
260| `cwd` | `str \| None` | Working directory for the session |
261| `tag` | `str \| None` | User-set session tag (see [`tag_session()`](#tag_session)) |
262| `created_at` | `int \| None` | Session creation time in milliseconds since epoch |
251| Property | Type | Description |
252| :-------------- | :------------ | :------------------------------------------------------------------------------ |
253| `session_id` | `str` | Unique session identifier |
254| `summary` | `str` | Display title: custom title, auto-generated summary, or first prompt |
255| `last_modified` | `int` | Last modified time in milliseconds since epoch |
256| `file_size` | `int \| None` | Session file size in bytes (`None` for remote storage backends) |
257| `custom_title` | `str \| None` | Session title: the user-set title, or the auto-generated title when none is set |
258| `first_prompt` | `str \| None` | First meaningful user prompt in the session |
259| `git_branch` | `str \| None` | Git branch at the end of the session |
260| `cwd` | `str \| None` | Working directory for the session |
261| `tag` | `str \| None` | User-set session tag (see [`tag_session()`](#tag_session)) |
262| `created_at` | `int \| None` | Session creation time in milliseconds since epoch |
263263
264264#### Example
265265
from line 437
437437 async def receive_messages(self) -> AsyncIterator[Message]
438438 async def receive_response(self) -> AsyncIterator[Message]
439439 async def interrupt(self) -> None
440 async def set_permission_mode(self, mode: str) -> None
440 async def set_permission_mode(self, mode: PermissionMode) -> None
441441 async def set_model(self, model: str | None = None) -> None
442442 async def rewind_files(self, user_message_id: str) -> None
443443 async def get_mcp_status(self) -> McpStatusResponse
from line 465
465465| `reconnect_mcp_server(server_name)` | Retry connecting to an MCP server that failed or was disconnected |
466466| `toggle_mcp_server(server_name, enabled)` | Enable or disable an MCP server mid-session. Disabling removes its tools |
467467| `stop_task(task_id)` | Stop a running background task. A [`TaskNotificationMessage`](#tasknotificationmessage) with status `"stopped"` follows in the message stream |
468| `get_server_info()` | Get server information including session ID and capabilities |
468| `get_server_info()` | Get the server's initialization info, including available commands and output styles |
469469| `disconnect()` | Disconnect from Claude |
470470
471471#### Context Manager Support
from line 1814
18141814Union type of all content blocks.
18151815
18161816```python theme={null}
1817ContentBlock = TextBlock | ThinkingBlock | ToolUseBlock | ToolResultBlock
1817ContentBlock = (
1818 TextBlock
1819 | ThinkingBlock
1820 | ToolUseBlock
1821 | ToolResultBlock
1822 | ServerToolUseBlock
1823 | ServerToolResultBlock
1824)
18181825```
18191826
18201827### `TextBlock`
from line 3368
33613368| `allowedDomains` | `list[str]` | `[]` | Domain names that sandboxed processes can access |
33623369| `deniedDomains` | `list[str]` | `[]` | Domain names that sandboxed processes cannot access. Takes precedence over `allowedDomains` |
33633370| `allowManagedDomainsOnly` | `bool` | `False` | Managed-settings only: when set in managed settings, ignore `allowedDomains` and `WebFetch(domain:...)` allow rules from non-managed settings sources. Has no effect when set via SDK options |
3364| `allowUnixSockets` | `list[str]` | `[]` | Unix socket paths that processes can access (e.g., Docker socket) |
3371| `allowUnixSockets` | `list[str]` | `[]` | macOS only: Unix socket paths that processes can access, such as the Docker socket. Ignored on Linux |
33653372| `allowAllUnixSockets` | `bool` | `False` | Allow access to all Unix sockets |
33663373| `allowLocalBinding` | `bool` | `False` | Allow processes to bind to local ports (e.g., for dev servers) |
33673374| `allowMachLookup` | `list[str]` | `[]` | macOS only: XPC/Mach service names to allow. Supports a trailing wildcard |