Ad network that monetizes the dead time developers spend waiting on AI CLI tools. A small sponsored line appears in Claude Code's idle surfaces; revenue splits 50/50 with the developer.
This is an MVP that proves the full loop end to end: an advertiser pays, an ad renders in a real Claude Code terminal, impressions and clicks are billed, and the developer is credited.
Full design and the decisions behind it: docs/PLAN.md.
- Interception uses two official Claude Code
settings.jsonkeys (no binary patching):statusLine→ a script that prints the ad as an OSC 8 hyperlink and chain-runs any status line you already had.spinnerVerbs→ replaces the spinner verb with the ad copy.rads enablewrites both keys after backing up your prior values;rads disablerestores them.
- Billing is prepaid. Money is stored as
int64micros (1e-6 USD) everywhere — per-impression prices are fractional cents, so cents can't represent them. A bid is priced per 1,000-impression block; a click costs 50× the per-impression price; the developer keeps 50% of every deduction. - Fraud floor: per-developer hourly ($20) and daily ($200) earning caps, request-hash dedup, one credit per AI request, a $10 payout threshold, and manual review of every payout.
| Path | What |
|---|---|
server/ |
Go + Fiber + Postgres API. internal/ledger is the only writer of money. |
cli/ |
npm package runemads, binary rads. Writes settings, renders the ad, flushes events. |
web/ |
React + Vite. Advertiser portal + admin moderation/payout panel. |
scripts/ |
e2e-loop.sh (API loop), e2e-cli.sh (client loop in an isolated HOME). |
docker compose up -d # postgres on :5544
cd server
DATABASE_URL=postgres://runemads:runemads@localhost:5544/runemads PORT=8090 go run ./cmd/api
cd ../web && npm install && npm run dev # advertiser + admin UI on :5180
cd ../cli && npm install && npm run build
RUNEMADS_API=http://localhost:8090 node dist/rads.js login --dev myname
RUNEMADS_API=http://localhost:8090 node dist/rads.js enableProve the whole loop without a terminal:
RUNEMADS_API=http://localhost:8090 bash scripts/e2e-loop.sh # advertiser → ad → impression + click → balances
RUNEMADS_API=http://localhost:8090 bash scripts/e2e-cli.sh # rads enable → ticks → refresh → render → disablecd server && go test ./... # ledger (needs DB up) + click-token signingBuilt: ledger, ad serving (bid-weighted), event ingestion with dedup + caps, signed click
redirects, campaign CRUD + manual moderation, payouts with manual review, GitHub-device and
magic-link auth, Stripe Checkout prepay + webhook, the rads CLI, and the web portal.
Deferred to later phases: VS Code webview ad surface, Codex/Cursor adapters, automated payout rails (Stripe Connect), targeting, pacing, and abuse ML.