> ## Documentation Index
> Fetch the complete documentation index at: https://laminar.sh/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Debugger with Browser Use

This guide is an end-to-end setup for running a `browser-use` agent with the Laminar Debugger so you can rerun from checkpoints.

## 1) Install prerequisites

Install `uv` if you do not already have it:

```bash theme={null}
pip install -U uv
```

Create a virtual environment and install dependencies:

```bash theme={null}
uv venv --python 3.11
source .venv/bin/activate
uv pip install lmnr browser-use python-dotenv
```

Install the Browser Use Chromium bundle:

```bash theme={null}
uvx browser-use install
```

If your Browser Use LLM provider needs extra packages or env vars, follow the provider setup in Browser Use docs.

## 2) Set environment variables

Create a `.env` file in your project root:

```bash theme={null}
LMNR_PROJECT_API_KEY=your_laminar_project_api_key
```

If you are using **ChatBrowserUse** (recommended), add:

```bash theme={null}
BROWSER_USE_API_KEY=your_browser_use_api_key
```

If you prefer **Claude**, add:

```bash theme={null}
ANTHROPIC_API_KEY=your_anthropic_api_key
CLAUDE_MODEL=your_claude_model_name
```

## 3) Create the entrypoint

```python theme={null}
import os
import asyncio
from dotenv import load_dotenv
from browser_use import Agent, ChatBrowserUse, ChatAnthropic
from lmnr import observe, Laminar

load_dotenv()
Laminar.initialize(project_api_key=os.getenv("LMNR_PROJECT_API_KEY"))

@observe(rollout_entrypoint=True)
async def main(prompt: str):
    provider = os.getenv("LLM_PROVIDER", "chatbrowseruse")
    if provider == "anthropic":
        llm = ChatAnthropic(model=os.getenv("CLAUDE_MODEL"), temperature=0.0)
    else:
        llm = ChatBrowserUse()

    agent = Agent(task=prompt, llm=llm)
    history = await agent.run()
    print(history.final_result())

if __name__ == "__main__":
    asyncio.run(
        main(
            "go to ycombinator.com, summarize 3 startups from the summer 2025 batch."
            # "go to laminar.sh, summarize the pricing page."
        )
    )
```

Notes:

* The `rollout_entrypoint=True` flag marks this function for debugger sessions.
* Keep the CLI running while you iterate; the debugger will rerun using the latest code on disk.

## 4) Start a debugger session

```bash theme={null}
npx lmnr-cli@latest dev path/to/entrypoint.py
```

If the file exposes multiple debugger entrypoints, pass `--function main`.

> \[Screenshot: terminal output with debugger session link]

## 5) Open the debugger in Laminar

Open **Debugger** in your project, select the session, provide input arguments as JSON, and click **Run**.

<img src="https://mintcdn.com/laminarai/VCesC-sVGbi0XUXP/images/debugger-view.png?fit=max&auto=format&n=VCesC-sVGbi0XUXP&q=85&s=eee65c0ddd62fc8b1a4c2ad0e57f7868" alt="Debugger session view" width="2560" height="1320" data-path="images/debugger-view.png" />

## 6) Make a change and rerun (Debugger workflow)

Use the Debugger to iterate without restarting your local process.

1. Open the trace in **Transcript** or **Tree** view.
2. Click the checkpoint icon on a span and choose **Run from here**.
3. Expand **System Prompts** and toggle **Override System Prompt** on for the Browser Automation Agent.

<img src="https://mintcdn.com/laminarai/VCesC-sVGbi0XUXP/images/debugger-view-toggle.png?fit=max&auto=format&n=VCesC-sVGbi0XUXP&q=85&s=e32ad88d036a153538c6e7108b320b15" alt="System prompt override toggle" width="2559" height="1319" data-path="images/debugger-view-toggle.png" />

4. Edit the prompt in place, then click **Run** again to rerun with the updated instructions.

Notes:

* Keep the CLI running while you iterate; the debugger reruns using the latest code on disk.
* If you changed dependencies, restart the CLI.
