# libtmux_mcp.tools.buffer_tools.load_buffer

- **Module:** libtmux_mcp.tools.buffer_tools
- **Package:** libtmux-mcp
- **Language:** Python
- **Kind:** function
- **Source:** https://github.com/tmux-python/libtmux-mcp/blob/4daddc0dfca96c43bf521d818bf91564e1434760/src/libtmux_mcp/tools/buffer_tools.py#L175
- **Page:** https://libtmux.org/en/py/latest/mcp/reference/libtmux_mcp-tools-buffer_tools-load_buffer/

```
libtmux_mcp.tools.buffer_tools.load_buffer(content: str, logical_name: str | None = None, socket_name: str | None = None) -> BufferRef
```

Load text into a new agent-namespaced tmux paste buffer.

Each call allocates a fresh buffer name — two concurrent calls will
land in distinct buffers even if they pass the same ``logical_name``.
Agents MUST use the returned
:attr:`~libtmux_mcp.models.BufferRef.buffer_name` on
subsequent paste/show/delete calls.

**When to use this vs. paste_text:** ``load_buffer`` is the
stage-then-fire path — you get a handle back and can inspect via
``show_buffer``, paste into multiple panes via ``paste_buffer``,
or hold the content for later. Use ``paste_text`` for a simple
one-shot paste with no follow-up.

## Parameters

- `content` (str): The text to stage. Can be multi-line. Redacted in audit logs.
- `logical_name` (str | None): Short label for the buffer. Limited to
``[A-Za-z0-9_.-]{1,64}`` so the final name stays safe on the
tmux command line. Empty or ``None`` uses ``"buf"``.
- `socket_name` (str | None): tmux socket name.

## Returns

BufferRef
    Handle with the allocated ``buffer_name`` the caller must use
    on follow-up calls.
