Skip to main content

Lesson 2 of 7 · 1:56 · Beginner

Teach Claude Code Memberstack

Give Claude Code the Memberstack docs so it stops guessing at auth and payments.

Where this fits

Rey handles setup inside your dashboard. Now you’ll bring that same Memberstack know-how into Claude Code, where your app’s code lives.

By the end of this lesson you can

  • Run the one npx command from the Memberstack AI docs in your project folder
  • Ask Claude Code a Memberstack question without even naming Memberstack
  • Check the answer covers the real login options: email and password, passwordless and social

Lesson notes

How it works

Why AI coding tools guess wrong about Memberstack

AI coding assistants write code from what they already know. For a specific product like Memberstack, that knowledge is often thin or out of date, so the assistant guesses method names and setup steps. That is where broken login and payment code comes from.

The fix is to put the official Memberstack docs inside your project, where Claude Code reads them. Memberstack's AI docs package does that with one command.

How to give Claude Code the Memberstack docs

You can do this in an empty folder or in a project you have already started. Run it from the project's root folder so the files land where Claude Code looks for them.

  1. Open your project's root folder in your code editor and start a terminal there.
  2. Run npx memberstack-ai-docs --ai claude and wait for it to finish.
  3. Start Claude Code by typing claude in the same terminal.
  4. Ask "How do I log in a member?" without mentioning Memberstack.
  5. Check that the answer names the real Memberstack login options.

What the command adds to your project

The command creates or updates CLAUDE.md, the project instructions file Claude Code reads, and adds a .memberstack/ folder with the documentation itself: complete.md, index.json and quickref.md. If you already have a CLAUDE.md, the installer doesn't overwrite it. It adds a clearly marked Memberstack section.

Because those instructions load with your project, Claude Code knows to use Memberstack for auth and payments even when you don't name it. The same package can also set up Cursor (--ai cursor), Codex (--ai codex) or all three (--ai all).

How to tell the answer is right

A correct answer covers the three ways a member can log in with Memberstack. Email and password uses loginMemberEmailPassword({ email, password }). Passwordless login is two steps: sendMemberLoginPasswordlessEmail({ email }) sends a code, then loginMemberPasswordless({ email, passwordlessToken }) logs the member in. Social login uses loginWithProvider({ provider }) with a provider like "google". If the answer invents other method names, the docs didn't load: check that CLAUDE.md and .memberstack/ exist and restart Claude Code.

Before you move on

0 of 4

Tick these off on your own site. Done with all of them? You’re ready for the next lesson.

Up next: Use Cursor instead of Claude Code? The next lesson does the same setup there.

Chapters

Common questions

How do I make Claude Code understand Memberstack?

Run npx memberstack-ai-docs --ai claude in your project's root folder. It adds the Memberstack docs to your project and points CLAUDE.md at them, so Claude Code uses the real methods instead of guessing.

Will it overwrite my existing CLAUDE.md?

No. The installer adds a clearly marked Memberstack section and leaves your existing content alone.

What login methods does Memberstack support in code?

Email and password, passwordless (a code sent by email) and social login through providers such as Google, Facebook, GitHub and LinkedIn. Each has its own method in the @memberstack/dom package.

Keep going

Checked against the Memberstack docs

TranscriptAuto-generated captions
  1. 0:00

    Hey there, my name is Julian and in this super quick video I’m going to show you how you can make your Claude code hyper aware of Memberstack which means you are going to be able to very easily get off and payments set up and working without AI hallucinating. So what I have here open on the left side is the Memberstack AI documentation GitHub and on the right side I have VS Code open with a terminal open in a blank folder. There’s nothing else. Now, yours doesn’t need to be a blank folder. If you’ve already started a

  2. 0:29

    project, that’s totally fine. Just open the root folder and start a terminal. So, here we have this and I’m going to go ahead and paste this first command into it, which is npx Memberstack AI docs AI Claude. That one right there. Go ahead, copy it. Paste it into your terminal and hit enter. We’re going to give this a second to load. And as we can see, everything looks good. So now let’s go ahead and test it to make sure it works. So let’s go ahead and run Claude. Just like that. And now I’m going to ask it a question about member

  3. 1:01

    stack. Let’s start with how do we log in a member. So how do we log in a member? Now I’m not even going to say with Memberstack because we installed this. It is going to know that we should be using Memberstack. So I’m going to go ahead and let it do its thing and then it should come back to us with this. So if we look right over here based on the Memberstack documentation there are several ways that’s true email password login this is the correct method passwordless login this is the correct method social login

  4. 1:33

    everything is correct so that means that this combined with whatever stack you have it is going to be able to figure out how to make Memberstack work so your off problems can say goodbye and you can vibe code your project in peace have a great day and I’ll talk to you

This is v1 of Memberstack University, built from the tutorials we’ve put so much work into over the years. We’d like to make a more organized series.