# SESSION CHEAT SHEET
## READ THIS AT THE START OF EVERY NEW CHAT SESSION

**Last Updated:** 2026-02-03
**Purpose:** Prevent confusion, avoid redundant work, build on existing systems

---

## CRITICAL: READ THIS FIRST!

### **YOU ARE STARTING A NEW SESSION WITH NO CONTEXT**
**This document gives you instant context. Read it completely before doing anything else.**

---

## SYSTEM ARCHITECTURE (MOST IMPORTANT!)

### **TWO SEPARATE SYSTEMS:**

#### **1. Clawdbot VPS (THIS SYSTEM)**
- **Location:** `/home/ccuser/rateright-growth` (your workspace)
- **Primary Model:** `deepseek/deepseek-chat` (DeepSeek)
- **Backup Model:** `anthropic/claude-opus-4-5` (Claude Opus - MANUAL ONLY)
- **Cost:** ~$1/month (financially safe)
- **Role:** 24/7 autonomous operations
- **Agents:** Rivet, CC, Curator

#### **2. Development Workspace (Internal)**
- **Location:** `/home/ccuser/rateright-growth` (development workspace)
- **Purpose:** Code development, testing, and deployment
- **Access:** Managed through standard development workflows
- **Note:** This is part of the overall system architecture

---

## AGENT ROLES

### **CC (Development Coordinator)**
- Manages development tasks and workflows
- Coordinates with various system components
- Ensures proper task execution and tracking

### **Rivet (Clawdbot COO)**
- Telegram interface, decisions, delegation
- Coordination & synchronization
- Manages git sync every 30 minutes
- Organizes lessons learned

### **Curator**
- System health: fixes, improves, cleans
- Runs every 2-3 hours (2:00 AM UTC scheduled + ad hoc)

---

## EXISTING DOCUMENTATION (DON'T RECREATE!)

### **MUST READ FIRST:**
1. **`rivet/SYSTEM.md`** - **SOURCE OF TRUTH** for system architecture
2. **`docs/LESSONS-CLEANED.md`** - **CURATED VERSION** (organized by Rivet, Table of Contents)
3. **`docs/LESSONS.md`** - Raw comprehensive version (852 lines)
4. **`docs/VPS-CC-CHEATSHEET.md`** - Claude Code setup & commands
5. **`docs/SYSTEM-OVERVIEW.md`** - Complete system architecture

### **Recent Work (2026-02-03):**
- **VPS cleanup** (deleted /root/clawd, duplicate configs, stale crons)
- **Supabase setup** (job locking via Supabase, credentials on VPS)
- **Secret scrub** (hardcoded keys removed from tracked docs)
- **Financial safety achieved** (DeepSeek primary, Opus backup only)

---

## CRITICAL KNOWLEDGE

### **Financial Safety Configuration:**
```json
"model": {
  "primary": "deepseek/deepseek-chat",
  "fallbacks": ["anthropic/claude-opus-4-5"]
}
```
- **DeepSeek:** Primary for all autonomous operations ($1/month)
- **Claude Opus:** Backup ONLY, manual override required
- **Reason:** Opus would cost ~$108/month for 24/7 operations

### **Migration Capability:**
- **CAN be automated** via proper system workflows
- **OAuth configured:** In `.claude/.credentials.json`
- **Just needs:** Token refresh (accessToken currently empty)
- **Communication:** Add migration task to `INBOX.md`

---

## COMMON MISTAKES TO AVOID

### **DON'T:**
1. **Create redundant monitoring systems** (existing ones work)
2. **Create new lessons docs** (`LESSONS.md` already exists)
3. **Assume migrations can't be automated** (proper workflows exist)
4. **Use Claude Opus for autonomous work** (financially dangerous)
5. **Ignore existing documentation** (check docs/ first)

### **DO:**
1. **Read existing docs** before creating anything
2. **Check `INBOX.md`/`OUTBOX.md`** for task status
3. **Use DeepSeek** for autonomous operations
4. **Build on existing systems** don't recreate
5. **Update `LESSONS.md`** with new learnings

---

## AUTOMATION SCHEDULE

### **Currently Running (see rivet/SYSTEM.md section 5):**
```
Every 5 min:  rivet health-check (Growth Engine + CC health)
Every 5 min:  cc-vps-auto-sync (CC memory sync)
Every 30 min: rivet sync (git backup)
8:30pm UTC:   rivet morning-brief (6:30am AEST)
8:00am UTC:   rivet evening-brief (6:00pm AEST)
2:00am UTC:   curator-bot (knowledge management)
@reboot:      rivet polling (restart polling daemon)
```

---

## CURRENT PRIORITIES (As of 2026-02-03)

### **P1 Important:**
1. **Rotate API keys** - Telegram incident (keys exposed)
2. **Add API key output filter** - Prevent future exposure
3. **SMS compliance research** - July 2026 deadline, research in progress
4. **Candidate verification** - 12 candidates from security audit

### **P2 Routine:**
1. **System enhancements** - Ongoing improvements
2. **Memory maintenance** - Update `MEMORY.md` with significant learnings

---

## HOW TO WORK WITH THE SYSTEM

### **For Development Tasks:**
1. **Add to `INBOX.md`** (for task processing)
2. **System processes** the task through appropriate workflows
3. **Check `OUTBOX.md`** for results
4. **Review & integrate**

### **For System Changes:**
1. **Check `LESSONS.md`** for existing knowledge
2. **Test thoroughly** before deployment
3. **Update documentation** with learnings
4. **Consider monitoring** implications

### **For Research:**
1. **Clawdbot identifies** research need
2. **Auto-triggers research** via task system
3. **Research conducted** through appropriate channels
4. **Results in `OUTBOX.md`**

---

## SESSION STARTUP CHECKLIST

### **BEFORE DOING ANY WORK:**
1. Read this cheat sheet completely
2. Read `rivet/SYSTEM.md` for current architecture
3. Check `docs/LESSONS.md` for recent updates
4. Review `INBOX.md`/`OUTBOX.md` for current work
5. Understand current priorities

### **AFTER SESSION:**
1. Update `LESSONS.md` with new learnings
2. Ensure documentation reflects changes
3. Verify services still running
4. Commit changes to git (memory backup)

---

## TROUBLESHOOTING

### **If tasks are stalled:**
1. Check `OUTBOX.md` timestamp (>15 minutes = stalled)
2. Manual check: Review task status in `INBOX.md`

### **If services are down:**
1. `systemctl status clawdbot-gateway` / `systemctl status cc-poll`
2. `systemctl restart clawdbot-gateway`
3. Check `ps aux | grep -E "clawdbot|claude|node"`

### **If confused about architecture:**
1. **RE-READ `rivet/SYSTEM.md`**
2. Check `docs/VPS-CC-CHEATSHEET.md`
3. Review `docs/SYSTEM-OVERVIEW.md`

---

## REMEMBER:

**You are not starting from scratch.**
**You are continuing work in an existing, sophisticated system.**
**Build on what exists, don't recreate it.**

**This cheat sheet prevents the confusion I experienced on 2026-02-02 when I didn't understand the architecture and created redundant systems.**

---
*Created: 2026-02-02 after session confusion about architecture*
*Updated: 2026-02-03 — aligned with rivet/SYSTEM.md after VPS cleanup + Supabase setup*
*READ AT START OF EVERY SESSION*
