# user_hooks_path

> **Function** in `deepagents_code`

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

Return the user-scoped hooks configuration path.

## Signature

```python
user_hooks_path(
    config_dir: Path | None = None,
) -> Path
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `config_dir` | `Path \| None` | No | Alternate user config directory (tests). (default: `None`) |

## Returns

`Path`

`{config_dir}/hooks.json`, defaulting to `~/.deepagents/hooks.json`.

---

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