

The autonomous performance engineer for React Native. /metrognome: one command turns scattered RN performance tooling into a single, scientific loop — propose → measure → keep/revert — that ships gains it can prove.
Works with Claude Code, OpenAI Codex CLI, Cursor, Gemini CLI, and GitHub Copilot CLI.
Inspired by Andrej Karpathy's /autoresearch. Fully adapted to React Native.
What it solves
React Native performance tooling is powerful but scattered — each tool knows one thing, nothing shares context between sessions, and there's no gate between "this might help" and "this actually helped." metrognome routes each measurement to the right tool and runs a loop with a real gate: one fix at a time, measured N times, kept only if the gain is clearly bigger than the run-to-run wobble — otherwise reverted automatically.

▶ Explore the live 3D map — a real scan of bluesky's social-app — and the live run report.
Install
/plugin marketplace add uphold/metrognome # or a local path to this repo
/plugin install metrognome
Prerequisites: Node ≥ 22 · React Native / Expo app on Metro + Hermes · clean git tree.
Then run Doctor once (/metrognome → 3. Doctor) in your RN app to install the CLI tools and bootstrap .metrognome/.
Scripts need npm install: The SessionStart hook does this automatically inside a Claude session. For by-hand or CI use, run npm install in the plugin directory first.
For Codex · Cursor · Gemini · Copilot: see COMPATIBILITY.md.
Quickstart
Map your app (no device needed)
- Run
/metrognome → select Perf Map 3D.
- metrognome scans the repo, builds a standalone HTML map, and opens it — node size = debt, color = severity.
- Click a hotspot → flaw,
file:line, and the matching fix guide.
- Copy the printed Top-3 command, e.g.
/metrognome listing --target FeedScreen.
By hand (CI / no Claude):
npm run scan -- path/to/your-rn-app --out graph.json
npm run map -- graph.json --out perf-map.html --open
Run the loop
Start it before bed. Wake up to a stack of metric-gated commits.
Pick Autoresearch → preset (or paste a Top-3 command). metrognome picks a hypothesis, applies it, measures N times on the actual device, keeps it if the gain clearly beats the run-to-run wobble, reverts if not — then picks the next hypothesis and does it again. One variable at a time, loop after loop, until the goal is reached or the budget runs out. Real research iterations, zero human interaction.
Needs the live toolchain + Metro + a clean git tree — run Doctor first.
Modes & presets
Menu (/metrognome):
| Mode | What it does |
|---|
| Autoresearch | Pick a preset; asks commit mode + live report (opt-in); runs the autonomous measure→fix→keep/revert loop. |
| Perf Map 3D | Device-free static scan → interactive HTML force-graph → Top-3 hotspots. |
| Doctor | Verifies/installs the toolchain, checks Metro + clean tree, bootstraps .metrognome/ (including config.json). |
| Configurations | View/edit .metrognome/config.json — commit mode, live report, N, k, budget. |
| Senior Engineer Audit | Holistic reasoning scan — finds the structural debt linters miss (Context Provider recreating its value, navigator loading all screens at startup, state lifted high enough that a keystroke re-renders the whole tree). Ranked findings → pick what to fix → gate proves (or reverts) each one. |
Commit shape (commitMode in .metrognome/config.json): per-iteration (default) · one-commit · no-commit.
Presets (Autoresearch):