better-auth

better-auth is a skill for Claude Code, Codex from fellipeutaka/leon. It costs 131 tokens per session (2,890 once invoked), scanned A, original, MIT.

A TypeScript library for adding sign-in, identity checks, and access control to applications. It supports common methods such as passwords, social-account sign-in, passkeys, magic links, two-step verification, organizations, and sessions.

In plain words
What is it for?
Use it to add authentication and authorization to TypeScript applications, including social sign-in, enterprise single sign-on, passkeys, account administration, and payment-related integrations.
Why use it?
It provides one place to configure how users sign in and how their access is managed instead of implementing these security-sensitive flows yourself.

Skill for Claude CodeCodex

Written for Claude Code and Codex: shipped in a Claude Code plugin, but also agents/openai.yaml present.

Part of the backend-systems plugin — 9 skills shipped together

Good fit Use it to add authentication and authorization to TypeScript applications, including social sign-in, enterprise single sign-on, passkeys, account administration, and payment-related integrations.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/fellipeutaka/leon/better-auth
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.

Any agent
npx skills add fellipeutaka/leon --skill better-auth
Clone the repo
git clone --depth 1 https://github.com/fellipeutaka/leon

Made for: Claude Code, Codex.

Or install backend-systems, the plugin that ships this one along with the rest of its 9 skills.

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/fellipeutaka/leon/better-auth/github.svg)](https://agentmods.dev/skills/fellipeutaka/leon/better-auth)
Your own site
<a href="https://agentmods.dev/skills/fellipeutaka/leon/better-auth"><img src="https://agentmods.dev/badge/skills/fellipeutaka/leon/better-auth/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for better-auth

Your own site · 80×15
<a href="https://agentmods.dev/skills/fellipeutaka/leon/better-auth"><img src="https://agentmods.dev/badge/skills/fellipeutaka/leon/better-auth.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 131 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,890 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.00131 $0.02890
Opus 5.5 $0.00052 $0.01156
Sonnet 5.5 $0.00026 $0.00578
Haiku 4.5 $0.00013 $0.00289

Measured 3mo ago against content hash 0ca9c40bb51b, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

better-auth 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 3mo 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.

skills/better-auth/SKILL.md · 240 lines

How it starts

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

Better Auth

Framework-agnostic TypeScript auth library. Plugin-based architecture, 40+ OAuth providers, 18+ framework integrations.

Quick Start

Install

npm install better-auth

Scoped packages (as needed):

Package Use case
@better-auth/passkey WebAuthn/Passkey auth
@better-auth/sso SAML/OIDC enterprise SSO
@better-auth/stripe Stripe payments
@better-auth/expo React Native/Expo

Environment Variables

BETTER_AUTH_SECRET=<32+ chars, generate: openssl rand -base64 32>
BETTER_AUTH_URL=http://localhost:3000
DATABASE_URL=<connection string>

Server Config (lib/auth.ts)

import { betterAuth } from "better-auth";

export const auth = betterAuth({
  database: process.env.DATABASE_URL,  // or adapter instance
  emailAndPassword: { enabled: true },
  socialProviders: {
    google: {
      clientId: process.env.GOOGLE_CLIENT_ID!,
      clientSecret: process.env.GOOGLE_CLIENT_SECRET!,
    },
  },
  plugins: [], // add plugins here
});

export type Session = typeof auth.$Infer.Session;

Client Config (lib/auth-client.ts)

import { createAuthClient } from "better-auth/react"; // or /vue, /svelte, /solid, /client

export const authClient = createAuthClient({
  plugins: [], // add client plugins here
});

Route Handler

Framework File Handler
Next.js App Router app/api/auth/[...all]/route.ts toNextJsHandler(auth) → export { GET, POST }
Next.js Pages pages/api/auth/[...all].ts toNextJsHandler(auth) → default export
Express any app.all("/api/auth/*splat", toNodeHandler(auth))
Hono route app.on(["POST","GET"], "/api/auth/**", (c) => auth.handler(c.req.raw))
SvelteKit hooks.server.ts svelteKitHandler({ auth, event })
Astro pages/api/auth/[...all].ts toAstroHandler(auth)
Elysia plugin new Elysia().mount(auth.handler)

See references/framework-integrations.md for all frameworks.

Read the full file on GitHub · 240 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. 3mo ago First seen · 240 lines · 131 tokens per session scan A 0ca9c40bb51b

Subscribe to this mod's changes

better-auth is a skill published in the GitHub repository fellipeutaka/leon (5 stars, last pushed 3d ago), licensed MIT. It adds 131 tokens to every session and 2,890 once invoked, about $0.0005 per session on Opus 5.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-31.

Related

better-auth compared with skills from other repositories

better-auth next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
better-authfellipeutaka/leonSkill53d agoMITA131Claude Code, Codex
mem0-oss-to-platformmem0ai/mem0Skill70k3d agoApache-2.0A217Claude Code, Codex
tao-run-inference-serviceNVIDIA/skillsSkill4.2k2d agoApache-2.0A92Claude Code
azure-mgmt-botservice-dotnetmicrosoft/skillsSkill3.3k3d agoMITA78Claude Code
fastapi-router-pymicrosoft/skillsSkill3.3k3d agoMITA46Claude Code
dev-runtimelangwatch/langwatchSkill5.1ktodayApache-2.0A172Claude Code
api-designericrisco/rsc-harnessSkill6825d agoMITA105Claude Code, Codex