For Claude Code and GitHub pull requests · MIT

Your agent hears CI fail.

You push to a pull request. GitHub’s checks fail, or it hits a merge conflict. The Claude session that opened it is told what is wrong, finds the cause, and fixes it. You are not the messenger.

Install in two linesHow it works ↓
WORKS WITH Claude Code Codexsoon Cursorsoon Geminisoon
BEFORE you are the messenger 
AFTER the session is told 
01 · THE PROBLEM

CI fails after the agent stopped looking.

A pull request goes red minutes after the turn ends. Nobody tells the session, so you copy the error across by hand. This is the same push, with the hook on.

claude · session (illustrative example)

  
02 · HOW IT WORKS

Five steps. It stops at the first one that says nothing to do.

When a turn ends, the hook climbs this ladder. Pick a situation:

    03 · BY THE NUMBERS

    Small on purpose.

    Each figure is a property of the code in this repository, not a benchmark.

    0
    GH CALLS PER RUN

    One gh pr list for all your open PRs, not one per branch.

    0
    TESTS

    Real script, real temp git repo, a stub gh. No network.

    9
    REPEAT REPORTS

    A failure is reported once per commit, so the hook cannot loop.

    0
    SECOND BUDGET

    The hook timeout. A normal run takes about one second.

    04 · HOOK VS AUTO-FIX

    Two tools. Different moments.

    The hook runs inside your session. The desktop app's Auto-fix watches from outside. Use both.

    backtogreen hookDesktop app Auto-fix
    Fires whenA turn endsCI fails, even while the session is idle
    Wakes an idle sessionNoYes
    Lives inYour ~/.claude, any editor that runs Claude CodeThe Claude desktop app
    SetupOne installerA switch per pull request
    Good forCatching red CI the moment you come backFixing it while you are away
    05 · INSTALL

    Two lines. Then it is on.

    Needs python3 and the GitHub CLI signed in (gh auth login). Hooks load when a session starts, so open a new one afterwards.

    ~/.claude/skills/backtogreenthe skill: how a session fixes a red check on its own PR ~/.claude/hooks/failedci2claude.logone line per run: tells a silent hook from one that never ran ~/.claude/hooks/failedci2claude.seen.jsonwhat was already reported, so nothing repeats pytest teststhe seven tests, run from the repository