Engineering
Turn expensive browser clicks into reusable scripts
Same web app clicks, burned every run.
What hurt
Sam Sokolin noticed that having Grok Bot redo the same clicks in a web app burns a lot of tokens. The fix he published: ask the bot to reverse-engineer an expensive computer-use run into scripts. Capture the network requests once, then skip the UI and hit the APIs with the same auth. It is also much faster than clicking around a GUI. Michael Fenech later confirmed the tip on a heavy-browser routine: his CoS estimated about 80–95% off the browser portion of that fill.
What to install or create
One helper bot (or your existing CoS). Point it at Sam's tip, or paste the try-this ask below. Run the painful browser path once with computer-use / browser while it captures network requests. Ask it to turn those into a script or skill that calls the same APIs with the same auth. Next runs use the script; keep secrets out of chat. Do not invent extra endpoints the capture never saw.
Bots
Script miner
Captures one browser path's network requests, then proposes a reusable script. Does not fire writes until you say yes.
Plugins
Browser
Required
Files
Optional: a scratch file for the captured request list / script draft.
Routines
Only after the script is stable: hang the cheap path on a routine. Keep browser fallback rare.
The prompt
Paste after one expensive browser run
Curated from Sam Sokolin’s published tip in the cited post (capture network once, then hit APIs). Not a verbatim system prompt he pasted.
Last line is our approval fence: Never send, post, spend, or buy without my explicit yes.
You just finished a computer-use / browser path that we will repeat. 1) List the network requests that actually mattered (method, URL pattern, auth header style, body shape). Do not invent endpoints you did not see. 2) Draft a reusable script or skill that hits those APIs with the same auth instead of clicking the UI. 3) Call out what still needs a human yes (send, spend, delete, publish, change settings). 4) Estimate why the next run should be cheaper than redoing the clicks. Never paste secrets into chat. Prefer connectors / existing auth stores. Never send, post, spend, or buy without my explicit yes.
First run
- 1Open https://x.com/SamSokolin/status/2094824011427373415 and skim the full tip (including the long text).
- 2Pick one routine that burns tokens redoing the same web-app clicks.
- 3Run that path once with browser / computer-use and ask your bot to capture the meaningful network requests.
- 4Paste the capture-then-script ask (or drop Sam's post link into your CoS) and review the proposed script. No invented endpoints.
- 5On the next run, use the script. Keep send / spend / settings changes behind a yes. Optional: compare cost to the clicky run (Michael reported ~80–95% off browser portion on one routine).
Approval fence
Scripts that send, change settings, or spend need your yes. Capture-only runs do not.
What to tweak
Steal the capture-once, call-APIs-next pattern. Confirmation from Michael is optional evidence, not a second recipe. Keep auth tokens off the page and behind approval.
Source
Sam Sokolin @SamSokolin · Original post
Not affiliated with xAI. We did not write this prompt. Third-party template terms still apply.