explain-error

explain-error is a skill for Claude Code from smicolon/ai-kit. It costs 29 tokens per session (863 once invoked), scanned A, original, MIT.

A guide to diagnosing Better Auth errors, configuration problems, database adapter mismatches, and authentication failures. Better Auth is a library for adding sign-in and account management to applications.

In plain words
What is it for?
Use it when troubleshooting sign-in, sign-up, password, social-login, or Better Auth database configuration errors.
Why use it?
It explains common login failures and points to likely causes such as incorrect credentials, password hashing changes, or account-linking settings.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the better-auth plugin — 3 skills shipped together

Good fit Use it when troubleshooting sign-in, sign-up, password, social-login, or Better Auth database configuration errors.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/smicolon/ai-kit/explain-error
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 smicolon/ai-kit --skill explain-error
Clone the repo
git clone --depth 1 https://github.com/smicolon/ai-kit

Made for: Claude Code.

Or install better-auth, the plugin that ships this one along with the rest of its 3 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 explain-error

README.md
[![agentmods](https://agentmods.dev/badge/skills/smicolon/ai-kit/explain-error/github.svg)](https://agentmods.dev/skills/smicolon/ai-kit/explain-error)
Your own site
<a href="https://agentmods.dev/skills/smicolon/ai-kit/explain-error"><img src="https://agentmods.dev/badge/skills/smicolon/ai-kit/explain-error/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 explain-error

Your own site · 80×15
<a href="https://agentmods.dev/skills/smicolon/ai-kit/explain-error"><img src="https://agentmods.dev/badge/skills/smicolon/ai-kit/explain-error.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 29 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 863 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.00029 $0.00863
Opus 5.5 $0.00012 $0.00345
Sonnet 5.5 $0.00006 $0.00173
Haiku 4.5 $0.00003 $0.00086

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

Security

Grade A, and why

explain-error 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.

packs/better-auth/skills/explain-error/SKILL.md · 99 lines

How it starts

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

Better Auth Error Diagnostician & Explainer

This skill diagnoses and provides actionable resolutions for common Better Auth runtime errors, client error codes, configuration pitfalls, and database adapter issues.

Common Error Codes & Resolutions

1. INVALID_EMAIL_OR_PASSWORD

  • Cause: User credentials do not match database records, or password hashing mismatch.
  • Resolution:
    • Verify that password hashing algorithm has not changed between migrations.
    • Verify that input email is trimmed/lowercased if emailAndPassword.autoSignIn or normalization is enabled.
    • Check client-side error handling:
      const { data, error } = await authClient.signIn.email({
        email,
        password,
      })
      if (error?.status === 401 || error?.code === 'INVALID_EMAIL_OR_PASSWORD') {
        // Prompt user with user-friendly message
      }
      

2. USER_ALREADY_EXISTS

  • Cause: Attempting to sign up with an email or account ID already in use.
  • Resolution:
    • Direct user to sign in or password reset flow.
    • If social login is used with existing email, check accountLinking.enabled:
      export const auth = betterAuth({
        account: {
          accountLinking: {
            enabled: true,
            trustedProviders: ['google', 'github'],
          },
        },
      })
      

3. SESSION_EXPIRED / UNAUTHORIZED

  • Cause: Cookie expired, missing credentials: "include" on cross-origin fetch, or cookie domain mismatch.
  • Resolution:
    • Client side: ensure authClient has the exact baseURL matching server.
    • Cross-domain setup:
      export const auth = betterAuth({
        trustedOrigins: ['https://app.example.com', 'http://localhost:3000'],
        advanced: {
          crossSubDomainCookies: {
            enabled: true,
            domain: '.example.com',
          },
        },
      })
      

4. FAILED_TO_VERIFY_EMAIL / INVALID_TOKEN

  • Cause: Verification token expired or used already.
  • Resolution:
    • Verify email verification URL configuration in emailVerification:
      emailVerification: {
        sendOnSignUp: true,
        autoSignInAfterVerification: true,
        sendVerificationEmail: async ({ user, url, token }) => {
          await sendEmail({ to: user.email, url })
        },
      }
      

Read the full file on GitHub · 99 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 · 99 lines · 29 tokens per session scan A 2fb12603f46d

Subscribe to this mod's changes

explain-error is a skill published in the GitHub repository smicolon/ai-kit (6 stars, last pushed 1mo ago), licensed MIT. It adds 29 tokens to every session and 863 once invoked, about $0.0001 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-04.