phone_run — Claude Code prompt: what it does, how to install
The phone_run Claude Code prompt runs a sequence of phone commands. It checks the current accessibility tree before each action, so clear screen conditions can guide the next step without another model decision.
Apache-2.0 ★ 9,488 updated 2026-11-16
.claude/commands/phone_run.mdWhat phone_run does
phone_run executes phone commands and looks up each target in the current accessibility tree before acting. Its commands cover launching an app, tapping, typing, scrolling, swiping, waiting for text, and checking what appears on screen. A whenText condition can gate a command on visible text.
Execution stops if a target is missing or ambiguous, a condition fails, an action errors, the app switches, or the screen needs visual review. Each phone action uses the normal execution path and is recorded. Use phone_collect for long lists or chat history; after reading the final screen, another call can continue the sequence.
What it helps with
- run app actions based on labels or visible conditions
- enter text after checking the target screen
- halt a sequence when a target is ambiguous or an app switch occurs
- gather a long list or chat history with
phone_collect
Example prompts for the agent
- Open
com.example.appand tap the “Sign in” button. - Enter the username in the “Login” field, then press Enter.
- Wait until “Done” appears and inspect the screen.
How to install phone_run
Manually: put the files in place
.claude/commands/phone_run.mdHow to use
Paste the text at the start of a chat or into project instructions
Questions about phone_run
How do I install phone_run in Claude Code?
Place the prompt file at .claude/commands/phone_run.md.
What does phone_run do?
It runs a sequence of phone commands and looks up each target in the current accessibility tree before acting. It stops on an ambiguous target, a failed action, or a screen that needs visual review.
When does phone_run stop the sequence?
It stops for a missing or ambiguous target, an unmet condition, a failed action, an app switch, or a screen requiring visual review.
Source text
phone_run.md · Apache-2.0
Run a sequence of phone commands locally, looking up each target again in the current accessibility tree before acting. Use when the next screen can be handled by a clear condition or label without another model decision. Commands: launch(packageName, optional cold), tap(targetText/resourceId/role or x+y), type(text, optional targetText/resourceId/role and pressEnter), clear(optional target), scroll(direction, amount), swipe(startX,startY,endX,endY,durationMs), key(key), back, wait(targetText,present,timeoutMs), assert(targetText,present), observe. Add whenText to a command to require that text to be visible before it runs. Stop on a missing or ambiguous target, unmet condition, failed action, app switch, or screen needing visual review. Each actual phone action goes through the normal execution path and is recorded. Read the final screen and continue with another call when needed. Use phone_collect to gather long lists or chat history.
© wangzan101 · Apache-2.0 · wangzan101/Mika