Skip to content
Back to search

agent-react-devtools

Gives AI agents access to React DevTools βš›οΈπŸ€–

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today

Check it deeper on your machine

It has changed since its scan on 11 Nov 2026.

As a Claude Code plugin, install it and then ask Claude Code:

/plugin marketplace add keithmackay/mackayi/plugin install scanskillsafety@mackayiDo a deep scan of https://github.com/callstackincubator/agent-react-devtools with scanskillsafety

Or from a terminal, clone it and run it:

git clone https://github.com/keithmackay/scanskillsafety-skill ~/.claude/skills/scanskillsafetynode ~/.claude/skills/scanskillsafety/cli.cjs --deep 'https://github.com/callstackincubator/agent-react-devtools'

It checks the exact commit: every file, its packages against OSV (api.osv.dev), how it compares with this page's scan (findsafeskills.com receives the repository's address), and, if you agree, Claude reading every file with your own Claude subscription. It never runs the code.

Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/callstackincubator--agent-react-devtools/badge.svg)](/listings/callstackincubator--agent-react-devtools)

HTML

<a href="/listings/callstackincubator--agent-react-devtools"><img src="/api/listings/callstackincubator--agent-react-devtools/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

npm install -g agent-react-devtools

Or run it directly:

npx agent-react-devtools start

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

.claude-plugin/marketplace.json Β· Manifest Β· 20 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. {
  2. "$schema": "https://anthropic.com/claude-code/marketplace.schema.json",
  3. "name": "piotrski",
  4. "owner": {
  5. "name": "Piotr Tomczewski",
  6. "email": "piotr@tomczewski.dev"
  7. },
  8. "metadata": {
  9. "description": "React DevTools for AI agents β€” inspect components, profile renders, debug performance"
  10. },
  11. "plugins": [
  12. {
  13. "name": "agent-react-devtools",
  14. "description": "Inspect React component trees, read props/state/hooks, and profile render performance from the terminal",
  15. "source": "./packages/agent-react-devtools",
  16. "strict": false,
  17. "category": "development"
  18. }
  19. ]
  20. }
README.md Β· README Β· 418 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. # agent-react-devtools
  2. Give your AI agent eyes into your React app. Inspect component trees, read props and state, and profile rendering performance β€” all from the command line. Inspired by Vercel's [agent-browser](https://github.com/vercel-labs/agent-browser) and Callstack's [agent-device](https://github.com/callstackincubator/agent-device).
  3. The project is in early development and considered experimental. Pull requests are welcome!
  4. ## Features
  5. - Walk the full component tree with props, state, and hooks
  6. - Search for components by display name
  7. - Profile renders: find slow components, excessive re-renders, and commit timelines
  8. - Persistent background daemon that survives across CLI calls
  9. - Token-efficient output built for LLM consumption
  10. ## Install
  11. ```sh
  12. npm install -g agent-react-devtools
  13. ```
  14. Or run it directly:
  15. ```sh
  16. npx agent-react-devtools start
  17. ```
  18. ## Quick Start
  19. ```sh
  20. agent-react-devtools start
  21. agent-react-devtools status
  22. ```
  23. ```
  24. Daemon: running (port 8097)
  25. Apps: 1 connected, 24 components
  26. Uptime: 12s
  27. Last event: app connected 3s ago
  28. ```
  29. Browse the component tree:
  30. ```sh
  31. agent-react-devtools get tree --depth 3
  32. ```
  33. ```
  34. @c1 [fn] App
  35. β”œβ”€ @c2 [fn] Header
  36. β”‚ β”œβ”€ @c3 [fn] Nav
  37. β”‚ └─ @c4 [fn] SearchBar
  38. β”œβ”€ @c5 [fn] TodoList
  39. β”‚ β”œβ”€ @c6 [fn] TodoItem key=1
  40. β”‚ β”œβ”€ @c7 [fn] TodoItem key=2
  41. β”‚ β”œβ”€ @c8 [fn] TodoItem key=3
  42. β”‚ └─ ... +47 more TodoItem
  43. └─ @c9 [fn] Footer
  44. 53 components shown (1,843 total)
  45. ```
  46. Host components (`<div>`, `<span>`, etc.) are filtered by default to keep output compact. Use `--all` to include them. Host components with keys or custom element names (e.g. `<my-widget>`) are always shown.
  47. View a subtree rooted at a specific component:
  48. ```sh
  49. agent-react-devtools get tree @c5 --depth 2
  50. ```
  51. ```
  52. @c1 [fn] TodoList
  53. β”œβ”€ @c2 [fn] TodoItem key=1
  54. β”œβ”€ @c3 [fn] TodoItem key=2
  55. └─ @c4 [fn] TodoItem key=3
  56. ```
  57. Inspect a component's props, state, and hooks:
  58. ```sh
  59. agent-react-devtools get component @c6
  60. ```
  61. ```
  62. @c6 [fn] TodoItem key=1
  63. props:
  64. id: 1
  65. text: "Buy groceries"
  66. done: false
  67. onToggle: Ζ’
  68. hooks:
  69. State: false
  70. Callback: Ζ’
  71. ```
  72. Find components by name:
  73. ```sh
  74. agent-react-devtools find TodoItem
  75. ```
  76. ```
  77. @c6 [fn] TodoItem key=1
  78. @c7 [fn] TodoItem key=2
  79. @c8 [fn] TodoItem key=3
  80. ```
  81. Profile rendering performance:
  82. ```sh
  83. agent-react-devtools profile start
  84. # ... interact with the app ...
  85. agent-react-devtools profile stop
  86. agent-react-devtools profile slow
  87. ```
  88. ```
  89. Slowest (by avg render time):
  90. @c5 [fn] TodoList avg:4.2ms max:8.1ms renders:6 causes:props-changed changed: props: items, onDelete
  91. @c4 [fn] SearchBar avg:2.1ms max:3.4ms renders:12 causes:hooks-changed changed: hooks: #0
  92. @c2 [fn] Header avg:0.8ms max:1.2ms renders:3 causes:parent-rendered
  93. ```
  94. ## Commands
  95. ### Daemon
  96. ```sh
  97. agent-react-devtools start [--port 8097] # Start daemon
  98. agent-react-devtools stop # Stop daemon
  99. agent-react-devtools status # Connection status
  100. ```
  101. ### Components
  102. ```sh
  103. agent-react-devtools get tree [@c1 | id] [--depth N] [--all] [--max-lines N] # Component hierarchy (subtree)
  104. agent-react-devtools get component <@c1 | id> # Props, state, hooks
  105. agent-react-devtools find <name> [--exact] # Search by display name
  106. agent-react-devtools count # Component count by type
  107. agent-react-devtools errors # Components with errors/warnings
  108. ```
  109. Tree output flags:
  110. - `--depth N` β€” limit tree depth
  111. - `--all` β€” include host components (filtered by default)
  112. - `--max-lines N` β€” hard cap on output lines
  113. Components are labeled `@c1`, `@c2`, etc. You can use these labels or numeric IDs interchangeably.
  114. Components with errors or warnings are annotated in tree and search output:
  115. ```
  116. @c5 [fn] Form ⚠2 βœ—1
  117. ```
  118. Use the `errors` command to list only components with issues. When no app is attached, it exits 1 with `No React app is attached` rather than reporting a clean tree:
  119. ```sh
  120. agent-react-devtools errors
  121. ```
  122. ```
  123. @c5 [fn] Form ⚠2 βœ—1
  124. @c8 [fn] Input βœ—3
  125. ```
  126. ### Wait
  127. Block until a condition is met. Useful in scripts or agent workflows where the daemon starts before the app:
  128. ```sh
  129. agent-react-devtools wait --connected [--timeout 30] # Block until an app connects
  130. agent-react-devtools wait --component App [--timeout 30] # Block until a component appears
  131. ```
  132. Exits with code 0 when the condition is met, or code 1 on timeout.
  133. ### Profiling
  134. ```sh
  135. agent-react-devtools profile start [name] # Begin a profiling session
  136. agent-react-devtools profile stop # Stop and collect data
  137. agent-react-devtools profile report <@c1 | id> # Render report for a component
  138. agent-react-devtools profile slow [--limit N] # Slowest components by avg duration
  139. agent-react-devtools profile rerenders [--limit N] # Most re-rendered components
  140. agent-react-devtools profile timeline [--limit N] # Commit timeline
  141. agent-react-devtools profile commit <N | #N> [--limit N] # Single commit detail
  142. agent-react-devtools profile export <file> # Export as React DevTools Profiler JSON
  143. agent-react-devtools profile diff <before.json> <after.json> [--limit N] [--threshold N] # Compare two exports
  144. ```
  145. ## Connecting Your App
  146. ### Quick setup
  147. For Vite, Next.js, and Create React App, run `init` in the project root to
  148. patch the appropriate web entry or config:
  149. ```sh
  150. npx agent-react-devtools init
  151. ```
  152. For standard React Native and Expo projects, `init` also configures Metro and a
  153. reachable app module. It supports existing CommonJS (`.js`/`.cjs`) Metro
  154. configs and creates one when none exists. Use the manual setup below for ESM,
  155. TypeScript, JSON/package-field, custom `--config`, or ambiguous Metro setups.
  156. To undo these changes:
  157. ```sh
  158. npx agent-react-devtools uninit
  159. ```
  160. ### Web one-line import
  161. Add a single import as the first line of your entry point (e.g. `src/main.tsx`):
  162. ```ts
  163. import "agent-react-devtools/connect";
  164. ```
  165. This handles everything: deleting the Vite hook stub, initializing react-devtools-core, and connecting via WebSocket. Your app is never blocked β€” if the daemon isn't running, it times out after 2 seconds.
  166. ### Vite plugin
  167. For Vite apps, use the plugin instead β€” no changes to your app code needed:
  168. ```ts
  169. // vite.config.ts
  170. import { defineConfig } from "vite";
  171. import react from "@vitejs/plugin-react";
  172. import { reactDevtools } from "agent-react-devtools/vite";
  173. export default defineConfig({
  174. plugins: [reactDevtools(), react()],
  175. });
  176. ```
  177. The plugin only runs in dev mode (`vite dev`), not in production builds.
  178. Options:
  179. ```ts
  180. reactDevtools({ port: 8097, host: "localhost" });
  181. ```
  182. ### React Native
  183. > Before React Native 0.87, standalone DevTools connected automatically without
  184. > code changes. React Native 0.87 removed that path, so the setup below is now
  185. > required.
  186. ```sh
  187. npm install --save-dev agent-react-devtools
  188. ```
  189. Both of the following steps are required.
  190. `npx agent-react-devtools init` performs both steps automatically for the
  191. common CommonJS Metro configurations and entries it recognizes: `package.json`
  192. `main`, Expo Router's root layout, bare `index.*`, and Expo `App.*`. It patches
  193. all available platform-specific entries when a shared entry does not exist.
  194. The CLI first preflights every target and leaves files unchanged when it cannot
  195. safely identify the config or entry. `uninit` removes only its marked edits.
  196. #### 1. Wrap the final Metro config
  197. For a bare React Native app:
  198. ```js
  199. // metro.config.js
  200. const { getDefaultConfig, mergeConfig } = require("@react-native/metro-config");
  201. const { withAgentReactDevTools } = require("agent-react-devtools/metro");
  202. const projectConfig = {};
  203. const config = mergeConfig(getDefaultConfig(__dirname), projectConfig);
  204. module.exports = withAgentReactDevTools(config);
  205. ```
  206. For Expo:
  207. ```js
  208. // metro.config.js
  209. const { getDefaultConfig } = require("expo/metro-config");
  210. const { withAgentReactDevTools } = require("agent-react-devtools/metro");
  211. const config = getDefaultConfig(__dirname);
  212. module.exports = withAgentReactDevTools(config);
  213. ```
  214. Apply `withAgentReactDevTools` outermost, after all other Metro configuration
  215. and wrappers. It preserves the final config's existing serializer hooks and
  216. adds the agent bootstrap after React Native's own pre-main initialization.
  217. #### 2. Import the bootstrap from the entry graph
  218. Add this import to a user-owned module that is always reachable from the app
  219. entryβ€”for example, bare React Native's `index.js` or Expo Router's
  220. `app/_layout.tsx`:
  221. ```ts
  222. import "agent-react-devtools/react-native";
  223. ```
  224. The import makes the bootstrap part of Metro's dependency graph. The Metro
  225. wrapper then executes that module before application modules; its textual
  226. position among imports does not control the execution order.
  227. #### Run and verify
  228. The client and daemon use port 8097 by default:
  229. ```sh
  230. # Terminal 1
  231. agent-react-devtools start
  232. # Terminal 2 β€” restart Metro after changing metro.config.js
  233. npx react-native start
  234. # Expo: npx expo start
  235. # Terminal 3
  236. agent-react-devtools status
  237. agent-react-devtools wait --connected --timeout 30
  238. agent-react-devtools get tree
  239. ```
  240. For an Android device connected over USB, forward the DevTools port before
  241. launching the app:
  242. ```sh
  243. adb reverse tcp:8097 tcp:8097
  244. ```
  245. This integration connects only from a native development runtime. Native
  246. production builds exit without connecting; browser and default/server imports
  247. resolve to no-op modules.
  248. If `status` reports zero connected apps:
  249. 1. Confirm both the Metro wrapper and graph import are present.
  250. 2. Ensure `withAgentReactDevTools` wraps the final config, outside other Metro wrappers.
  251. 3. Stop and restart Metro; if its cache is stale, use `--reset-cache` (bare) or `npx expo start -c`.
  252. 4. Confirm the daemon is listening on 8097 and repeat `adb reverse` for Android devices.
  253. 5. Check that the app is a development build.
  254. #### Manual fallback
  255. Configure the two steps above manually when Metro uses ESM (`.mjs`),
  256. TypeScript, JSON or a package-field configuration; when your app starts Metro
  257. with a custom `--config`; or when the CLI reports an ambiguous config or entry.
  258. Keep `withAgentReactDevTools` as the final outermost wrapper.
  259. ## Using with agent-browser
  260. When using `agent-browser` to drive the app (e.g. for profiling interactions), you **must use headed mode**. Headless Chromium does not properly execute the devtools connect script:
  261. ```sh
  262. agent-browser --session devtools --headed open http://localhost:5173/
  263. agent-react-devtools status # Should show "Apps: 1 connected"
  264. ```
  265. ## Using with AI Coding Assistants
  266. Add the skill to your AI coding assistant for richer context:
  267. ```sh
  268. npx skills add callstackincubator/agent-react-devtools
  269. ```
  270. This works with Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Goose, OpenCode, and Windsurf.
  271. ### Claude Code plugin
  272. You can also install via the Claude Code plugin marketplace:
  273. ```
  274. /plugin marketplace add callstackincubator/agent-react-devtools
  275. /plugin install agent-react-devtools@piotrski
  276. ```
  277. ### Codex
  278. Codex discovers project skills from `AGENTS.md`. This repo includes one at the root that registers:
  279. - `packages/agent-react-devtools/skills/react-devtools/SKILL.md`
  280. ### Manual setup
  281. If your assistant does not auto-load skills, add something like this to your project's `AGENTS.md`, `CLAUDE.md`, or equivalent agent instructions:
  282. ```markdown
  283. ## React Debugging
  284. This project uses agent-react-devtools to inspect the running React app.
  285. - `agent-react-devtools start` β€” start the daemon
  286. - `agent-react-devtools status` β€” check if the app is connected
  287. - `agent-react-devtools get tree` β€” see the component hierarchy
  288. - `agent-react-devtools get tree @c5` β€” see subtree from a specific component
  289. - `agent-react-devtools get component @c1` β€” inspect a specific component
  290. - `agent-react-devtools find <Name>` β€” search for components
  291. - `agent-react-devtools errors` β€” list components with errors or warnings
  292. - `agent-react-devtools profile start` / `profile stop` / `profile slow` β€” diagnose render performance
  293. ```
  294. ## Development
  295. ```sh
  296. bun install # Install dependencies
  297. bun run build # Build
  298. bun run test # Run tests
  299. bun run typecheck # Type check
  300. ```
  301. ## License
  302. MIT

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.