Auto-Triage GitHub Notifications With AI

On this pageAuto-Triage GitHub Notifications With AI0%
- Auto-Triage GitHub Notifications With AI
- The real cost of notification overload
- What to triage automatically vs what needs a human
- Pulling notifications via the GitHub API
- Letting an AI model score and label each item
- Wiring it to a cron job and a daily digest
- Menjadikannya sistem internal yang beneran dipakai tim
- Related reading
Auto-Triage GitHub Notifications With AI
If your GitHub notifications inbox has hundreds of unread items, most of them do not need you. The fastest fix is a small script that pulls your notifications through the GitHub API, lets an AI model score and label each one, and shows you only the handful that actually need a human. This is productive laziness: automate the sorting so your attention goes to real work.
Below is a practical, script-first setup you can wire to a cron job and read as a single daily digest.
The real cost of notification overload
Notification overload is not just annoying. Every unread badge is a small decision: open it, skip it, or feel guilty about it. For an active developer on several repositories, that can be dozens of decisions before lunch. The cost is context switching. Research on interruptions has long suggested it takes several minutes to fully return to a task after a break, so a noisy inbox quietly taxes your deep work all day.
The goal is not zero notifications. The goal is that when you look, everything you see is worth a response. Everything else gets archived or summarized without your involvement.
What to triage automatically vs what needs a human
A good triage rule separates items by whether a human decision is required.
Handle automatically:
CI passed or a bot merged a dependency bump
You were subscribed to a thread but not mentioned
Duplicate notifications for the same issue you already read
Automated release notes and changelog updates
Keep for a human:
You were directly mentioned or assigned
A review was requested from you
A failing check on a pull request you own
A new issue on a repository you maintain with no assignee
The split matters because AI is good at scoring fuzzy signals like tone and urgency, but you still decide what "urgent" means for your work. Write the hard rules yourself and let the model handle the ambiguous middle.
Pulling notifications via the GitHub API
GitHub exposes your notifications at a REST endpoint. A personal access token with the notifications scope is enough to list them. The response includes the reason field (mention, review_requested, subscribed, and so on), the repository, and the subject.
import os, requests
token = os.environ["GH_TOKEN"]
resp = requests.get(
"https://api.github.com/notifications",
headers={"Authorization": f"Bearer {token}",
"Accept": "application/vnd.github+json"},
params={"all": "false", "per_page": 50},
)
notifications = resp.json()The reason field alone already lets you pre-filter. Anything with reason mention or review_requested skips the model and goes straight to your keep list. Everything else is a candidate for AI scoring, which saves API calls and money.
Letting an AI model score and label each item
For the ambiguous items, send the model a compact summary and ask for a score and a label. Keep the prompt strict: return structured output only, so your script can parse it without guessing.
prompt = f"""Score this GitHub notification 0-10 for how urgently
it needs a human reply. Return JSON: {{"score": int, "label": str}}.
Repo: {n['repository']['full_name']}
Reason: {n['reason']}
Title: {n['subject']['title']}"""Ask for a number and a short label such as needs-reply, fyi, or ignore. Set a threshold, for example anything scoring 6 or higher lands in your digest and the rest gets marked read through the API. Because you already filtered the obvious mentions, the model only judges the gray-area items, so a small fast model is usually enough.
One caution: never let the model mark something read on its own without a threshold you control. Keep the human-required rules deterministic and use AI only for ranking the remainder.
Wiring it to a cron job and a daily digest
The final step turns this into something you never think about. Run the script on a schedule and have it write one digest instead of pinging you all day.
0 8 * * 1-5 /usr/bin/python3 /home/you/gh_triage.pyAt 8am on weekdays the script pulls notifications, applies your rules, scores the rest, marks the low-priority items read, and writes a short digest to a file, a Slack message, or an email. You open one screen, see the five things that need you, and get on with your day.
If you already automate other parts of your morning, this slots in cleanly. It pairs well with a single-screen morning brief that pulls your day into one view and with the habit of automating your status reports so writing them is not a daily chore. The same cron-and-script pattern powers a self-updating personal dashboard too.
Menjadikannya sistem internal yang beneran dipakai tim
Skrip triage ini enak buat dipakai sendiri, tapi begitu satu tim mau punya aturan prioritas yang seragam, butuh dashboard, dan integrasi ke sistem internal, biasanya butuh sesuatu yang lebih rapi dari skrip cron di laptop satu orang. Pola yang sama sering muncul waktu tim mau otomasi alur kerja lain, misalnya rekap kehadiran atau notifikasi tugas, yang lama-lama minta aplikasi custom sendiri. Kalau sudah sampai titik itu, ada tim software house yang biasa bangun aplikasi custom dan otomasi kerja berbasis AI seperti ini yang bisa diajak ngobrol dulu soal alurnya sebelum kamu bangun sendiri dari nol.