# get_thread_limit

> **Function** in `deepagents_cli`

📖 [View in docs](https://reference.langchain.com/python/deepagents-cli/sessions/get_thread_limit)

Read the thread listing limit from `DA_CLI_RECENT_THREADS`.

Falls back to `_DEFAULT_THREAD_LIMIT` when the variable is unset or contains
a non-integer value. The result is clamped to a minimum of 1.

## Signature

```python
get_thread_limit() -> int
```

## Returns

`int`

Number of threads to display.

---

[View source on GitHub](https://github.com/langchain-ai/deepagents/blob/b710a69b12e49479045eaa54dfb709326473500b/libs/cli/deepagents_cli/sessions.py#L1037)