Skip to content

joeblew999/claude-bot

Repository files navigation

claude-bot

Single Go binary that watches GitHub repos for todo-labeled issues, runs Claude Code, and creates PRs.

Releases | Discussions

Install

Download the latest binary for your platform:

# macOS (Apple Silicon)
curl -fSL https://github.com/joeblew999/claude-bot/releases/download/latest/claude-bot-darwin-arm64 -o claude-bot
chmod +x claude-bot

# Or build from source
go build -o claude-bot .

# Or self-update an existing binary
./claude-bot --update

Quick Start

CB_REPOS="owner/repo" ./claude-bot

Or use the Taskfile:

task start    # build + run (idempotent)
task stop     # stop (idempotent)
task test     # unit tests
task release  # cross-compile + publish GitHub release
task update   # self-update from latest release
task clean    # remove worktrees + logs

How It Works

  1. Polls repos for issues labeled todo
  2. Picks up issue, labels it in-progress
  3. Clones repo, creates worktree on a new branch
  4. Runs Claude Code with the issue as the prompt
  5. Commits changes, pushes, creates PR
  6. Comments PR link on issue, labels done
  7. On failure: comments error, resets to todo, retries up to max

Everything is idempotent — safe to restart at any point.

Triage

Set CB_TRIAGE=1 to auto-respond to new unlabeled issues with a context-aware, human-sounding reply generated by Claude at runtime.

Set CB_TRIAGE_DISCUSSIONS=1 to also respond to new GitHub Discussions.

Self-Management

The binary manages its own lifecycle:

./claude-bot --build      # compile from source (embeds git commit)
./claude-bot --release    # cross-compile 6 targets + publish GitHub release
./claude-bot --update     # download latest release and replace self
./claude-bot --clean      # remove worktrees + logs
./claude-bot --clean-all  # full reset (worktrees, repos, logs)
./claude-bot --version    # print version
./claude-bot --help       # print usage

Config

All env vars prefixed CB_. Can also be set in a .env file (loaded by the binary at runtime).

Variable Default Description
CB_REPOS (required) Comma-separated owner/repo list
CB_POLL_INTERVAL 30s Poll frequency
CB_WORKERS 3 Parallel workers
CB_MAX_RETRIES 3 Failures before marking failed
CB_MAX_TURNS 50 Claude --max-turns per issue
CB_TRIAGE off Set 1 to triage new issues via Claude
CB_TRIAGE_DISCUSSIONS off Set 1 to triage GitHub Discussions
CB_AUTO_INSTALL off Set 1 to auto-install deps

Prerequisites

  • Go 1.25+ (for building from source)
  • git with identity configured
  • gh authenticated (gh auth login)
  • claude CLI authenticated

With CB_AUTO_INSTALL=1, missing tools are installed automatically via brew/apt/dnf/npm.

Labels

Auto-created on startup: todo, in-progress, done, needs-info, failed, triaged.

CI

CI runs via GitHub Actions using the Taskfile:

  • testtask test (13 unit tests)
  • releasetask release (cross-compiles 6 targets, publishes to GitHub)

Cross-compiled targets: linux/amd64, linux/arm64, darwin/amd64, darwin/arm64, windows/amd64, windows/arm64.

About

Single Go binary that watches GitHub repos for todo-labeled issues, runs Claude Code on them, and creates PRs. No cloud, no bot accounts, no API keys.

Resources

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages