# prewarm_thread_message_counts

> **Function** in `deepagents_cli`

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

Prewarm thread selector cache for faster `/threads` open.

Fetches a bounded list of recent threads and populates checkpoint-derived
fields for currently visible columns into the in-memory cache. Intended to
run in a background worker during app startup.

## Signature

```python
prewarm_thread_message_counts(
    limit: int | None = None,
) -> None
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `limit` | `int \| None` | No | Maximum threads to prewarm. Uses `get_thread_limit()` when `None`. (default: `None`) |

---

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