Better Auth two-factor authentication skill for Claude Code: TOTP, OTP and backup codes
Helps Claude add two-factor authentication to Better Auth: authenticator apps, OTP codes, backup codes and trusted devices.
- Installs
- 35.7K
- on skills.sh
- Stars
- 228
- on GitHub
- Updated
- Oct 2026
- last repo commit
This skill makes Claude add Better Auth's twoFactor plugin. Its description covers TOTP authenticator apps, OTP codes by email or SMS, backup codes, trusted devices and 2FA sign-in flows.
Setup has four steps: add twoFactor() with an issuer on the server, add twoFactorClient() in the client, migrate, and check that a twoFactorSecret column exists. It bundles no scripts.
Good for
- Developers adding 2FA to a Better Auth app
- Teams supporting authenticator apps or SMS codes
- Anyone handling backup codes and account recovery
Install two-factor-authentication-best-practices
Claude Code
- 1
Copy this prompt.
Install the two-factor-authentication-best-practices skill in Claude Code. Run this command: npx skills add https://github.com/better-auth/skills --skill two-factor-authentication-best-practices Then check that it loaded and tell me how to use it.
- 2
Paste it into Claude Code. It shows the change and asks before running it.
Requires Node.js.
From its listing on skills.sh. Source.
What's in the skill
When it loads
Configure TOTP authenticator apps, send OTP codes via email/SMS, manage backup codes, handle trusted devices, and implement 2FA sign-in flows using Better Auth's twoFactor plugin. Use when users need MFA, multi-factor authentication, authenticator setup, or login security with Better Auth.
Sections in SKILL.md
- Setup
- Client-Side Setup
- Enabling 2FA for Users
- TOTP (Authenticator App)
- Displaying the QR Code
- Verifying TOTP Codes
- TOTP Configuration Options
- OTP (Email/SMS)
- Configuring OTP Delivery
- Sending and Verifying OTP
- OTP Storage Security
- Backup Codes
- Displaying Backup Codes
- Regenerating Backup Codes
- Using Backup Codes for Recovery
- Backup Code Configuration
Key facts
- Repository
- better-auth/skills
- Installs on skills.sh
- 35,709 (Nov 2, 2026)
- GitHub stars (repo)
- 228 (Nov 2, 2026)
- Last repo commit
- Oct 19, 2026
What it includes
Server plugin with issuer, client plugin, migrate, then verify the column.
Step 3 runs npx auth@latest migrate or generate plus a push.
Runs code ·
Setup (4 steps)How a user turns 2FA on.
Enabling 2FA for usersShow the QR code, verify codes and set TOTP options.
TOTP (authenticator app)Configure delivery, send and verify codes, and store them securely.
OTP (email or SMS)Display, regenerate and use codes for recovery, plus config.
Backup codesThe sign-in flow when a user has 2FA on.
2FA during sign-inSkip repeat prompts on devices the user trusts.
Trusted devicesSession management, rate limiting and encryption at rest.
Security considerationsHow a user turns it off.
Disabling 2FA
From the official docs
Permissions
Low risk
The skill holds instructions, but its setup step runs a CLI command that can change your database schema. Try it on a dev database first.
What it can do
- Read your data
- Create and change things
- Delete things
- Read-only mode
Watch out for
Migrate commands change your database
The setup steps run npx auth@latest migrate, or generate plus a Drizzle or Prisma push. Run them against a dev database first. github.com
Technical details
| Talks to | npm registry (npx auth@latest) |
|---|---|
| Scopes |
|
Questions
How do I install it?
Use the install box above. It installs only two-factor-authentication-best-practices, not the other five skills in the repo.
Which Better Auth skill should I install?
The better-auth/skills repo has six: best-practices (setup and config), create-auth (planning and scaffolding), security, emailAndPassword, organization and twoFactor. Start with create-auth for a new project and best-practices for config questions, then add the topic skill you need.
Does it send SMS codes?
Not by itself. SKILL.md shows how to configure OTP delivery by email or SMS, and you supply the provider.
Is it safe to install?
The folder is one Markdown file with no scripts, so installing adds instructions only. The setup step runs a migrate command that can change your database, so use a dev database first.
Does it work in the Claude app or Codex?
The install box lists a zip upload for the Claude app and a skills folder for Codex. The repo has no README, so the author does not say which clients it supports.
Information
updated Nov 2, 2026
- Repository
- better-auth/skills
- Folder
better-auth/twoFactor
Sources
Docs, issue trackers and discussions this page is built from.
Show all 5Hide
- SKILL.md · github.com
- skills.sh listing · skills.sh
- Repository · github.com
- Using skills in Claude · support.claude.com
- Claude Code skills · code.claude.com