# Libtmux_unix.Cleanup

- **Package:** libtmux-unix
- **Language:** OCaml
- **Kind:** module
- **Source:** https://github.com/libtmux/libtmux-ocaml/blob/205dfda49742592b479247049d186956e4a4cfe9/unix/libtmux_unix.mli#L17
- **Public owner:** Libtmux_unix
- **Page:** https://libtmux.org/en/ocaml/latest/reference/libtmux_unix-cleanup/

```ocaml
module Cleanup
```

Retained failures from releasing processes and descriptors. Reports belong to their creating domain and remain readable after client closure. They preserve secondary failures without replacing a primary exception or cancellation.

## Members

### Common operations

- [`create`](/en/ocaml/latest/reference/libtmux_unix-cleanup-create/) (function): Create an empty report without I/O. Supply it before {!Client.connect}, {!Workspace.submit_bootstrap} or {!Terminal.attach_current} to retain cleanup evidence even when setup fails or cancellation raises.
- [`inspect`](/en/ocaml/latest/reference/libtmux_unix-cleanup-inspect/) (function): Copy the current diagnostics without I/O. Returns {!Libtmux.Error.Wrong_domain} outside the creating domain.

### Other members

- [`issue`](/en/ocaml/latest/reference/libtmux_unix-cleanup-issue/) (struct): One failed cleanup action. `error` retains a typed library cause when available; `exception_` and `backtrace` retain the original exception. `Unreaped_child` means exit was not established after a failed signal. It does not release ownership or authorize signalling a reused PID.
- [`phase`](/en/ocaml/latest/reference/libtmux_unix-cleanup-phase/) (enum)
- [`snapshot`](/en/ocaml/latest/reference/libtmux_unix-cleanup-snapshot/) (struct): Issues in occurrence order, with a count of additional omitted issues. A report retains at most 64 entries. This bounds entry count, not heap retention: exception payloads and backtraces may retain other values. These diagnostics are not immutable graph observations.
- [`t`](/en/ocaml/latest/reference/libtmux_unix-cleanup-t/) (typealias)
