Maestro: Agent for Claude Code

.claude/agents/diagnose-maestro-failure.md

diagnose-maestro-failure is an agent for Claude Code from mobile-dev-inc/Maestro. It costs 98 tokens per session (1,696 once invoked), scanned A, original, Apache-2.0.

A diagnostic agent analyzes failed Maestro Android tests. Maestro is a tool for automating mobile-app tests, and CI artifacts are the logs and screenshots saved by an automated build.

In plain words
What is it for?
Reading local test artifacts or a GitHub Actions run, identifying failures in the passing test suite, and reporting their likely causes.
Why use it?
It turns test commands, screenshots, and logs into a structured explanation of newly failing flows without filling the main assistant's context.

Agent for Claude Code

Written for Claude Code: installed under .claude/. Also seen: mentions subagents.

This is mobile-dev-inc/Maestro's own configuration. It tells Claude Code how to work on Maestro itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything Maestro configures →

Not installable: its command points at a path on the author’s own machine, so it runs nowhere else. The line is /Users/.../maestro-root-dir-android.

About the project

Maestro is a testing framework for automating user-interface and end-to-end tests for Android, iOS, and web applications. Testers define interactions in human-readable YAML flows and run them on emulators, simulators, browsers, or real devices. The catalogue includes skills, instructions, and an agent for using Maestro.

mobile-dev-inc/Maestro · 15,513 stars · on GitHub · maestro.dev

Reuse

Borrowing it

Nothing to install: this file belongs to mobile-dev-inc/Maestro. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/mobile-dev-inc/Maestro/main/.claude/agents/diagnose-maestro-failure.md
Clone the repo
git clone --depth 1 https://github.com/mobile-dev-inc/Maestro

Made for: Claude Code.

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 diagnose-maestro-failure

README.md
[![agentmods](https://agentmods.dev/badge/agents/mobile-dev-inc/maestro/diagnose-maestro-failure.svg)](https://agentmods.dev/agents/mobile-dev-inc/maestro/diagnose-maestro-failure)
Your own site
<a href="https://agentmods.dev/agents/mobile-dev-inc/maestro/diagnose-maestro-failure"><img src="https://agentmods.dev/badge/agents/mobile-dev-inc/maestro/diagnose-maestro-failure.svg" alt="Measured on agentmods" height="20"></a>
Per session 98 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,696 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00098 $0.01696
Opus 5 $0.00049 $0.00848
Sonnet 5 $0.00020 $0.00339
Haiku 4.5 $0.00010 $0.00170

Measured 7d ago against content hash e78cbef192c2, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

diagnose-maestro-failure 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 7d 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.

.claude/agents/diagnose-maestro-failure.md · 118 lines

How it starts

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

Diagnose Maestro Failure (subagent)

You diagnose Maestro test-android failures from CI artifacts and return a structured report. You do not modify code, commit, or push — the caller handles consent and application.

Input

The caller passes one of:

  • Local artifact directory — e.g. /Users/.../maestro-root-dir-android or /tmp/maestro-android-<run_id>. Must contain a tests/ subtree.
  • GitHub Actions URLhttps://github.com/mobile-dev-inc/Maestro/actions/runs/<run_id> or .../runs/<run_id>/job/<job_id>.

If a URL, extract the run_id and download:

RUN_ID=<extracted>
DEST=/tmp/maestro-android-$RUN_ID
gh run download "$RUN_ID" --repo mobile-dev-inc/Maestro \
  --name maestro-root-dir-android -D "$DEST"

If the directory has no tests/demo_app/passing/ subtree (e.g. iOS artifact, or the run failed before tests), report that and stop.

Where to Look

Only <artifact_root>/tests/demo_app/passing/ is signal. failing/ is the negative-path suite — its commands are supposed to fail. Ignore it entirely.

cd <artifact_root>/tests/demo_app/passing
grep -l '"FAILED"' commands-*.json

The status field lives at .[].metadata.status. Possible values: COMPLETED (success) and FAILED (terminal failure). commands-*.json is the only authoritative source — screenshot-❌-*.png is not.

commands-(retry).json is the canonical example. This flow exercises the retryCommand directive: a tap fails, Maestro retries it, the retry succeeds, and the flow passes. In the artifact:

  • All entries (including the recovered tapOnElement) have metadata.status = "COMPLETED" — Maestro writes only the final outcome of a recovered command, not the failed attempt.
  • A screenshot-❌-<ts>-(retry).png still exists, captured at the moment of the failed attempt before the retry succeeded.
  • The grep above does not match this file (no "FAILED" string anywhere), so the agent never investigates it. This is correct behaviour.

The risk is treating the screenshot as evidence of failure on its own. Don't. Trust the candidates from grep — they are the flows whose JSON contains a terminal FAILED. Any other screenshot in passing/ is from a recovered retry and is irrelevant.

Read the full file on GitHub · 118 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. 7d ago First seen · 118 lines · 98 tokens per session scan A e78cbef192c2

Subscribe to this mod's changes

diagnose-maestro-failure is an agent published in the GitHub repository mobile-dev-inc/Maestro (15,513 stars, last pushed yesterday), licensed Apache-2.0. It adds 98 tokens to every session and 1,696 once invoked, about $0.0005 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.