digital musings.
Anthropic recently released Claude in Chrome and as a Firefox user I was a bit jealous. But here we turn those feelings into action, so we put Claude to work writing a simple browser agent that works in Firefox.
WARNING: This isn’t safe or production ready. Just a demonstration. Use at your own risk.
Install Tampermonkey or a similar userscript manager.
Create a new userscript and copy the code from this gist.

![]()

The model and prompt really make a difference here.
The agent runs a simple ReACT loop allowing it to operate in cycles. It can call tools(like executing javascript) if the messages are formatted correctly.

We instruct the agent on the format for tool use in the system prompt, but it is up to the model to follow those recommendations. We can see here how strict the extraction logic is.

Tool execution is pretty risky. In the example below there are no guards preventing the agent from running dangerous or injected code.

Despite all of that the agents still manages to do pretty well at some tasks - like finding posts or clicking on links. Though have no issues hallucinating or making mistakes.
A lot of this really does come down to good prompt engineering and model selection. Going from a just a few releases ago to something newer was a big step up in capability and reliability.
For the sake of sciene I decided to ask a few models to reimagine my blog as if they were drunk. Below are the results.



