# tmux.Session.SetHooks

- **Module:** tmux.Session
- **Package:** github.com/libtmux/libtmux-go/tmux
- **Language:** Go
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-go/blob/5f808882015a975a65acc7f9da5b3ff0d5cbdc91/tmux/hook_runtime.go#L448
- **Page:** https://libtmux.org/reference/go/tmux-session-sethooks/

```
tmux.Session.SetHooks(ctx: context.Context, name: string, values: SparseArray[string], options: SetHooksOptions) -> (SetHooksResult, error)
```

SetHooks applies indexed session hook commands in ascending order at this handle's stable session target. With ClearExisting it confirms clearing first, stops at the first failure without rollback, and reports confirmed partial progress. Cancellation may follow accepted commands and cannot disprove their delivery.
