Skip to content

Reference

Debugging

The debugging skill provides knowledge for diagnosing problems in React Native apps using the CDP MCP server, native device logs, and bash tools.

Activates when Claude encounters crashes, blank screens, connection issues, error logs, Metro problems, network failures, or any diagnostic task.

What you needToolCommand
Metro statusMCPcdp_status
JS crashMCPcdp_error_log
Native crash (iOS)MCPcollect_logs(sources=["native_ios"])
Native crash (Android)MCPcollect_logs(sources=["native_android"])
Current screenMCPcdp_navigation_state
Component treeMCPcdp_component_tree(filter="...")
Store stateMCPcdp_store_state(path="...")
API callsMCPcdp_network_log
Console outputMCPcdp_console_log(level="all")
RedBox overlay?MCPcdp_component_tree (auto-detects)
Metro alive?MCPcdp_status
UI element treeMCPdevice_snapshot
Runtime valueMCPcdp_evaluate(expression="...")

If cdp_error_log is empty but the app is broken, the problem is native.

Error TypeWhere to Find
JS runtime errorcdp_error_log
Unhandled promise rejectioncdp_error_log
RedBox overlaycdp_component_tree (APP_HAS_REDBOX)
console.error()cdp_console_log(level="error")
Metro bundle syntax errorcdp_metro_events
Native crash (iOS)collect_logs(sources=["native_ios"])
Native crash (Android)collect_logs(sources=["native_android"])
Network failurecdp_network_log (status=0)

Call rn_session(action="status") first, then passive cdp_status.

  • Missing Metro or bundle binding means repair the session through the integrated package script.
  • A disconnected exact target means open the bound app and call cdp_connect.
  • Use cdp_component_tree for helper and RedBox health.
  • Use cdp_error_log for active JavaScript errors.
  • For HELPERS_NOT_INJECTED, read bounded meta.helperHealth and follow the packaged debugging skill’s recovery order; a probe timeout does not prove a JavaScript hang.
SymptomFix
Metro not foundInspect rn_session, then use literal pnpm ios or pnpm android
No Hermes targetWait for the bound app to load, then call cdp_connect
Error code 1006Close other debugger UIs (DevTools, Flipper, Chrome)
Evaluate timeout (5s)Search for debugger; statements, check for long sync ops
”hook not available”Only works in __DEV__ mode with Hermes
APP_HAS_REDBOXRead error log, fix code, reload
”No store found”Add if (__DEV__) global.__ZUSTAND_STORES__ = { ... }
All CDP calls failReload the bound app and reconnect with cdp_connect
  • 5-second timeout on all CDP calls (caused by debugger; statements, long sync ops, unresolved promises)
  • Single CDP session (Hermes allows exactly one client; close DevTools/Flipper first)
  • Fiber tree limitations: only works in __DEV__ + Hermes; component in tree does not mean visible on screen

After cdp_reload, auto-reconnect waits up to 30 seconds. If cdp_component_tree returns “No fiber roots”, wait 2 seconds and retry.

Call rn_session(action="status") to inspect the bound Metro authority, then use cdp_status for passive runtime health and cdp_metro_events for bundle failures. Ambient default ports are diagnostic only and never establish session authority.