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.5 $0.00016 $0.00292
Sonnet 5.5 $0.00008 $0.00146
Haiku 4.5 $0.00004 $0.00073

Measured 3mo ago against content hash 588c759a5c60, 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-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 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.

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. 3mo 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 (79 stars, last pushed 4mo ago), licensed MIT. It adds 39 tokens to every session and 730 once invoked, about $0.0002 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-30.

Related

better-auth-core compared with skills from other repositories

better-auth-core next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
better-auth-corebobmatnyc/claude-mpm-skillsSkill794mo agoMITA39Claude Code
mem0-oss-to-platformmem0ai/mem0Skill70k2d 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-harnessSkill6824d agoMITA105Claude Code, Codex