nav-graph

nav-graph is a command for coding agents from Lykhoyda/rn-dev-agent. It costs 21 tokens per session (735 once invoked), scanned A, original, MIT.

A command that builds a map of an app's navigation: its screens, navigators, and the routes between them. A navigator is the part of a mobile app that controls moving between screens.

In plain words
What is it for?
Use it to scan the navigation graph, read the saved map, find a screen, or navigate to a named screen.
Why use it?
It makes the app's screen structure easier to inspect and shows which parts have not yet been visited during scanning.

Command

Part of the rn-dev-agent plugin — 11 skills, 16 commands, 5 agents, 6 hooks shipped together

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/nav-graph
Clone the repo
git clone --depth 1 https://github.com/Lykhoyda/rn-dev-agent

Or install rn-dev-agent, the plugin that ships this one along with the rest of its 11 skills, 16 commands, 5 agents, 6 hooks.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for nav-graph

README.md
[![agentmods](https://agentmods.dev/badge/commands/lykhoyda/rn-dev-agent/nav-graph.svg)](https://agentmods.dev/commands/lykhoyda/rn-dev-agent/nav-graph)
Your own site
<a href="https://agentmods.dev/commands/lykhoyda/rn-dev-agent/nav-graph"><img src="https://agentmods.dev/badge/commands/lykhoyda/rn-dev-agent/nav-graph.svg" alt="Measured on agentmods" height="20"></a>
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 735 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.00735
Opus 5 $0.00010 $0.00367
Sonnet 5 $0.00004 $0.00147
Haiku 4.5 $0.00002 $0.00073

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

Security

Grade A, and why

nav-graph 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 4d 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/nav-graph.md · 71 lines

How it starts

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

You are mapping the navigation topology of a React Native app. Follow the subcommand below.

Parsing Arguments

  • If $ARGUMENTS is empty or scan → run Scan
  • If $ARGUMENTS is read → run Read
  • If $ARGUMENTS starts with find → extract screen name from remaining text, run Find
  • If $ARGUMENTS starts with navigate or goto → extract screen name, run Navigate

Scan

  1. Call cdp_nav_graph with action="scan".
  2. Display results as a table:
    • Navigator count, screen count, coverage percentage
    • List of navigators with their kind, screen count, and active screen
    • If not first scan: show new routes and removed routes
  3. Note the file path where the graph was saved.
  4. If coverage < 100%, note which navigators are unvisited and suggest navigating to them to expand the graph.

Read

  1. Call cdp_nav_graph with action="read".
  2. If no cached graph exists, suggest running scan first.
  3. Display the full navigator tree in a readable format:
    root (tab) — 3 screens [active: Home]
      ├── Home (stack) — 4 screens [active: ProductList]
      │     ProductList, ProductDetail, Search, Categories
      ├── Cart (native-stack) — 3 screens
      │     CartList, Checkout, OrderConfirmation
      └── Profile (stack) — 2 screens
            ProfileView, EditProfile
    
  4. Show metadata: last scanned, scan count, project, router type.
  5. If stale (>24h), suggest re-scanning.

Find

  1. Call cdp_nav_graph with action="read" and screen="<name>".
  2. Display the screen's location: which navigator, navigator kind, path from root.
  3. Show the screen's properties: path, params, reliability score, visit count.
  4. Suggest the navigation approach:
    • If the screen is in a tab navigator: "Navigate to parent tab, then to screen"
    • If in a stack: "Push onto the stack from the parent screen"
    • If path exists: "Deep link available: "
  1. Call cdp_nav_graph with action="navigate" and screen="<name>".
  2. If no graph exists, suggest running scan first.
  3. Display the navigation plan:
    • Number of steps and estimated reliability
    • Each step: action type, target screen, navigator kind
    • Prerequisites (auth, permissions) if detected
    • Deep link alternative if available
  4. Ask the user: "Execute this plan?" If yes:
    • For each programmatic step: call cdp_navigate(screen="<target>")
    • After each step: verify with cdp_navigation_state
    • Report success/failure for each step
  5. If a step fails:
    • Try device_find + device_press as UI fallback
    • If still fails, report and ask user for guidance

Read the full file on GitHub · 71 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. 4d ago First seen · 71 lines · 21 tokens per session scan A 21e78e9641f4

Subscribe to this mod's changes

nav-graph is a command published in the GitHub repository Lykhoyda/rn-dev-agent (11 stars, last pushed today), licensed MIT. It adds 21 tokens to every session and 735 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.