module 04 memory layer

Create your Supabase project

System Text-to-Speech Ready
Slide: 0:00 / 0:00
Slide 1 of 0Interactive Deck

Full Lesson Reference

This lesson + the next one are for the Supabase path. If you set up markdown memory in Lesson 2 and are happy with it, skip to Lesson 5.

You create your Supabase project once. Takes about 5 minutes. Never have to do it again.

Step 1: Create a Supabase account

Go to supabase.com and sign up. The easiest sign-in is GitHub - you already have a GitHub account from Module 01, so one click and you're in.

Free tier gives you everything you need. No credit card required.

Step 2: Create a new project

Once signed in, click New Project. You'll be asked for

  • Organisation - use the default (your personal org) or create one called "Claude Code Training"
  • Project name - call it something like claude-memory or my-memory. This is internal - only you see it.
  • Database password - Supabase auto-generates a strong one. Copy it, save it to a password manager. You probably won't need it often but losing it means restoring access is painful.
  • Region - pick closest to you geographically. Australia users: Southeast Asia (Singapore) or Australia East (Sydney) if available.
  • Pricing plan - Free. Never need to upgrade for personal memory. Click Create new project. Supabase provisions the database - takes about 60 seconds.

Step 3: Get your project credentials

Once the project is ready, go to Settings (gear icon) > API. You need 3 things:

  • Project URL - looks like https://abc123xyz.supabase.co
  • anon public key - safe for client-side use, starts with eyJ...
  • service_role key - full admin access, also starts with eyJ... (keep this one secret)

Keep the Settings > API page open for the next step. Do NOT copy the keys into a Claude prompt - we'll handle them safely in Step 4.

Step 4: Save credentials to .env (safely)

Remember the rule from Module 03 - never paste API keys into a Claude prompt. That rule applies here too. Instead, you'll paste the keys directly into the .env file yourself.

First, ask Claude to prepare the .env file with placeholder lines:

In my Claude Code folder's .env file, add a "Memory layer (Supabase)" section with three empty placeholder lines: SUPABASE_URL=, SUPABASE_ANON_KEY=, and SUPABASE_SERVICE_ROLE_KEY=. Confirm .env is in .gitignore. Don't ask me for the values - I'll paste them in myself.

Claude updates .env with the empty placeholders + verifies .gitignore. Now open the .env file in your text editor (or ask Claude to open it for you), and paste the 3 values from Supabase Settings > API into the right lines. Save and close.

Then confirm Claude can read them without ever showing you the values:

Confirm my .env has SUPABASE_URL, SUPABASE_ANON_KEY, and SUPABASE_SERVICE_ROLE_KEY set to non-empty values. Don't print the values - just confirm each is set.

Claude checks + confirms. The keys never appear in your chat history.

What the .env section looks like

=== Memory layer (Supabase) ===

SUPABASE_URL=https://abc123xyz.supabase.co

SUPABASE_ANON_KEY=eyJ-your-anon-key-here

SUPABASE_SERVICE_ROLE_KEY=eyJ-your-service-role-key-here

Power-user tips

  • Use GitHub sign-in for Supabase - skips password management, one less thing to track
  • Create the project in the closest region - queries are faster when the database is physically near you
  • Bookmark your Supabase dashboard URL - you'll go back regularly once the memory is active
  • If you already have a Supabase project for something else - you can create a second project for memory (free tier allows 2 projects). Keep memory separate from other data.

Action items

☐ Create a Supabase account at supabase.com (use GitHub sign-in)

☐ Create a new project named claude-memory (or similar) ☐ Save the database password to your password manager

☐ Copy Project URL + anon key + service role key from Settings > API

☐ Tell Claude to add empty placeholder lines to .env (never paste the keys into the prompt)

☐ Paste the 3 values into .env yourself via your text editor

☐ Ask Claude to confirm the values are set (without printing them)

Next lesson: Set up the memory schema.

Exercises

  1. Review the concepts covered in this lesson: Create your Supabase project.
  2. Write down your key takeaway from this lesson.
  3. Practice running any commands or prompts mentioned above inside your terminal.