debug-screen

A React Native debugging command for finding why the screen shown in a simulator or emulator is wrong, blank, or crashing. It collects clues from the app, device, network, and native system.

In plain words
What is it for?
Use it to capture the broken screen, inspect errors, console output, network requests, component structure, app state, and native crash logs, then apply a targeted fix.
Why use it?
It brings evidence from several parts of the app together, so you do not have to inspect logs and rendered components one by one. It also helps narrow the problem to issues such as JavaScript errors, native crashes, bad data, or navigation.

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/debug-screen
Clone the repo
git clone --depth 1 https://github.com/Lykhoyda/rn-dev-agent
Per session 29 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 611 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.00029 $0.00611
Opus 5 $0.00015 $0.00305
Sonnet 5 $0.00006 $0.00122
Haiku 4.5 $0.00003 $0.00061

Measured 2d ago against content hash 2756969157c3, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

debug-screen 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 2d ago.

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/debug-screen.md · 56 lines

How it starts

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

Diagnose and fix the current screen state on the simulator/emulator.

Run the rn-debugger protocol INLINE (parent session)

Important (GH #31): Do NOT spawn the rn-debugger agent via the Task tool. MCP tools (cdp_*, device_*, collect_logs) are not available in spawned subagents. Execute the debugger protocol directly in this parent session using the rn-debugging and rn-device-control skills as your reference.

Load the rn-debugging skill and follow this diagnostic flow in this session:

  1. Screenshotdevice_screenshot to capture the broken state immediately.
  2. Parallel evidence gathering — call these in parallel:
    • cdp_error_log (JS errors)
    • cdp_console_log (console output)
    • cdp_network_log (recent requests)
    • cdp_component_tree(filter=...) (rendered fiber)
    • collect_logs(sources=["native_ios"]) or ["native_android"] for native crashes
  3. Error type identification — classify: JS error vs native crash vs data mismatch vs navigation issue vs blank screen.
  4. Root cause narrowing — read source files flagged by stack traces, check cdp_store_state(path=...), inspect native logs if CDP shows nothing.
  5. Fix — apply the minimal targeted fix, save, wait for Fast Refresh (or cdp_reload(full=true) for native changes).
  6. Verify recovery — reproduce the failing action AGAIN, confirm the bug no longer reproduces, capture a "fixed" device_screenshot.

Verification (mandatory before declaring "fixed")

  • Root cause stated (not just symptom)
  • Reproduction steps executed AGAIN after the fix → bug gone
  • cdp_error_log shows 0 new errors after fix
  • "Before" and "after" screenshots both saved
  • No adjacent files refactored ("while I'm here")

When to Use

  • The screen is blank or white with no RedBox
  • There is a RedBox / LogBox error showing
  • The UI shows wrong data or is in an unexpected state
  • The app is frozen or unresponsive
  • A network request is failing
  • Navigation went to the wrong screen

Read the full file on GitHub · 56 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. 2d ago First seen · 56 lines · 29 tokens per session scan A 2756969157c3

Subscribe to this mod's changes

debug-screen is a command published in the GitHub repository Lykhoyda/rn-dev-agent (11 stars, last pushed 2d ago), licensed MIT. It adds 29 tokens to every session and 611 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.