cloud-run-debug

A read-only command for diagnosing a failing Google Cloud Run service, a platform that runs web services in containers.

In plain words
What is it for?
Use it to inspect recent service errors; with --apply, it can write a proposed fix to a review branch.
Why use it?
It groups large volumes of error logs into a shorter digest before proposing a likely cause, keeping the main investigation focused.

Command

Part of the antigravity-for-claude-code plugin — 2 skills, 10 commands, 1 agent, 2 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/yuting0624/antigravity-for-claude-code/cloud-run-debug
Clone the repo
git clone --depth 1 https://github.com/yuting0624/antigravity-for-claude-code

Or install antigravity-for-claude-code, the plugin that ships this one along with the rest of its 2 skills, 10 commands, 1 agent, 2 hooks.

Per session 49 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,050 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.00049 $0.01050
Opus 5 $0.00024 $0.00525
Sonnet 5 $0.00010 $0.00210
Haiku 4.5 $0.00005 $0.00105

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

Security

Grade A, and why

cloud-run-debug 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 3d 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.

commands/cloud-run-debug.md · 64 lines

What it actually says

Diagnose a broken Cloud Run service. This is a Conductor / Executor split: you (Claude) conduct — confirm scope, reason about the root cause, and propose the fix — while the cheap, high-volume work (pulling and clustering potentially hundreds of error log lines) is offloaded to agy (Gemini) so your context stays lean. You ingest only agy's digest, never the raw logs.

Flags: $ARGUMENTS

Defaults: --since 1h, --limit 200, read-only (diagnosis only). --apply is the only thing that writes anything, and only ever onto a branch for human review. For a chatty service, narrowing --since tightens the digest (and cost) further.

Advanced (engine) flags also exist and can be passed through if the user asks: --severity (minimum severity, default ERROR) and --tier (agy tier for the digest, default flash).

Do this:

  1. Resolve scope. Parse the flags above.

    • --service is required. If it's missing, ask the user which Cloud Run service to diagnose (AskUserQuestion) — there is no "default service".
    • --region is optional; if omitted, logs across all regions are queried. If the user's gcloud config has a default region you can offer it.
    • --project is optional; when omitted the engine falls back to gcloud config's default project. Multi-project users can easily read the wrong project's logs this way, so when --project isn't given, surface the project the engine will use (gcloud config get-value project) and confirm it before reading — or have the user pass --project <id> explicitly.
    • Never ask for or handle credentials/tokens — the engine uses the existing gcloud ADC.
  2. Fetch + digest (delegate to agy — one batch, not parallel). Run the plugin's read-only engine, which pulls severity>=ERROR logs via gcloud logging read and hands them to agy for a structured digest (error clusters / representative stack traces / time distribution / likely root-cause candidates): cloud-debug --service <name> [--region <r>] [--project <id>] [--since <dur>] [--limit <n>]

    • Ingest only the digest it prints — do not re-fetch or paste the raw logs into your context (that lean handoff is where the cost saving comes from).
    • If it exits 3 (permission denied), relay the roles/logging.viewer guidance it printed and stop — the user must grant access first. Exit 4 means gcloud isn't installed.
    • If it reports no matching logs, widen --since / lower severity, or re-confirm the service/region with the user.
  3. Diagnose (you). From the digest, infer the most likely root cause (e.g. a missing env var, an unhandled exception, bad config, a dependency timeout). State the reasoning and the evidence (which cluster / trace supports it). Then propose a concrete fix — the exact code, config, or environment change — and how to verify it.

  4. Apply only if --apply was passed. Default is diagnosis-only; do not modify anything without --apply.

    • Check the working tree first: run git status --short. If it's not clean, stop and confirm with the user — branching now would fold their uncommitted changes into your fix's diff (and any commit). Offer to git stash them, or to work in a separate branch/worktree. Only proceed from a clean base.
    • Work on a dedicated branch (create/switch to one; never the user's working branch).
    • Apply the proposed fix, then show the diff and stop. Do not deploy and do not merge — a human reviews and merges.
    • Confirm before any destructive or hard-to-reverse step.

Keep it tight: the demo is Claude conducting the diagnosis while a cheaper model does the log grunt-work. Report what you delegated, the root cause you landed on, and the fix (plus the diff if --apply).

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. 3d ago First seen · 64 lines · 49 tokens per session scan A 6695503630b7

Subscribe to this mod's changes

cloud-run-debug is a command published in the GitHub repository yuting0624/antigravity-for-claude-code (296 stars, last pushed 6d ago), licensed MIT. It adds 49 tokens to every session and 1,050 once invoked, about $0.0002 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.