better-auth-core

better-auth-core is a skill for Claude Code from bobmatnyc/claude-mpm-skills. It costs 39 tokens per session (730 once invoked), scanned A, original, MIT.

A setup guide for adding Better Auth authentication to TypeScript applications. It covers the authentication server, database or stateless sessions, client setup, environment variables, and social or password login.

In plain words
What is it for?
Use it to create the Better Auth instance, connect its data layer, configure URLs and secrets, mount authentication handlers, and create a client for the application.
Why use it?
It provides the core configuration needed for sign-in and sessions before connecting authentication to a specific web framework.

Skill for Claude Code

Written for Claude Code: disable-model-invocation in frontmatter.

Good fit Use it to create the Better Auth instance, connect its data layer, configure URLs and secrets, mount authentication handlers, and create a client for the application.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/bobmatnyc/claude-mpm-skills/better-auth-core
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 bobmatnyc/claude-mpm-skills --skill better-auth-core
Clone the repo
git clone --depth 1 https://github.com/bobmatnyc/claude-mpm-skills

Made for: Claude Code.

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-core

README.md
[![agentmods](https://agentmods.dev/badge/skills/bobmatnyc/claude-mpm-skills/better-auth-core/github.svg)](https://agentmods.dev/skills/bobmatnyc/claude-mpm-skills/better-auth-core)
Your own site
<a href="https://agentmods.dev/skills/bobmatnyc/claude-mpm-skills/better-auth-core"><img src="https://agentmods.dev/badge/skills/bobmatnyc/claude-mpm-skills/better-auth-core/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-core

Your own site · 80×15
<a href="https://agentmods.dev/skills/bobmatnyc/claude-mpm-skills/better-auth-core"><img src="https://agentmods.dev/badge/skills/bobmatnyc/claude-mpm-skills/better-auth-core.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 39 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 730 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00039 $0.00730
Opus 5 $0.00019 $0.00365
Sonnet 5 $0.00008 $0.00146
Haiku 4.5 $0.00004 $0.00073

Measured 11d ago against content hash 588c759a5c60, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

better-auth-core 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 11d 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.

toolchains/platforms/auth/better-auth/better-auth-core/SKILL.md · 83 lines

How it starts

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

Better Auth Core (TypeScript)

Goals

  • Set up a Better Auth instance with environment variables and data layer wiring.
  • Wire server handlers and a client instance.
  • Use sessions and server-side API methods safely.
  • Keep data-layer choices pluggable (drivers or adapters).

Quick start

  1. Install better-auth.
  2. Set BETTER_AUTH_SECRET (32+ chars) and BETTER_AUTH_URL.
  3. Create auth.ts and export auth.
  4. Provide database (driver or adapter) or omit for stateless sessions.
  5. Mount a handler (auth.handler or a framework helper).
  6. Create a client with createAuthClient.
import { betterAuth } from "better-auth";

export const auth = betterAuth({
  database: myDatabaseOrAdapter, // driver or adapter; omit for stateless mode
  emailAndPassword: { enabled: true },
  socialProviders: {
    github: {
      clientId: process.env.GITHUB_CLIENT_ID as string,
      clientSecret: process.env.GITHUB_CLIENT_SECRET as string,
    },
  },
});

Core setup checklist

  • Export the instance as auth (or default export) so helpers find it.
  • Keep BETTER_AUTH_URL in sync with the public base URL.
  • Pass the full base URL to the client if you change the /api/auth base path.
  • Add database migrations before enabling plugins that require tables.

Server API usage

  • Call server endpoints via auth.api.* with { body, headers, query }.
  • Use asResponse: true if you need a Response object.
  • Use returnHeaders: true to access Set-Cookie headers.
import { auth } from "./auth";

const session = await auth.api.getSession({
  headers: request.headers,
});

const response = await auth.api.signInEmail({
  body: { email, password },
  asResponse: true,
});

Session access

  • Client: authClient.useSession() or authClient.getSession().
  • Server: auth.api.getSession({ headers }).

TypeScript tips

  • Infer types with auth.$Infer and authClient.$Infer.
  • Use inferAdditionalFields on the client when you extend the user schema.

Read the full file on GitHub · 83 lines

Files

What ships with it

4 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 11d ago First seen · 83 lines · 39 tokens per session scan A 588c759a5c60

Subscribe to this mod's changes

better-auth-core is a skill published in the GitHub repository bobmatnyc/claude-mpm-skills (74 stars, last pushed 1mo ago), licensed MIT. It adds 39 tokens to every session and 730 once invoked, about $0.0002 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.

Related

Other skills, from other repositories

mem0-oss-to-platform

Plan and then execute a migration of a project from the mem0 open-source / self-hosted SDK (the local Memory class) to the mem0 Platform / hosted / managed SDK (the MemoryClient class). Use this whenever a developer wants to move, switch, or migrate their mem0 usage off OSS/self-hosted to the hosted API — e.g.…

mem0ai/mem0 · 273 tokens

agui-dotnet-protobuf

Use the protobuf wire transport (instead of the default Server-Sent Events) for an AG-UI connection with the AG-UI .NET SDK — a compact binary event stream negotiated via the Accept header. USE FOR: making an AGUIChatClient prefer protobuf by wiring an AGUIEventStreamHandler with ProtobufEventStreamFormatter (then…

ag-ui-protocol/ag-ui · 162 tokens

azure-mgmt-botservice-dotnet

Azure Resource Manager SDK for Bot Service in .NET. Management plane operations for creating and managing Azure Bot resources, channels (Teams, DirectLine, Slack), and connection settings. Triggers: "Bot Service", "BotResource", "Azure Bot", "DirectLine channel", "Teams channel", "bot management .NET", "create bot".

microsoft/skills · 78 tokens

fastapi-router-py

Create FastAPI routers with CRUD operations, authentication dependencies, and proper response models. Use when building REST API endpoints, creating new routes, implementing CRUD operations, or adding authenticated endpoints in FastAPI applications.

microsoft/skills · 46 tokens

aws-sdk-java-v2-core

Provides AWS SDK for Java 2.x client configuration, credential resolution, HTTP client tuning, timeout, retry, and testing patterns. Use when creating or hardening AWS service clients, wiring Spring Boot beans, debugging auth or region issues, or choosing sync vs async SDK usage.

giuseppe-trisciuoglio/developer-kit · 62 tokens

migrate-segw-to-rap

Reverse-engineer a SEGW-built OData V2 service (MPC/DPC/MPCEXT/DPCEXT) into a modern RAP V4 service — tables, CDS views (interface + projection), behavior definitions, draft entities, service definition + binding. Use when asked to "migrate this SEGW service to RAP", "convert OData V2 to V4 RAP", "modernize this…

arc-mcp/arc-1 · 106 tokens