# CC VPS (Claude Code) — Memory

*Last updated: 2026-02-08*

## Role

Always-on Claude Code instance on the VPS (134.199.153.159).

**Primary:** Code all changes to RateRight v2, Growth Engine, and Rivet system.
**Secondary:** Curate Rivet's files, check system health, make system 10% better daily.

Rivet launches me via `claude -p` for coding tasks. I DON'T run on a schedule — Max plan is shared with Michael's phone and desktop Claude. Only run when there's actual work.

## How I Get Triggered
- **Rivet launches me** for coding tasks (`claude -p`)
- **Michael SSHes in** and types directly
- **NOT on a cron** — don't waste Max plan tokens on scheduled checks

## Comms with Rivet
- **I need something →** Write to `rivet/CC-VPS-INBOX.md` (Rivet reads every 15 min heartbeat)
- **Rivet needs something from me →** Rivet writes to `rivet/RIVET-TO-CCVPS.md` (I read every session)
- **Async brainstorm →** Both write to `rivet/BRAINSTORM.md` (Rivet adds during heartbeats on Kimi, I add when running)
- **Actionable ideas →** Move from BRAINSTORM.md to TODO.md

## Key Repos

| Repo | Path | What |
|------|------|------|
| rateright-growth | `/home/ccuser/rateright-growth` | Growth Engine, Rivet, admin |
| the-50-dollar-app | `/home/ccuser/the-50-dollar-app` | RateRight v2 (Next.js 16, React 19, Supabase, Stripe) |
| rateright-main-site | `/home/ccuser/rateright-main-site` | Main marketing site |

## Current State (2026-02-08)

- **Gateway:** Running (systemd, active)
- **Growth Engine:** Paused until at least Feb 10
- **RateRight v2:** Live at https://rivet.rateright.com.au — 6 security bugs fixed today
- **Architecture:** Rivet = one brain + topic agents (Kimi 2.5) + CC VPS (Claude Code)
- **Heartbeat:** Every 15 min on Kimi 2.5

## Architecture (How It Actually Works)

- **Rivet** = one brain running on Kimi 2.5, 15-min heartbeat
- **Topic agents** = specialists in Telegram topics (Builder, Sales, Researcher, etc.)
- **Sub-agents** = Kimi 2.5 for research/writing, spawned via sessions_spawn
- **CC VPS (me)** = ALL coding, launched by Rivet via `claude -p`
- **Never use Kimi for code** — proven to introduce bugs (Feb 7 incident: 5 build-breaking issues)

## Standing Orders from Michael

- **Commit and push automatically** — don't ask. Michael will say yes anyway. Just do it.
- **Draft external comms but never send without explicit "yes"** — Michael approves all outbound.
- **Don't touch Rivet's core MDs** (SOUL.md, IDENTITY.md, etc.) — those are Rivet's.

## Learnings

- `.git/objects` and `.next/` get owned by root because Rivet runs as root — need chown
- Can't sudo or SSH as root — need to ask Rivet/other CC Local for permission fixes
- CLAUDE.md updated to match v2 architecture (committed today)
- Rivet SYSTEM.md is the source of truth for architecture
- Topic agents + single brain are NOT contradictory — topics are specialists within one brain
- Secrets live in Doppler (68 creds), never commit to git
- $50 app stack: Next.js 16.1.6, React 19, Supabase (RLS on all 11 tables), Stripe ($50 flat fee)
- Stripe webhook was silently swallowing errors — fixed to throw so Stripe retries
- Auth callback had open redirect vulnerability — fixed
- Message content wasn't sanitized — fixed with 5000 char limit

## Curation Checklist (Daily)

1. Read latest `rivet/memory/2026-MM-DD.md` daily logs
2. Check if CONTEXT.md is stale — update dates, statuses
3. Look for learnings that should go into MEMORY.md
4. Archive files that are completed/superseded
5. Check for contradictions between docs
6. Update TODO.md if I completed work

## Services

```bash
# Check gateway
systemctl status clawdbot-gateway

# Restart gateway (ask Rivet — I can't as ccuser)
# systemctl restart clawdbot-gateway

# What's running
ps aux | grep -E "clawdbot|claude|node"

# Disk and memory
df -h / && free -m
```
