What is an agentic React tool? What your coding agent can't see from the browser
An agentic React tool is one your coding agent runs from the terminal and reads as text. Real runs show what a browser driver saw in a React app, and what Genie added.
An agentic React tool is a tool your coding agent runs from the terminal and reads as text, so it can check a React app without a person opening DevTools. An AI React tool earns a place in that loop when it answers what the browser alone leaves open: why a component rendered, which effect ran, what the Query cache holds, what an error boundary swallowed, and whether the fix worked.
This page tests that on the Meridian Ops dashboard in this repo
(apps/realworld-dashboard), which ships with seeded bugs. For each question, you see what
agent-browser 0.43.0 printed, including its own
React commands, next to what Genie 1.1.0 printed for the same
interaction. Every command and its full output are in the
evidence file.
What makes a React tool agentic
Your agent works through a shell. A tool fits that loop when it:
- runs as a command, with no window to look at
- prints text an agent can read in its context, and JSON when a script needs it
- shares a session name with the browser driver, so both act on the same tab
- ends with an exit code the agent can't misread
By that definition, agent-browser's react commands count too. It records renders, inspects a
component's props and hooks, and lists Suspense boundaries once you launch the session with
--enable react-devtools. So the useful comparison is what each one answers. If you are looking for
the best React tool for AI agents, run that comparison on your own app.
An error boundary hid the Carrier performance card
The dashboard should show a Carrier performance card. The driver's snapshot lists the headings on the page, and that one is missing:
- heading "Orders by status" [level=2, ref=e16]
- heading "Inventory health" [level=2, ref=e17]Here the browser shows most of it. The console holds React's message, and react inspect shows the
boundary's state (trimmed):
$ agent-browser --session upd-h console | grep -v '\[debug\]'
... message: "Cannot read properties of null (reading 'toFixed')"} The above error occurred in the <CarrierPerformanceCard> component. React will try to recreate this component tree from scratch using the error boundary you provided, WidgetBoundary.
$ agent-browser --session upd-h react inspect 221
WidgetBoundary #221
props:
name: "carrier-performance"
children: <CarrierPerformanceCard />
state:
failed: truereact_error_state returns the same facts as one record. It also says what the boundary rendered in
place of the card (selected fields):
$ npx genie-react call react_error_state '{}' --session upd-h --fields boundaryName,boundarySource,throwingComponent,message,status,rendered
- {boundaryName:WidgetBoundary,boundarySource:{file:/src/features/dashboard/dashboard-page.tsx,line:71,column:9,...},throwingComponent:CarrierPerformanceCard,message:"Cannot read properties of null (reading 'toFixed')",status:active,rendered:{output:nothing,hostNodes:0,text:null}}output:nothing with hostNodes:0 is the bug. The user sees a gap and no message.
The error boundary that renders nothing shows a
fix for this kind of bug.
The Query cache kept a low-stock count of 104 after a restock
The Inventory health card showed 104 low-stock SKUs. The agent restocked SKU SAF-07762 above its reorder point on the Inventory page and returned through the sidebar. The card still said 104. A full reload showed 103.
$ agent-browser --session upd-h get text '[data-testid=low-stock-count]'
104agent-browser's react inspect on the card shows that a Query hook exists, without its state:
LowStockCard #239
hooks:
Query: undefined (1 sub)Genie reads the cache entry. After the restock, before the reload (selected fields):
$ npx genie-react call query_get '{"queryKey":["dashboard","stock-summary"]}' --session upd-h --fields staleTime,isStale,dataUpdatedAt,dataUpdateCount,fetchCount
- {staleTime:Infinity,isStale:false,dataUpdatedAt:1795078635821,dataUpdateCount:1,fetchCount:1}dataUpdatedAt matches the value from before the restock, and fetchCount:1 says it fetched once.
staleTime:Infinity means it will never refetch on its own. In the source, stockSummaryQuery
spreads referenceDataOptions, which sets staleTime and gcTime to infinity for static data.
Collapsing the sidebar re-rendered four memoised stat cards
agent-browser's render profile does well here. One recording around the click lists every component
that rendered, with times and frame rate. The StatCard row and its change detail:
| StatCard | 8 | 0 | 4 | 0.6ms | 0.4ms | 4/4 | context (unknown) |
StatCard
context (unknown): {formatMoney, formatCompactMoney, formatNumber, ...} -> {formatMoney, formatCompactMoney, formatNumber, ...}Genie's react_render_causes names the context and grades each render (trimmed to one of four
identical events):
each: {documentCommitId:13,necessity:unnecessary,necessityReason:output-unchanged,inputEvidence:incomplete,...}
StatCard #663304012004 {renderEventId:render:13:4,mountId:mount:6,source:{location:/src/features/dashboard/dashboard-page.tsx:55:9}}
← context exact "Context(PreferencesProvider)" {contextIndex:0}Genie graded all four renders unnecessary. PreferencesProvider sits inside AppShell and builds a new
context value on every render, so the sidebar's state change reaches every usePreferences
consumer. Genie also reports this capture's coverage as lower-bound, because some inputs held
values it compared only in part. The count of four is a floor.
Opening the edit drawer re-ran a page-view effect
On an order page, the agent clicked Edit order. The driver's network log shows a page-view event fired again:
$ agent-browser --session upd-h network requests --filter /api/
[66305.949] POST http://127.0.0.1:5244/api/telemetry (Fetch) 200
[66305.967] GET http://127.0.0.1:5244/api/activity?after=0 (Fetch) 200react inspect on OrderDetailPage lists a PageView: undefined (1 sub) hook. Nothing in the
browser says which effect sent the request or why it ran. react_effect_timeline does (selected
fields):
phase:update,changedDependencySlots:[1],dependencyChanges:[{slot:1,change:reference-only}],execution:{status:observed,evidence:exact,...,outcome:completed,trigger:commit},...,hook:useEffect,customHooks:[usePageView],...,source:{file:/src/lib/telemetry.ts,line:11,column:3,functionName:usePageView,sourceMapConfidence:mapped,role:hook-callsite}The source points at the useEffect call in src/lib/telemetry.ts line 11. Dependency slot 1 is
the properties object. OrderDetailPage passes { orderId, tab } as a new literal on every
render, so the effect re-runs whenever the page renders. Genie 1.0.2 reported this source as
/lib/telemetry.ts line 7, and 1.1.0 fixed the path and the line.
A verdict instead of a "Done"
Each agent-browser click above printed ✓ Done and exited 0. That means the click happened. It
says nothing about what React did. genie-react verify takes claims before the interaction and
returns a verdict as the exit code. The agent left the order page through the sidebar's
Dashboard link, then ran:
npx genie-react verify begin --session upd-h --name 'collapse sidebar' \
--claim 'render StatCard max 0' --claim 'render SidebarNav min 1'
agent-browser --session upd-h find role button click --name 'Collapse sidebar'
npx genie-react verify end vfy_bd8395ad-9f46-422b-a9a8-c14ce82bfd3a --session upd-hfail vfy_bd8395ad-9f46-422b-a9a8-c14ce82bfd3a "collapse sidebar" 1 commit, quiet after 739 ms (react, query, router, network)
url "http://127.0.0.1:5244/"
1 fail render StatCard max 0 {renders:4,mounts:0,updates:4,remounts:0,semantics:exact,instances:4,activeInstances:4}
2 pass render SidebarNav min 1 {renders:1,mounts:0,updates:1,remounts:0,semantics:exact,instances:1,activeInstances:1}The command exited 1. The url line names the dashboard, the page the browser showed. Genie 1.0.2
printed the order page URL after an in-app navigation, and 1.1.0 reads the page URL instead.
The second claim is the positive control. The agent ran the same claims again with the sidebar
already collapsed. agent-browser reported that no button matched, and the SidebarNav min 1 claim
failed with zero renders, so the run exited 1. On its own, StatCard max 0 got a refusal with
no_activity, not a pass.
When the browser driver is enough
- For a quick look at what rendered, agent-browser's render profile covers every component in one table, with times and frame rate, and it needs no install in your app. Genie answers about the components you name.
- When the console message names the component and boundary, the driver may tell you enough.
- Genie needs a package and a dev-server plugin in your app, and a development build of React 18 or newer. It does not see pixels. Confirm the screen with the driver.
To set Genie up and give your agent the skill, see Install and connect and Use it with your agent. For a full bug walk with Claude Code, see How to debug a React app with Claude Code.
Query and Router
Read the TanStack Query cache, follow data to the screen, and check navigation.
How to debug a React app with Claude Code and prove the fix worked
Install Genie, run init to give Claude Code the skill, then follow one real bug from symptom to render cause to fix to a verify pass with exit code 0.