test-failure-analysis

test-failure-analysis is a command for Claude Code from vishnu2kmohan/mcp-server-langgraph. It costs 10 tokens per session (3,813 once invoked), scanned A, original, MIT.

A command for investigating failed software tests and finding their likely underlying causes.

In plain words
What is it for?
Running tests, grouping failures, examining error output, prioritising likely causes, and producing an actionable report.
Why use it?
It helps turn a long list of failed tests, error messages, and stack traces into grouped problems and suggested fixes.

Command for Claude Code

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/vishnu2kmohan/mcp-server-langgraph/test-failure-analysis
Clone the repo
git clone --depth 1 https://github.com/vishnu2kmohan/mcp-server-langgraph

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 test-failure-analysis

README.md
[![agentmods](https://agentmods.dev/badge/commands/vishnu2kmohan/mcp-server-langgraph/test-failure-analysis.svg)](https://agentmods.dev/commands/vishnu2kmohan/mcp-server-langgraph/test-failure-analysis)
Your own site
<a href="https://agentmods.dev/commands/vishnu2kmohan/mcp-server-langgraph/test-failure-analysis"><img src="https://agentmods.dev/badge/commands/vishnu2kmohan/mcp-server-langgraph/test-failure-analysis.svg" alt="Measured on agentmods" height="20"></a>
Per session 10 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,813 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.00010 $0.03813
Opus 5 $0.00005 $0.01906
Sonnet 5 $0.00002 $0.00763
Haiku 4.5 $0.00001 $0.00381

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

Security

Grade A, and why

test-failure-analysis 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.

.claude/commands/test-failure-analysis.md · 680 lines

How it starts

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

Test Failure Analysis

Usage: /test-failure-analysis or /test-failure-analysis --deep

Purpose: Comprehensive analysis of test failures with root cause identification


🔬 What This Command Does

Performs deep analysis of test failures to identify root causes and suggest fixes:

  1. Runs tests and captures all failures
  2. Groups failures by pattern/category
  3. Analyzes stack traces and error messages
  4. Identifies common root causes
  5. Suggests fixes with priority
  6. Generates actionable report

📊 Analysis Workflow

Step 1: Run Tests and Capture Failures

Execute test suite with detailed output:

# Run all tests, don't stop on first failure
uv run --frozen pytest tests/ -v --tb=short --maxfail=100 2>&1 | tee /tmp/test_output.txt

# Alternative: Only run previously failed tests
uv run --frozen pytest --lf -v --tb=long 2>&1 | tee /tmp/test_failures.txt

# Count failures
FAILURES=$(grep -c "FAILED" /tmp/test_output.txt)
ERRORS=$(grep -c "ERROR" /tmp/test_output.txt)
PASSED=$(grep -c "PASSED" /tmp/test_output.txt)

echo "Results: $PASSED passed, $FAILURES failed, $ERRORS errors"

Step 2: Extract Failure Information

Parse test output to extract structured data:

# Extract failed test names
grep "FAILED" /tmp/test_output.txt | \
  sed 's/FAILED //' | \
  sed 's/ - .*//' > /tmp/failed_tests.txt

# Extract error types
grep -A 5 "FAILED\|ERROR" /tmp/test_output.txt | \
  grep -E "Error|Exception|assert" > /tmp/error_types.txt

# Extract file locations
grep "FAILED" /tmp/test_output.txt | \
  sed 's/::.*//' | \
  sort | uniq -c | \
  sort -rn > /tmp/failing_files.txt

Step 3: Categorize Failures

Group failures by error pattern:

Categories:

Assertion Failures (Logic Errors):

AssertionError: assert X == Y
AssertionError: assert result is not None

Import/Module Errors:

ImportError: cannot import name
ModuleNotFoundError: No module named

Async/Event Loop Errors:

RuntimeError: Event loop is closed
asyncio.TimeoutError
RuntimeError: This event loop is already running

Read the full file on GitHub · 680 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 · 680 lines · 10 tokens per session scan A 102bbdb5c097

Subscribe to this mod's changes

test-failure-analysis is a command published in the GitHub repository vishnu2kmohan/mcp-server-langgraph (4 stars, last pushed 11d ago), licensed MIT. It adds 10 tokens to every session and 3,813 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-31.