convex-auth

convex-auth is a skill for Claude Code from PolarCoding85/convex-agent-skillz. It costs 52 tokens per session (1,296 once invoked), scanned A, original, MIT.

A guide to authentication in Convex backends, where authentication checks whether a user has signed in and authorization controls what that user may do. It covers reading user identity, storing users, protecting functions, and avoiding login-related race conditions.

In plain words
What is it for?
Use it to protect Convex queries, mutations, and actions, identify signed-in users, connect user records to authentication, or debug authentication behavior.
Why use it?
It provides provider-independent patterns for keeping backend functions from serving unauthenticated or unauthorized requests.

Skill for Claude Code

Written for Claude Code: installed under .claude/.

Good fit Use it to protect Convex queries, mutations, and actions, identify signed-in users, connect user records to authentication, or debug authentication behavior.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/polarcoding85/convex-agent-skillz/convex-auth-skill
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 PolarCoding85/convex-agent-skillz --skill convex-auth-skill
Clone the repo
git clone --depth 1 https://github.com/PolarCoding85/convex-agent-skillz

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

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/polarcoding85/convex-agent-skillz/convex-auth-skill"><img src="https://agentmods.dev/badge/skills/polarcoding85/convex-agent-skillz/convex-auth-skill.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 52 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,296 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.00052 $0.01296
Opus 5.5 $0.00021 $0.00518
Sonnet 5.5 $0.00010 $0.00259
Haiku 4.5 $0.00005 $0.00130

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

Security

Grade A, and why

convex-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 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.

.claude/skills/convex-auth-skill/SKILL.md · 206 lines

How it starts

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

Convex Authentication - Core Patterns

This skill covers universal auth patterns that work with ANY authentication provider.

Auth in Functions

Access the authenticated user via ctx.auth.getUserIdentity():

import { query, mutation, action } from './_generated/server';

export const myQuery = query({
  args: {},
  handler: async (ctx) => {
    const identity = await ctx.auth.getUserIdentity();
    if (identity === null) {
      throw new Error('Not authenticated');
    }
    // identity.tokenIdentifier - unique across providers
    // identity.subject - user ID from provider
    // identity.email, identity.name, etc. (if configured)
  }
});

UserIdentity Fields

Field Guaranteed Description
tokenIdentifier ✅ Unique ID (subject + issuer combined)
subject ✅ User ID from auth provider
issuer ✅ Auth provider domain
email Provider-dependent User's email
name Provider-dependent Display name
pictureUrl Provider-dependent Avatar URL

Critical: Race Condition Prevention

Problem: Queries can execute before auth is validated on page load.

Client-side: Always use useConvexAuth() from convex/react, NOT your provider's hook:

// ✅ Correct - waits for Convex to validate token
import { useConvexAuth } from 'convex/react';
const { isLoading, isAuthenticated } = useConvexAuth();

// ❌ Wrong - only checks provider, not Convex validation
const { isSignedIn } = useAuth(); // from @clerk/clerk-react

Skip queries until authenticated:

const user = useQuery(api.users.current, isAuthenticated ? {} : 'skip');

Use Convex auth components:

Read the full file on GitHub · 206 lines

Files

What ships with it

2 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. 1mo ago First seen · 206 lines · 52 tokens per session scan A 901ed7c63171

Subscribe to this mod's changes

convex-auth is a skill published in the GitHub repository PolarCoding85/convex-agent-skillz (16 stars, last pushed 8mo ago), licensed MIT. It adds 52 tokens to every session and 1,296 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

mcp-server

Configure, launch, validate, and troubleshoot CCAM's comprehensive MCP server for Claude Code, Codex, and other MCP hosts. Use when installing dependencies, building the server, selecting stdio, HTTP, or REPL transport, setting mutation/destructive policy, supplying dashboard authentication, or checking complete tool…

hoangsonww/Claude-Code-Agent-Monitor · 66 tokens

endpoint-probe

Probes each major Agent Monitor API route — /api/stats, /api/analytics, /api/sessions, /api/pricing/cost, /api/workflows/runs, /api/cc-config/overview — and reports each one's HTTP status, latency, and response shape, flagging which are reachable. Use to verify a dashboard install is wired up correctly.

hoangsonww/Claude-Code-Agent-Monitor · 80 tokens

laravel-architecture

Use when structuring a Laravel project, creating services/repositories/actions, implementing dependency injection, or organizing code layers.

fusengine/agents · 28 tokens

fusecore

Use when creating modules, understanding FuseCore structure, or implementing features in a FuseCore modular-monolith Laravel project.

fusengine/agents · 27 tokens

laravel-api

Use when creating API endpoints, transforming responses with API Resources, or handling API authentication, rate limiting, or versioning.

fusengine/agents · 28 tokens

laravel-attributes

Use when migrating Eloquent models, Jobs, Console commands, Controllers, API Resources, Validation, Factories or Seeders to Laravel 13 PHP attributes.

fusengine/agents · 36 tokens