# save_thread_scope

> **Function** in `deepagents_code`

📖 [View in docs](https://reference.langchain.com/python/deepagents-code/model_config/save_thread_scope)

Save the directory-scope preference for the thread selector.

## Signature

```python
save_thread_scope(
    scope: str,
    config_path: Path | None = None,
) -> bool
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `scope` | `str` | Yes | `"cwd"` (current working directory) or `"all"` (all directories). |
| `config_path` | `Path \| None` | No | Path to config file. (default: `None`) |

## Returns

`bool`

True if save succeeded, False on I/O error.

---

[View source on GitHub](https://github.com/langchain-ai/deepagents/blob/2f56309d821db4a0d06ee03959cf842c91b7f228/libs/code/deepagents_code/model_config.py#L3674)