# session-renamed

Source: https://libtmux.org/en/tmux/latest/catalog/hooks/session-renamed/

> Run when a session is renamed.

hook tmux3.7c

Run when a session is renamed.

* Scope

  session

* Set

  [`set-hook`](https://libtmux.org/en/tmux/latest/manual/set-hook/) `session-renamed command`

* Read

  [`show-hooks`](https://libtmux.org/en/tmux/latest/manual/show-hooks/) `session-renamed`

* Control mode

  Also sent to control clients as `%session-renamed`

## Description[#](https://libtmux.org/en/tmux/latest/catalog/hooks/session-renamed/#description)

Run when a session is renamed.

## Releases[#](https://libtmux.org/en/tmux/latest/catalog/hooks/session-renamed/#releases)

* [tmux 3.7c](https://libtmux.org/en/tmux/3.7c/catalog/hooks/session-renamed/) : present
* [tmux 3.2a](https://libtmux.org/en/tmux/3.2a/catalog/hooks/session-renamed/) : present

## Source[#](https://libtmux.org/en/tmux/latest/catalog/hooks/session-renamed/#source)

* Defined in

  [`options-table.c:1703`](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/options-table.c#L1703)

* Fired from

  * [`cmd-rename-session.c:78`](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-rename-session.c#L78) in `notify_session`

* C source reference

  [`options_table`](https://libtmux.org/en/tmux/latest/reference/c-variable-options_table/), [`notify_session`](https://libtmux.org/en/tmux/latest/reference/c-function-notify_session/)

* CLI Manual

  [Original manual entry](https://libtmux.org/en/tmux/latest/manual/full/#hooks-session-renamed)

## Used by[#](https://libtmux.org/en/tmux/latest/catalog/hooks/session-renamed/#used-by)

Library documentation that names this hook.

* Python

  [`libtmux_mcp.models.HookEntry`](https://libtmux.org/en/py/latest/mcp/reference/libtmux_mcp-models-hookentry/), [`libtmux._internal.constants.Hooks.from_stdout`](https://libtmux.org/en/py/latest/reference/libtmux-_internal-constants-hooks-from_stdout/), [`libtmux.hooks.HooksMixin.set_hooks`](https://libtmux.org/en/py/latest/reference/libtmux-hooks-hooksmixin-set_hooks/), [`libtmux.hooks.HooksMixin.show_hook`](https://libtmux.org/en/py/latest/reference/libtmux-hooks-hooksmixin-show_hook/), [`libtmux.Pane.set_hooks`](https://libtmux.org/en/py/latest/reference/libtmux-pane-set_hooks/), [`libtmux.Pane.show_hook`](https://libtmux.org/en/py/latest/reference/libtmux-pane-show_hook/) and 6 more

* Rust

  [`options.generated.SESSION_RENAMED`](https://libtmux.org/en/rs/latest/reference/options-generated-session_renamed/)

* Go

  [`tmux.ServerHookValues.SessionRenamed`](https://libtmux.org/en/go/latest/reference/tmux-serverhookvalues-sessionrenamed/), [`tmux.SessionHookValues.SessionRenamed`](https://libtmux.org/en/go/latest/reference/tmux-sessionhookvalues-sessionrenamed/)
