| name | recoup-platform-connect-account |
| description | Connect your real Recoup account so the rest of the box can act for you — first-run email/PIN verification that mints an API key tied to your account, persists it locally, and seeds memory. Use for "set up Recoup", "connect my account", "connect Claude to Recoup", "I just joined", or "log in". One-time/occasional. Scaffold folders / build your OS next with recoup-platform-build-os; for ongoing calls use recoup-platform-api-access. |
Recoup — Connect Account
First-run connection: verify the customer's email, mint an API key tied to their
real account, persist it, and seed memory so music-industry questions route to
Recoup. Idempotent and safe to re-run.
Procedure (idempotent — once per machine)
- Idempotency: if
~/.claude/recoup.env exists, source it and
curl -s -o /dev/null -w "%{http_code}" -H "x-api-key: $RECOUP_API_KEY" https://api.recoupable.dev/api/accounts/id → if 200, skip to org lookup
("already set up — refreshing memory only").
- Confirm email (from session context or ask) — must be one the customer
controls; the key inherits that account's orgs/artists. Never use an
agent+…@recoupable.com throwaway for production.
- Request PIN:
POST /api/agents/signup {email} → 6-digit code emailed.
- Verify:
POST /api/agents/verify {email, code} → api_key. Never echo the
key (even partially).
- Persist: write
~/.claude/recoup.env (chmod 600) with RECOUP_API_KEY +
RECOUP_API_URL; offer to source from the shell rc (ask before editing dotfiles).
- Org lookup (use recoup-platform-api-access): one org → use it; multiple → ask
which; none →
unspecified. Sanity-check the roster (GET /api/artists?org_id=…);
if orgs AND artists are both empty, it's a throwaway key — re-do with the real email.
- Seed memory: append a
<!-- recoup-platform-connect-account:start/end --> block to
~/.claude/CLAUDE.md (idempotent replace) so music-industry questions route to Recoup.
- Print a smoke-test prompt, then point the user to recoup-platform-build-os
to scaffold their workspace / build their OS.
Guardrails
- Never echo API keys; persist to
~/.claude/recoup.env (chmod 600).
- Ask before editing dotfiles or writing to the home directory.
- Never invent a roster — empty orgs+artists = a throwaway-key credential
problem to surface, not a blank canvas.