ctxpipe: Skill for Claude Code

.agents/skills/better-auth-security-best-practices/SKILL.md

better-auth-security-best-practices is a skill for Claude Code, Codex from ctxpipe-ai/ctxpipe. It costs 59 tokens per session (3,909 once invoked), scanned A, original, MIT.

A security guidance helper for Better Auth, a login and account-management library. It covers protections such as rate limits, request forgery defenses, secure sessions, trusted websites, secret handling, OAuth, IP tracking, and security reviews.

In plain words
What is it for?
Use it when adding or reviewing authentication security in applications built with Better Auth.
Why use it?
It brings together security concerns that affect the whole authentication setup and may be missed when handled separately.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: installed under .agents/ (shared by several agents).

This is ctxpipe-ai/ctxpipe's own configuration. It tells Claude Code and Codex how to work on ctxpipe itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything ctxpipe configures →

Reuse

Borrowing it

Nothing to install: this file belongs to ctxpipe-ai/ctxpipe. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/ctxpipe-ai/ctxpipe/main/.agents/skills/better-auth-security-best-practices/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/ctxpipe-ai/ctxpipe

Made for: Claude Code, Codex.

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-security-best-practices

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/ctxpipe-ai/ctxpipe/better-auth-security-best-practices"><img src="https://agentmods.dev/badge/skills/ctxpipe-ai/ctxpipe/better-auth-security-best-practices.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 59 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,909 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.00059 $0.03909
Opus 5.5 $0.00024 $0.01564
Sonnet 5.5 $0.00012 $0.00782
Haiku 4.5 $0.00006 $0.00391

Measured 1mo ago against content hash 5124e42ccce3, 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-security-best-practices 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 1mo 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.

.agents/skills/better-auth-security-best-practices/SKILL.md · 645 lines

How it starts

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

Secret Management

The auth secret is the foundation of Better Auth's security. It's used for signing session tokens, encrypting sensitive data, and generating secure cookies.

Configuring the Secret

import { betterAuth } from "better-auth";

export const auth = betterAuth({
  secret: process.env.BETTER_AUTH_SECRET, // or via `BETTER_AUTH_SECRET` env
});

Better Auth looks for secrets in this order:

  1. options.secret in your config
  2. BETTER_AUTH_SECRET environment variable
  3. AUTH_SECRET environment variable

Secret Requirements

Better Auth validates your secret and will:

  • Reject default/placeholder secrets in production
  • Warn if the secret is shorter than 32 characters
  • Warn if entropy is below 120 bits

Generate a secure secret:

openssl rand -base64 32

Important: Never commit secrets to version control. Use environment variables or a secrets manager.

Rate Limiting

Rate limiting protects your authentication endpoints from brute-force attacks and abuse. By default, rate limiting is enabled in production but disabled in development. To explicitly enable it, set rateLimit.enabled to true in your auth config. Better Auth applies rate limiting to all endpoints by default.

Each plugin can optionally have it's own configuration to adjust rate-limit rules for a given endpoint.

Default Configuration

import { betterAuth } from "better-auth";

export const auth = betterAuth({
  rateLimit: {
    enabled: true, // Default: true in production
    window: 10, // Time window in seconds (default: 10)
    max: 100, // Max requests per window (default: 100)
  },
});

Storage Options

Configure where rate limit counters are stored:

rateLimit: {
  storage: "database", // Options: "memory", "database", "secondary-storage"
}
  • memory: Fast, but resets on server restart (default when no secondary storage)
  • database: Persistent, but adds database load
  • secondary-storage: Uses configured secondary storage like Redis (default when available)

Read the full file on GitHub · 645 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. 1mo ago First seen · 645 lines · 59 tokens per session scan A 5124e42ccce3

Subscribe to this mod's changes

better-auth-security-best-practices is a skill published in the GitHub repository ctxpipe-ai/ctxpipe (27 stars, last pushed today), licensed MIT. It adds 59 tokens to every session and 3,909 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

Other skills, from other repositories

setup-open-index

Install and configure Open Index as the read/write context layer for a domain-specialized agent. Use when setting up a legal, marketing, customer support, sales, infrastructure, or other domain agent with Open Index over MCP.

DrDroidLab/open-index · 48 tokens

edit-brain

How to add or edit knowledge in this brain — define doctypes, add or update entities, and correlate them with relationships. Use whenever the user asks to add/update knowledge, define a concept, record a learning, or link two things in the brain.

DrDroidLab/open-index · 55 tokens

bcc-plan-spar

BCC align+lock+review PLAN.md for one slice (no product code). Slash: /bcc-plan-spar · chat: bcc:plan-spar · "lock PLAN" · spar the plan. Args: rounds=N (auto-review cap), review=self|subagent|cli|auto|off. Grill until clear enough (no default Q&A quota). Hand off to bcc-clean-cut after human APPROVE.

bo-cao/breaking-coding-chaos · 91 tokens

bcc-throughline

BCC global progress cockpit (plans.md/progress.md/findings.md). Slash: /bcc-throughline · chat: bcc:throughline · "where are we" · reprioritize · resume after /clear. Not for coding or full PLAN grill.

bo-cao/breaking-coding-chaos · 56 tokens

bcc-breaking-coding-chaos

BCC main skill: dual-loop coding workflow (throughline → plan-spar → clean-cut) or quick status+next. Slash: /bcc-breaking-coding-chaos · chat: bcc:breaking-coding-chaos · "run BCC" · "BCC status" · "what next BCC". Needs a real idea (1:1 implement). Args: goal text, or status. May pass plan-spar review budget as…

bo-cao/breaking-coding-chaos · 101 tokens

bcc-clean-cut

BCC minimal implement from locked PLAN.md (ponytail ladder + verify). Slash: /bcc-clean-cut · chat: bcc:clean-cut · "implement PLAN" after human APPROVE. Not for plan grill (use bcc-plan-spar).

bo-cao/breaking-coding-chaos · 55 tokens