# tmux.GlobalSessionScope.SetHooks

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

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

SetHooks applies indexed global session-scope hook commands in ascending order. With ClearExisting it confirms clearing before applying sparse Values. It stops at the first failure without rollback; the returned result reports only confirmed partial progress and owns AppliedIndices. Cancellation may follow accepted commands and cannot disprove their delivery.
