dev-auth

dev-auth is a skill for Claude Code from christopherlouet/claude-base. It costs 62 tokens per session (2,410 once invoked), scanned A, original, MIT.

A guide to adding user authentication to modern web applications. Authentication covers accounts, login, sessions, OAuth, passwordless links, and two-factor verification.

In plain words
What is it for?
Use it to implement or review signup, login, sessions, OAuth, magic links, two-factor authentication, and authentication migrations.
Why use it?
It helps avoid unsafe home-built login systems and choose a maintained authentication library suited to the application.

Skill for Claude Code

Written for Claude Code: installed under .claude/.

Good fit Use it to implement or review signup, login, sessions, OAuth, magic links, two-factor authentication, and authentication migrations.

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

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 dev-auth

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/christopherlouet/claude-base/dev-auth"><img src="https://agentmods.dev/badge/skills/christopherlouet/claude-base/dev-auth.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 62 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,410 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.00062 $0.02410
Opus 5.5 $0.00025 $0.00964
Sonnet 5.5 $0.00012 $0.00482
Haiku 4.5 $0.00006 $0.00241

Measured 20d ago against content hash 1a5491a1a3a4, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

dev-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 20d 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.

.claude/skills/dev-auth/SKILL.md · 299 lines

How it starts

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

Modern Web Auth

Choosing your auth stack

Solution When to choose Avoid when
better-auth Total control, TS-first, extensible (plugins), native 2FA/passkeys Project < 1 week MVP
Own sessions (the Lucia guide) Minimalism, you own every line — Lucia the library was deprecated in March 2025, its author now publishes the session code as a guide No time for plumbing
NextAuth/Auth.js Next.js ecosystem, easy OAuth, lots of adapters Need fine control over sessions
Clerk Fast MVP, pre-built UI, paid SaaS Limited budget, sovereign data control
Supabase Auth Already on Supabase, RLS for authorization Non-Postgres stack, complex custom auth
Auth0 / Okta Enterprise, SAML/SCIM compliance Indie apps, high cost

IMPORTANT: Never roll your own auth (homemade JWT, custom password hashing). Use a maintained lib.

Framework-agnostic (Next, Remix, SvelteKit, Nuxt, vanilla). TypeScript-first.

Install

npm install better-auth

Minimal setup (Next.js)

// lib/auth.ts
import { betterAuth } from "better-auth";
import { Pool } from "pg";

export const auth = betterAuth({
  database: new Pool({ connectionString: process.env.DATABASE_URL }),
  emailAndPassword: { enabled: true },
  socialProviders: {
    github: {
      clientId: process.env.GITHUB_CLIENT_ID!,
      clientSecret: process.env.GITHUB_CLIENT_SECRET!,
    },
  },
});
// app/api/auth/[...all]/route.ts
import { auth } from "@/lib/auth";
import { toNextJsHandler } from "better-auth/next-js";

export const { GET, POST } = toNextJsHandler(auth);

Client

// lib/auth-client.ts
import { createAuthClient } from "better-auth/react";

export const authClient = createAuthClient();

// Usage
const { data: session } = authClient.useSession();
await authClient.signIn.email({ email, password });
await authClient.signUp.email({ email, password, name });
await authClient.signOut();

Read the full file on GitHub · 299 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. 20d ago Changed · -2 lines · +4 tokens per session 1a5491a1a3a4
  2. 26d ago Changed · -2 lines 97b0587c5197
  3. 27d ago Changed · -6 lines 44070eae5231
  4. 28d ago Changed · -1 lines 105264cb951b
  5. 1mo ago First seen · 310 lines · 58 tokens per session scan A b7d7ed2bdb7c

Subscribe to this mod's changes

dev-auth is a skill published in the GitHub repository christopherlouet/claude-base (5 stars, last pushed 6d ago), licensed MIT. It adds 62 tokens to every session and 2,410 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-09-03.

Related

Other skills, from other repositories

agent-django-fastapi-expert

Specialist subagent: Django ORM, Django REST Framework, FastAPI async patterns, and Pydantic v2 specialist. Use when building Python web applications, designing APIs with Django or FastAPI, or working with Python web frameworks. Trigger phrases: Django, FastAPI, DRF, Django REST Framework, Pydantic, ORM, queryset…

travisjneuman/.claude · 92 tokens

authentication-patterns

OAuth 2.0, JWT, SSO, MFA, NextAuth/Clerk/Supabase Auth implementation patterns.

travisjneuman/.claude · 28 tokens

email-systems

Transactional email (Resend, SendGrid, SES), templates (React Email, MJML), deliverability (SPF/DKIM/DMARC), and inboxing best practices. Use when building email infrastructure, designing templates, or troubleshooting deliverability.

travisjneuman/.claude · 55 tokens

event-driven-architecture

Kafka, RabbitMQ, SQS/SNS, event sourcing, CQRS, saga patterns, dead letter queues, and idempotency. Use when designing asynchronous systems, implementing message-driven workflows, or building event streaming pipelines.

travisjneuman/.claude · 50 tokens

microservices-architecture

Microservices architecture patterns and best practices. Use when designing distributed systems, breaking down monoliths, or implementing service communication.

travisjneuman/.claude · 30 tokens

payment-integration

Stripe, RevenueCat, subscription billing, webhooks, PCI compliance, and tax. Use when integrating payments or subscriptions, handling payment webhooks, or reviewing billing and PCI scope.

travisjneuman/.claude · 40 tokens