# session-closed

Source: https://libtmux.org/en/tmux/3.7c/catalog/hooks/session-closed/

> Run when a session closed.

hook tmux3.7c

Run when a session closed.

* Scope

  session

* Set

  [`set-hook`](https://libtmux.org/en/tmux/3.7c/manual/set-hook/) `session-closed command`

* Read

  [`show-hooks`](https://libtmux.org/en/tmux/3.7c/manual/show-hooks/) `session-closed`

## Description[#](https://libtmux.org/en/tmux/3.7c/catalog/hooks/session-closed/#description)

Run when a session closed.

## Releases[#](https://libtmux.org/en/tmux/3.7c/catalog/hooks/session-closed/#releases)

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

## Source[#](https://libtmux.org/en/tmux/3.7c/catalog/hooks/session-closed/#source)

* Defined in

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

* Fired from

  * [`session.c:209`](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/session.c#L209) in `notify_session`

* C source reference

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

* CLI Manual

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

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

Library documentation that names this hook.

* Python

  [`libtmux_mcp.tools.hook_tools.show_hooks`](https://libtmux.org/en/py/latest/mcp/reference/libtmux_mcp-tools-hook_tools-show_hooks/)

* Rust

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

* Go

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