deepsource-mcp-server: Command for Claude Code

.claude/commands/analyze-build.md

analyze-build is a command for Claude Code from sapientpants/deepsource-mcp-server. It costs 0 tokens per session (1,956 once invoked), scanned A, original, MIT.

A command that examines a GitHub Actions workflow run, which is an automated build or test job, and explains why it failed. It can inspect the latest run or a run chosen by branch, workflow, pull request, or run ID.

In plain words
What is it for?
Investigating broken builds, failed tests, recurring failure patterns, possible flaky tests, and the likely root cause of a GitHub Actions run.
Why use it?
Failed builds often contain many logs and errors, making the real cause hard to find. This command gathers the relevant failures, messages, timing, commits, and pull-request context into one analysis.

Command for Claude Code

Written for Claude Code: installed under .claude/.

This is sapientpants/deepsource-mcp-server's own configuration. It tells Claude Code how to work on deepsource-mcp-server 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 deepsource-mcp-server configures →

Reuse

Borrowing it

Nothing to install: this file belongs to sapientpants/deepsource-mcp-server. 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/sapientpants/deepsource-mcp-server/main/.claude/commands/analyze-build.md
Clone the repo
git clone --depth 1 https://github.com/sapientpants/deepsource-mcp-server

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 analyze-build

README.md
[![agentmods](https://agentmods.dev/badge/commands/sapientpants/deepsource-mcp-server/analyze-build/github.svg)](https://agentmods.dev/commands/sapientpants/deepsource-mcp-server/analyze-build)
Your own site
<a href="https://agentmods.dev/commands/sapientpants/deepsource-mcp-server/analyze-build"><img src="https://agentmods.dev/badge/commands/sapientpants/deepsource-mcp-server/analyze-build/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for analyze-build

Your own site · 80×15
<a href="https://agentmods.dev/commands/sapientpants/deepsource-mcp-server/analyze-build"><img src="https://agentmods.dev/badge/commands/sapientpants/deepsource-mcp-server/analyze-build.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 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,956 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.00000 $0.01956
Opus 5.5 $0.00000 $0.00782
Sonnet 5.5 $0.00000 $0.00391
Haiku 4.5 $0.00000 $0.00196

Measured 2mo ago against content hash bf1f508b379b, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

analyze-build 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 2mo 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/analyze-build.md · 378 lines

How it starts

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

Analyze GitHub Actions Build

Analyzes a GitHub Actions build to identify failures and their root causes. By default, examines the latest build on the main branch, but you can specify a different run.

Usage

/analyze-build [options]

Options

  • --run-id <id>: Analyze a specific workflow run by ID
  • --branch <name>: Analyze the latest run from a specific branch (default: main)
  • --workflow <name>: Specify which workflow to analyze (default: checks all)
  • --pr <number>: Analyze the latest run for a specific PR

Process

  1. Identify Target Build

    • Default: Latest workflow run on main branch
    • Or use provided run ID, branch, PR, or workflow name
  2. Gather Build Information

    • Workflow run status and conclusion
    • Failed jobs and steps
    • Error logs and annotations
    • Timing information
    • Related commits and PRs
  3. Analyze Failures

    • Parse error messages and stack traces
    • Identify failure patterns
    • Categorize error types
    • Determine root causes
    • Check for flaky test indicators
  4. Generate Report

    • Executive summary
    • Detailed failure analysis
    • Root cause identification
    • Suggested fixes
    • Historical context (if available)

Analysis Categories

1. Test Failures

  • Unit test failures
  • Integration test failures
  • E2E test failures
  • Flaky tests
  • Timeout issues

2. Build Errors

  • Compilation errors
  • TypeScript errors
  • Dependency resolution issues
  • Missing dependencies
  • Version conflicts

3. Linting/Formatting

  • ESLint violations
  • Prettier formatting issues
  • Commit message format
  • Markdown linting
  • YAML validation

4. Infrastructure Issues

  • Runner problems
  • Network failures
  • API rate limits
  • Token/permission issues
  • Resource exhaustion

5. Deployment Failures

  • Docker build issues
  • Registry push failures
  • Security scan violations
  • Release creation problems

Implementation Steps

# 1. Get the target workflow run
echo "🔍 Identifying target build..."

# Default: latest run on main
if [ -z "$RUN_ID" ]; then
  if [ -n "$PR_NUMBER" ]; then
    # Get latest run for PR
    RUN_ID=$(gh pr checks $PR_NUMBER --json statusCheckRollup --jq '.statusCheckRollup[0].workflowRun.databaseId')
  elif [ -n "$WORKFLOW_NAME" ]; then
    # Get latest run for specific workflow
    RUN_ID=$(gh run list --workflow="$WORKFLOW_NAME" --branch="${BRANCH:-main}" --limit=1 --json databaseId --jq '.[0].databaseId')
  else
    # Get latest run on branch
    RUN_ID=$(gh run list --branch="${BRANCH:-main}" --limit=1 --json databaseId --jq '.[0].databaseId')
  fi
fi

# 2. Fetch run details
echo "📊 Fetching run details for #$RUN_ID..."
gh run view $RUN_ID --json status,conclusion,name,workflowName,event,headBranch,headSha

# 3. Get failed jobs
echo "❌ Identifying failed jobs..."
gh run view $RUN_ID --json jobs --jq '.jobs[] | select(.conclusion == "failure")'

# 4. Fetch logs for failed jobs
echo "📝 Analyzing failure logs..."
gh run view $RUN_ID --log-failed

# 5. Get annotations (errors/warnings)
echo "📌 Checking annotations..."
gh api /repos/{owner}/{repo}/check-runs --jq '.check_runs[].output.annotations[]'

Read the full file on GitHub · 378 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. 2mo ago First seen · 378 lines · 0 tokens per session scan A bf1f508b379b

Subscribe to this mod's changes

analyze-build is a command published in the GitHub repository sapientpants/deepsource-mcp-server (7 stars, last pushed 1y ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,956 tokens. 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.

Related

analyze-build compared with commands from other repositories

analyze-build next to 6 commands from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
analyze-buildsapientpants/deepsource-mcp-serverCommand71y agoMITA0Claude Code
preflightcdeust/CortexCommand76yesterdayMITA20Claude Code
bugkorovin-aa97/talkthrough-mcpCommand336d agoMITA31Claude Code
triage-recordingkorovin-aa97/talkthrough-mcpCommand336d agoMITA24Claude Code
correlate-with-logskorovin-aa97/talkthrough-mcpCommand336d agoMITA13Claude Code
umt-doctorMarkgatcha/universal-mcp-toolkitCommand163d agoMITA16Claude Code
ultra-agentsZoeLinUTS/MagicTeX-mcpCommand43d agoAGPL-3.0A0Claude Code