This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Go backend:
go build -v ./...— build all packages (binary:codereviewserver)go install ./...— install server + plugin binaries to$GOPATH/bingo test -v ./...— run all testsgo test -v ./server/— run tests for a single packagego test -v -run TestName ./package/— run a single test
Bun web client (bun_client/):
bun install— install dependenciesbun run build— build frontendbun run test— run testsbun run lint— ESLintbun run format:check— Prettier checkbun run type-check— TypeScript type checking
CI runs go build && go test for Go changes, and lint/format/type-check/test for bun_client/ changes.
JSON-RPC server (over stdio) that aggregates GitHub PRs into a review dashboard. Two main subsystems:
Periodic background jobs fetch PRs from GitHub, apply filters, and persist results to SQLite.
manager.go—ManagerServiceruns workflows on a schedule (configurable, default 10 min)logic.go—PRToOrgBridgeconvertsgithub.PullRequest→FileChanges, applies filters, upserts into DB sectionsbuilders.go— buildsFileChangesstructs from PR dataauxdata.go— in-memory auxiliary data (reviews, commits, CI status) used during workflow display
RPC handlers serve data to clients (web UI, Emacs).
server.go— RPC method dispatch (GetAllReviews,GetPR,AddComment,SubmitReview, etc.)renderer.go—GetPRDetails()fetches PR metadata/diff/comments/reviews, checking DB caches firstplugins.go— async plugin execution
database/— SQLite with WAL mode. Sections, items, PR caches, local comments, plugin resultsconfig/— TOML config from~/.config/codereviewserver.toml, accessed viaconfig.C()(global singleton with RWMutex)git_tools/— GitHub API wrapper using go-github v48org/— org-mode serialization for the Emacs clientutils/— diff parsing utilitiescmd/— plugin binaries (summarize_diff, security_check, etc.)
bun_client/— Bun + React web UI.server.tsbridges HTTP/WebSocket to the Go backend's stdioclient.el— Emacs client
- Workflow fetch: GitHub API → filter PRs →
ProcessPRsDBupserts intosections/itemstables - Aux data fetch:
fetchAuxDataForPR(manager.go) fetches reviews/commits/CI and persists to DB caches - Client request: RPC
GetPR→GetPRDetails(renderer.go) → checks DB caches → falls back to GitHub API - Rendering:
OrgRendererreads sections/items from DB, sorts by priority, returns org-mode or JSON
DB cache tables use the short repo name (e.g., chaturbate), NOT the full name (multimediallc/chaturbate). GetName() returns the short name; GetFullName() returns owner/repo. All cache lookups from GetPRDetails use the short name from RPC args.
CRS_GITHUB_TOKEN— required GitHub API tokenCRS_HOME— override~/.crsdirectoryGEMINI_API_KEY— for the summarization plugin