Your agent logs into the same dashboard every morning. Same login flow, same clicks, same three menus to find the export button. It does this on every single run, at full token cost, like it's never seen the page before.
That's not a bug in your agent. That's the default behavior of basically every browser-driving agent loop in production right now.
Every time a browser agent hits a site, it re-derives the whole thing from scratch: parses the DOM, figures out the login flow, guesses at selectors, finds the API call buried under three redirects. Then it closes the session and forgets everything it just learned. Ask it to run the same task 100 times and it will happily bill you for solving the same puzzle 100 times.
Here's how to actually fix that, step by step, using an open-source CLI called webcmd.
Step 1: Install it.
npm install -g @agentrhq/webcmd
webcmd skills add
You'll get prompted to pick your agent harness, Claude, Codex, or a custom skills path. Pick whichever one you're running.
Step 2: Let it explore a site once, normally.
You don't configure anything up front. You just talk to your agent like you normally would:
Use webcmd to research the latest discussions about browser automation
across Hacker News and Reddit, then return a concise comparison with source links.
On this first run, webcmd drives a real browser: clicking, typing, extracting, capturing the network calls underneath the UI. This part looks exactly like any other browser agent run, same cost, same exploration.
Step 3: Watch it stop exploring.
This is the actual fix. Instead of throwing that first run away, webcmd keeps a map of what it found, the pages, the states, the actions, the API calls hiding under the buttons, and turns it into a command your agent can call directly: webcmd <site> <command>. Ask it to run the same task again and it skips the browser entirely. No re-clicking, no re-guessing selectors, just the command and clean structured JSON back.
Step 4: Let it get sharper over time.
The more a workflow gets reused, the more deterministic the command becomes, until it's basically instant and running on close to zero wasted tokens. That's the compounding part: cost doesn't reset every run anymore, it collapses.
That's the whole mechanism. Explore once, reuse forever, and the tax you were paying on every single run just stops applying after the first one.
It's open-source, Apache 2.0, self-hostable: github.com/agentrhq/webcmd. Go Star the REPO⭐️
Top comments (0)