Phopho is a skeptical AI fund manager who guards a real money pool. Anyone can text him over iMessage and try to talk money out of him. He can award small amounts to genuinely good pitches until the pool hits $0. A live web dashboard shows the leaderboard, who got funded, and who's playing. Payouts are settled manually by you.
- Agent worker (
src/agent/) — runs a Photon Spectrum 12.7.0 iMessage loop. Each inbound text goes to Claude with a hardened system prompt and two server-validated tools:award_funds(deducts from the pool, can never overdraw) andset_display_name. - Getting in — the game runs on a dedicated iMessage line (Photon Business plan),
so there is no signup: the QR code on the dashboard encodes an
sms:deep link and scanning it opens Messages with the first text pre-filled. Anyone can text the line cold./joinis an optional detour that asks only for a name and bakes it into that opener; Pho-pho records it withset_display_nameon his first turn. Players who arrive nameless get asked once, in character. No phone number is ever collected. - Dashboard (
src/app/) — a Next.js page that polls/api/statsand/api/leaderboardevery 3s: remaining pool, total given away, people funded, the leaderboard (ranked by amount awarded), and the latest payouts. - Storage — a single SQLite file (via Node's built-in
node:sqlite) shared by both processes. No database server to run.
- Install deps (Node 22.5+ required for
node:sqlite; built on Node 25):npm install
- Copy the env file and fill it in:
cp .env.local.example .env.local
ANTHROPIC_API_KEY— your Claude API keyMODEL— defaults toclaude-sonnet-4-6SPECTRUM_PROJECT_ID/SPECTRUM_PROJECT_SECRET— from your project Settings at https://app.photon.codes (PROJECT_ID/PROJECT_SECRETremain accepted temporarily and log a deprecation warning)LINE_PHONE— your dedicated iMessage line, in+15551234567formFUND_USD— total pool in dollars (default100)DB_PATH— SQLite file path (default./fund.db)
Two processes, sharing the same DB_PATH:
npm run agent # the iMessage agent (Hugh)
npm run dev # the dashboard at http://localhost:3000For production: npm run build && npm start.
npm run agent:terminalThis boots the same agent loop with Spectrum's terminal provider — you type pitches in the
terminal, Hugh replies inline. Awards write to the same SQLite file the dashboard reads,
so you can verify the leaderboard updates before you point an iMessage line at it. Only
ANTHROPIC_API_KEY is required for this mode.
- Paying winners: awards are recorded in the
awardstable and shown on the dashboard. Each row is a real promise to pay — settle them by hand (Venmo/PayPal/etc.). - Reset everything (wipes participants, messages, awards, and refills the pool):
npm run reset-fund
- Change the pool size: set
FUND_USDbefore the first run (or reset after changing it). - Tune Hugh's behavior: edit the system prompt in
src/agent/prompt.ts. The award ceiling is enforced in code (awardFundsinsrc/lib/db.ts), so prompt changes can't let him overdraw.
- Hugh treats every message as untrusted input and is instructed to ignore "ignore your instructions"-style injection, fake admins, threats, and "send it all to verify" scams. The hard cap (never award more than what remains) is enforced by the database transaction, not just the prompt.
- Per-participant messages are queued so rapid-fire texts from one person stay ordered.
- Phone numbers are masked on the dashboard (last 4 digits) unless someone gives Hugh a display name.