This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
# Build both services
go build ./...
# Run each agent (separate terminals)
go run ./cmd/ingest # listens on PORT_INGEST (default 8080)
go run ./cmd/router # listens on PORT_ROUTER (default 8081)
# Docker (builds both images in parallel)
docker buildx bakeNo tests exist yet. No linter is configured.
Two independent HTTP services coordinate through Tigris object storage — no queue or database.
Agent A (Ingest) — cmd/ingest/main.go
POST /submitaccepts{"id", "text", "media_url?"}, responds201immediately- Spawns a goroutine that calls
internal/classify(Claude API) then writes the result topending/{id}.jsonviainternal/store - Uses
sync.WaitGroupfor graceful shutdown of in-flight classifications
Agent B (Router) — cmd/router/main.go
POST /webhookreceives Tigris object notifications, guarded byinternal/webhook.VerifyBearer- Reads the classification from the bucket, routes the object by renaming it:
flagged/— violation detected, confidence > 0.85 (also POSTs toREVIEW_WEBHOOK_URL)needs-review/— violation detected, confidence <= 0.85approved/— no violation
- In-memory ETag deduper handles Tigris at-least-once delivery
Shared packages in internal/:
classify— wrapsanthropic-sdk-go, sends content toclaude-sonnet-4-0, parses structured JSON response intoClassificationResultstore— thin S3 helpers (Write,Read,Move,Delete) using AWS SDK v2 pointed at Tigris;Moveuses theX-Tigris-Rename: trueheader for atomic renameswebhook— Bearer token middleware and Tigris notification payload types (NotificationPayload,NotificationEvent,NotificationObj)
- Standard library
net/httponly — no routers or frameworks - All configuration via environment variables (see README.md for the full table)
- Return HTTP 500 from the webhook handler on transient failures so Tigris retries delivery (up to 3x)
- Treat "object not found" errors during Move/Read as already-processed (return 200, not 500)
- The
store.Newconstructor readsAWS_ENDPOINT_URL(defaulthttps://fly.storage.tigris.dev) for the Tigris S3 endpoint