I Built a GitHub Action That Uses AI to Explain Why Your CI Failed

Published: (January 9, 2026 at 10:00 AM EST)
2 min read
Source: Dev.to

Source: Dev.to

How I Built It

I used Claude Code (Anthropic’s CLI tool) to build the entire thing in one session. Went from idea to working GitHub Action in about an hour — including the DM feature I added halfway through because I thought “wouldn’t it be cool if it messaged the person who broke the build directly?”

Claude Code handled everything: the GitHub Actions setup, Slack API integration, log parsing, and even wrote the README. Pretty wild experience, honestly.

What It Does

When your workflow fails:

  • Fetches the logs from the failed job
  • Sends them to Claude for analysis

Posts a summary to Slack with:

  • Root cause — what actually broke
  • The error — the specific message
  • Suggested fix — actionable next step
  • Link to the full logs

The Cool Part: DM the Person Who Broke the Build

Instead of posting to a channel, you can configure it to DM the committer directly. It looks up their GitHub email in Slack and sends them a private message.

No more “@channel who broke the build?” — the person responsible gets notified instantly.

Example Output

CI Failed: Build and Test

Repository: your-org/your-repo
Branch: feature/new-feature  
Commit: abc1234
Failed Jobs: test

---

1. **Root Cause**: Test assertion failed due to incorrect mock data
2. **Error**: Expected 200 but received 404 in api.test.js:42
3. **Suggested Fix**: Update the mock endpoint URL to match the new API route

Setup (2 Minutes)

notify-on-failure:
  runs-on: ubuntu-latest
  needs: [build, test]
  if: failure()
  steps:
    - uses: galion96/ci-failure-sumarizer@v1
      with:
        anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
        slack_bot_token: ${{ secrets.SLACK_BOT_TOKEN }}
        notification_mode: dm  # or 'channel' for webhook

Cost

Using Claude Sonnet: ~ $0.01 per failure. If your CI fails 100 times a month, that’s $1.

Back to Blog

Related posts

Read more »

Hello, Newbie Here.

Hi! I'm falling back into the realm of S.T.E.M. I enjoy learning about energy systems, science, technology, engineering, and math as well. One of the projects I...