better-auth:add-plugin

better-auth:add-plugin is a command for Claude Code from secondsky/claude-skills. It costs 25 tokens per session (1,467 once invoked), scanned A, original, MIT.

A command that adds a better-auth plugin to an existing project's server and browser authentication setup. better-auth is a library for adding sign-in and account features to applications.

In plain words
What is it for?
Use it to add supported features such as two-factor sign-in, passkeys, magic links, single sign-on, organizations, API keys, or payment integrations.
Why use it?
It avoids manually finding the authentication files and wiring plugin imports and settings in the right places.

Command for Claude Code

Written for Claude Code: argument-hint in frontmatter.

Part of the better-auth plugin — 1 skill, 4 commands, 1 agent shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/secondsky/claude-skills/better-auth-add-plugin
Clone the repo
git clone --depth 1 https://github.com/secondsky/claude-skills

Made for: Claude Code.

Or install better-auth, the plugin that ships this one along with the rest of its 1 skill, 4 commands, 1 agent.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for better-auth:add-plugin

README.md
[![agentmods](https://agentmods.dev/badge/commands/secondsky/claude-skills/better-auth-add-plugin.svg)](https://agentmods.dev/commands/secondsky/claude-skills/better-auth-add-plugin)
Your own site
<a href="https://agentmods.dev/commands/secondsky/claude-skills/better-auth-add-plugin"><img src="https://agentmods.dev/badge/commands/secondsky/claude-skills/better-auth-add-plugin.svg" alt="Measured on agentmods" height="20"></a>
Per session 25 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,467 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00025 $0.01467
Opus 5 $0.00013 $0.00733
Sonnet 5 $0.00005 $0.00293
Haiku 4.5 $0.00003 $0.00147

Measured 6d ago against content hash 0e1540837ab0, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

better-auth:add-plugin scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/better-auth/commands/better-auth-add-plugin.md · 279 lines

How it starts

The opening of the file, as written. The whole thing — 279 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Add better-auth Plugin

This command adds a plugin to an existing better-auth configuration.

Usage

/better-auth-add-plugin <plugin-name>

Supported Plugins

Plugin Description
2fa / two-factor Two-factor authentication (TOTP)
passkeys WebAuthn/Passkeys
magic-link Passwordless magic links
email-otp Email-based OTP codes
anonymous Anonymous/guest users
organizations Multi-tenancy support
sso / saml SSO/SAML integration
scim SCIM user provisioning
admin Admin dashboard
api-key API key authentication
bearer Bearer token support
jwt JWT token plugin
oidc OIDC provider
stripe Stripe payments
polar Polar payments

Process

Step 1: Locate Configuration

Find the existing auth configuration:

  • src/auth.ts
  • lib/auth.ts
  • server/auth.ts

Find the client configuration:

  • src/lib/auth-client.ts
  • lib/auth-client.ts

Step 2: Add Server Plugin

Based on the plugin, add the appropriate import and configuration:

Two-Factor Authentication
import { twoFactor } from "better-auth/plugins";

plugins: [
  twoFactor({
    issuer: "Your App Name",
  }),
],
Passkeys
import { passkey } from "@better-auth/passkey";  // extracted package (v1.5+)

plugins: [
  passkey({
    rpID: "your-domain.com",
    rpName: "Your App",
    origin: "https://your-domain.com",
  }),
],
Magic Links
import { magicLink } from "better-auth/plugins";

plugins: [
  magicLink({
    sendMagicLink: async ({ email, token, url }) => {
      // TODO: Implement email sending
      await sendEmail({ to: email, subject: "Sign in", html: `<a href="${url}">Click to sign in</a>` });
    },
  }),
],
Organizations
import { organization } from "better-auth/plugins";

plugins: [
  organization({
    allowUserToCreateOrganization: true,
  }),
],
API Keys
import { apiKey } from "@better-auth/api-key";  // extracted package (v1.5+)

plugins: [
  apiKey({
    prefix: "sk_",
  }),
],

Read the full file on GitHub · 279 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 6d ago First seen · 279 lines · 25 tokens per session scan A 0e1540837ab0

Subscribe to this mod's changes

better-auth:add-plugin is a command published in the GitHub repository secondsky/claude-skills (214 stars, last pushed 3d ago), licensed MIT. It adds 25 tokens to every session and 1,467 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.