# 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/d6cd6082f09e7826a2d6afe444ae6119e61b82a6/python/langsmith/run_helpers.py#L77)