check-env

A readiness check for a React Native testing setup, including the development server, app target, device list, and connection to the running app. React Native is a framework for building mobile apps with JavaScript and native components.

In plain words
What is it for?
Use it before testing to check the session, connection, device inventory, and app surface, then apply the matching remedy for menus, pickers, or first-run screens.
Why use it?
It shows whether the required testing pieces are available before you try to navigate or inspect the app, and identifies which foreground screen needs attention.

Command

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/lykhoyda/rn-dev-agent/check-env
Clone the repo
git clone --depth 1 https://github.com/Lykhoyda/rn-dev-agent
Per session 21 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,231 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00021 $0.01231
Opus 5 $0.00010 $0.00616
Sonnet 5 $0.00004 $0.00246
Haiku 4.5 $0.00002 $0.00123

Measured yesterday against content hash 09f19c8913c7, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

check-env scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

packages/claude-plugin/commands/check-env.md · 78 lines

How it starts

The opening of the file, as written. The whole thing — 78 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Run rn_session(action="status"), then passive cdp_status, and report environment readiness. Use device_list only as diagnostic inventory; never turn an ambient port or the first available device into authority.

Before navigation, run the cross-platform foreground-surface preflight on the authority-bound device. This preflight belongs to the attaching rn-dev-agent session; launch or foreground helpers, including rn-qa, stop before native-UI dismissal. Connect the exact signed target when CDP is not already connected, capture one fresh device_snapshot, classify the foreground, and invoke exactly one matching remedy:

When the snapshot returns meta.foregroundSurface and a structured meta.recommendation, invoke exactly its tool with its arguments; the first supported point-of-need recommendation is expo_dev_menu -> cdp_dev_settings({ action: "hideDevMenu" }).

Foreground surface Single remedy
Expo Developer Menu sheet cdp_dev_settings(action="hideDevMenu")
Expo Development servers picker cdp_dismiss_dev_client_picker
Expo first-run tutorial Replay the compatible owned locked/helper action through cdp_run_action
React Native core dev menu Stop: no authority-approved close remedy exists
App None

Capture a second fresh snapshot after a remedy and require the app surface before navigation. An ordinary React Native core dev menu is a truthful stop; disableDevMenu only disables future shake opening and does not close a visible menu. DEV_MENU_HIDE_UNVERIFIED means the close call was sent but the surface is still occluded or could not be proven clean: classify again and do not fall back to coordinates or BACK. DEV_MENU_HIDE_FAILED means no close call was sent and also requires a fresh classification. Keep USB transport as a separate readiness axis; never classify it as a menu state. System dialogs and app-owned native overlays have separate owners and never inherit the Expo menu remedy. Do not use coordinates, screen-wide label search, raw shell UI, or a generic native-window action as a fallback.

Check each subsystem and report status as a table:

Subsystem What to check Source
Source declaration Git app roots declare nothing. Before the supervisor starts for a non-Git app root, check RN_DEV_AGENT_DECLARED_ROOT and RN_DEV_AGENT_DECLARED_MANIFESTS against the session-authority contract git rev-parse --show-toplevel, then the two variables in the supervisor environment
Session Ready state, worktree, app, platform, exact device, Metro binding, and migration readiness rn_session(action="status")
Metro Allocated and bound port for this session rn_session, then cdp_statusmetro
CDP Exact authority-bound target connected? rn_session, then cdp_statuscdp
Device inventory Intended UUID/serial still present? device_list, compared with the session binding

If issues are found, suggest the appropriate fix:

Status Fix
NON_GIT_MANIFEST_REQUIRED Report this before setup or build, name the missing RN_DEV_AGENT_DECLARED_ROOT or RN_DEV_AGENT_DECLARED_MANIFESTS declaration, and point to the session-authority contract
Session state: blocked Another session owns this worktree. Report recoveryRequirement.nextAction verbatim (plus startupCleanupBlocked when present) and stop — do not run setup, do not bind a device, do not pick another booted device. See using-rn-dev-agent § "Session ownership recovery"
Session missing or genuinely unbound (not blocked) Run setup, review/apply the integration preview, and bind the intended device and app
Metro not found Use literal pnpm ios or pnpm android through the confirmed integration
No Hermes target Open the bound app, then call cdp_connect for the exact signed target
CDP code 1006 Close React Native DevTools, Flipper, Chrome DevTools
cdp_component_tree reports RedBox Run /rn-dev-agent:debug-screen
Narrow gated CDP read times out Check for a blocked JS thread, then use cdp_reload
HELPERS_NOT_INJECTED Read bounded meta.helperHealth; use a __DEV__ Hermes build and retry through the gated tool after reload
No devices in device_list Boot a simulator: xcrun simctl boot "iPhone 16" or start an emulator

Read the full file on GitHub · 78 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 78 lines · 21 tokens per session scan A 09f19c8913c7

Subscribe to this mod's changes

check-env is a command published in the GitHub repository Lykhoyda/rn-dev-agent (11 stars, last pushed yesterday), licensed MIT. It adds 21 tokens to every session and 1,231 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.