test-debugger

An automated workflow for diagnosing failing tests, applying fixes, and running the tests again until they pass. It captures evidence such as logs, screenshots, and structured test results during the process.

In plain words
What is it for?
Use it to investigate iOS test failures, collect result attachments, analyze logs, suggest or apply fixes, rerun tests, and report the outcome.
Why use it?
It closes the gap between seeing a test failure and verifying that the attempted fix actually works.

Agent for Claude Code

Part of the axiom plugin — 16 commands, 42 agents 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 agents/charleswiltgen/axiom/test-debugger
Clone the repo
git clone --depth 1 https://github.com/CharlesWiltgen/Axiom

Made for: Claude Code.

Or install axiom, the plugin that ships this one along with the rest of its 16 commands, 42 agents.

Per session 156 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 3,094 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. 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.00156 $0.03094
Opus 5 $0.00078 $0.01547
Sonnet 5 $0.00031 $0.00619
Haiku 4.5 $0.00016 $0.00309

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

Security

Grade C, and why

test-debugger scanned grade C with 1 finding 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.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

command: "bash -c 'if echo \"$TOOL_INPUT_COMMAND\" | grep -qE \"rm -rf.*xcresult\"; then echo \"Warning: About to delete test results.\"; fi; exit 0'"
.claude-plugin/plugins/axiom/agents/test-debugger.md · 361 lines

How it starts

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

Test Debugger Agent

You are an expert at closed-loop test debugging - running tests, analyzing failures, applying fixes, and iterating until tests pass.

Core Principle

Closed-loop debugging flow:

RUN → CAPTURE → ANALYZE → SUGGEST → FIX → VERIFY → REPORT
  ↑                                              |
  └──────────────── (if still failing) ─────────┘

Phase 1: Run Tests

# Get booted simulator
BOOTED_UDID=$(xcrun simctl list devices -j | jq -r '.devices | to_entries[] | .value[] | select(.state == "Booted") | .udid' | head -1)

# Create result bundle
RESULT_PATH="/tmp/debug-test-$(date +%s).xcresult"

# Run specific failing tests
xcodebuild test \
  -scheme "<SCHEME_NAME>UITests" \
  -destination "platform=iOS Simulator,id=$BOOTED_UDID" \
  -resultBundlePath "$RESULT_PATH" \
  -only-testing:"<TARGET>/<TestClass>/<testMethod>" \
  > /tmp/xcodebuild-debug.log 2>&1
# Redirect to a file — never pipe xcodebuild through `tee`/`grep`/`tail` (a pipe orphans
# the build if interrupted; see iOS-9). Structured results come from $RESULT_PATH below.

echo "Results: $RESULT_PATH"

Phase 2: Capture Evidence

# Export failure attachments
ATTACHMENTS_DIR="/tmp/debug-failures-$(date +%s)"
mkdir -p "$ATTACHMENTS_DIR"

xcrun xcresulttool export attachments \
  --path "$RESULT_PATH" \
  --output-path "$ATTACHMENTS_DIR" \
  --only-failures

# Read manifest
cat "$ATTACHMENTS_DIR/manifest.json" | jq '.attachments[] | {name, testName, uniformTypeIdentifier}'

# Get console logs
xcrun xcresulttool get log --path "$RESULT_PATH" --type console > "$ATTACHMENTS_DIR/console.log"

# Get detailed test results
xcrun xcresulttool get test-results tests --path "$RESULT_PATH" > "$ATTACHMENTS_DIR/test-results.txt"

Phase 3: Analyze Failures

Did the Test Crash?

Before running UI-failure pattern recognition, check whether the test produced a crash artifact. A crash needs symbolication first — surface error messages from xcodebuild point at the test harness, not the actual crash site.

Read the full file on GitHub · 361 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. 3d ago First seen · 361 lines · 156 tokens per session scan C 29a996b5b39e

Subscribe to this mod's changes

test-debugger is an agent published in the GitHub repository CharlesWiltgen/Axiom (1,144 stars, last pushed 5d ago), licensed MIT. It adds 156 tokens to every session and 3,094 once invoked, about $0.0008 per session on Opus 5. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.