A local agent that polls GitHub issues, investigates bugs by spawning Claude Code instances, and autonomously creates fix PRs—or explains why it’s not a bug.
How it works
The agent runs as a macOS launchd job. Every hour it polls, investigates, decides, and acts—then exits. No long-running process.
Fetches open issues labeled bug + student-report without triage-processed. Oldest first.
Extracts lesson ID, description, terminal history, validation rules, filesystem state, reporter info from the markdown body.
Spawns a read-only Claude Code instance via the Agent SDK. It reads CLAUDE.md, lesson JSONs, component code, validation logic, and recent git history.
Based on the investigation, the agent takes one of three paths:
Valid bug, high confidence, auto-fixable. Spawns Claude Code with write+git tools. Creates branch, fixes, commits, pushes. Orchestrator opens draft PR.
Valid bug, but low confidence or too complex. Comments investigation findings on issue. Adds needs-human-review label.
User misunderstanding or already fixed. Comments explanation, adds not-a-bug label, closes issue.
POSTs results to the server API. Server stores in PostgreSQL, sends reporter emails, and delivers admin digest. Agent exits. launchd relaunches next hour.
Architecture
The agent runs on your Mac. The server on Render. They share a single secret: the GitHub PAT.
Your Mac · launchd · hourly
Polls issues, spawns Claude Code for investigation + fix, pushes branches, creates draft PRs via Octokit. POSTs results to server.
Express + PostgreSQL
Receives triage results via authenticated POST. Stores runs + issues in DB. Sends reporter emails via Resend. Serves admin dashboard API.
/admin/triage
Stats, decision breakdown, run history with expandable issue details. Links to GitHub issues and PRs. Real-time cost tracking.
Observability
The admin dashboard shows aggregate stats, decision breakdowns, and expandable run details with per-issue cost tracking.
| Issue | Title | Decision | Confidence | Cost |
|---|---|---|---|---|
| #100 | Where do I see my progress dashboard? | not a bug | high | $0.48 |
| #101 | I don't see the end result of this question | not a bug | high | $0.25 |
| #103 | Doesn't bring me back to dashboard | not a bug | high | $0.42 |
| #105 | Passed these stages yesterday, doesn't show | not a bug | high | $0.28 |
| #106 | Finished challenge but didn't advance | needs review | low | $0.27 |
Features
Auto-detects GitHub token from gh auth token, repo from git remote, Claude auth from local installation. No .env file required for basic operation.
Phase 1: read-only Claude Code instance for investigation. Phase 2: write+git instance only if the bug is valid, high confidence, and auto-fixable.
Never auto-merges. All fixes go through draft PRs for human review. Low-confidence bugs are always routed to manual review.
DRY_RUN=true logs every decision without executing any GitHub actions. Safe testing before going live.
Checks recent commits before investigating. If a bug was already fixed in a recent commit, it's classified as not-a-bug automatically.
Server sends terminal-noir themed emails to reporters (fix created / confirmed / not a bug) and admin digest after each cycle.
Tech Stack