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.
- Open your project's root folder in your code editor and start a terminal there.
- Run
npx memberstack-ai-docs --ai claudeand wait for it to finish. - Start Claude Code by typing
claudein the same terminal. - Ask "How do I log in a member?" without mentioning Memberstack.
- 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.