# get_current_run_tree

> **Function** in `langsmith`

📖 [View in docs](https://reference.langchain.com/python/langsmith/run_helpers/get_current_run_tree)

Get the current run tree.

Uses a weakref-based lookup to avoid memory leaks from captured contexts.
The RunTree may return None if it has been garbage collected.

## Signature

```python
get_current_run_tree() -> Optional[run_trees.RunTree]
```

---

[View source on GitHub](https://github.com/langchain-ai/langsmith-sdk/blob/6a74bf5af9e542d8065af8edca54b2448f430916/python/langsmith/run_helpers.py#L74)