# load_hooks_config

> **Function** in `deepagents_code`

📖 [View in docs](https://reference.langchain.com/python/deepagents-code/hooks/loading/load_hooks_config)

Load, validate, merge, and hash Hooks v2 configuration.

## Signature

```python
load_hooks_config(
    *,
    project_root: Path,
    workspace_trusted: bool,
    config_dir: Path | None = None,
    paths: Sequence[Path] | None = None,
    documents: Sequence[tuple[HooksSource, JsonValue]] = (),
    document_diagnostics: Sequence[HookDiagnostic] = (),
) -> LoadedHooksConfig
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `project_root` | `Path` | Yes | Project root used for project precedence. |
| `workspace_trusted` | `bool` | Yes | Whether project-scoped hooks may be loaded. |
| `config_dir` | `Path \| None` | No | Alternate user config directory. (default: `None`) |
| `paths` | `Sequence[Path] \| None` | No | Explicit trusted source paths in precedence order (highest first). When omitted, project hooks are included only for trusted workspaces, followed by user hooks. (default: `None`) |
| `documents` | `Sequence[tuple[HooksSource, JsonValue]]` | No | Already-decoded plugin documents with their provenance, merged after every file source so they hold the least authority. Validated here, so a malformed one is reported rather than dropped. (default: `()`) |
| `document_diagnostics` | `Sequence[HookDiagnostic]` | No | Diagnostics the caller collected while producing `documents`, carried into the load result. (default: `()`) |

## Returns

`LoadedHooksConfig`

Frozen load result with canonical `snapshot_id` and explicit project

---

[View source on GitHub](https://github.com/langchain-ai/deepagents/blob/4bfa52000ef65ac623d8ada0cb67f67cbdd663ea/libs/code/deepagents_code/hooks/loading.py#L177)