# get_thread_cwd

> **Function** in `deepagents_code`

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

Get the most recently stored cwd for a thread.

## Signature

```python
get_thread_cwd(
    thread_id: str,
) -> str | None
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `thread_id` | `str` | Yes | The thread whose stored cwd to look up. |

## Returns

`str | None`

Most recent cwd for the thread, or None if not found.

---

[View source on GitHub](https://github.com/langchain-ai/deepagents/blob/7794b61a6e76230e8c7a49bdce808b3728305914/libs/code/deepagents_code/sessions.py#L1339)