| name | clerk-cost-tuning |
| description | Optimize Clerk costs and understand pricing.
Use when planning budget, reducing costs,
or understanding Clerk pricing model.
Trigger with phrases like "clerk cost", "clerk pricing",
"reduce clerk cost", "clerk billing", "clerk budget".
|
| allowed-tools | Read, Write, Edit, Grep |
| version | 1.14.0 |
| license | MIT |
| author | Jeremy Longshore <jeremy@intentsolutions.io> |
| tags | ["saas","clerk","cost-optimization"] |
| compatibility | Designed for Claude Code, also compatible with Codex and OpenClaw |
Clerk Cost Tuning
Overview
Understand Clerk pricing and optimize costs. Clerk charges by Monthly Retained Users (MRU) — a user is counted as retained only when they return 24+ hours after signing up. Covers pricing tiers, MRU reduction strategies, caching to reduce API calls, and usage monitoring.
Prerequisites
- Clerk account active
- Understanding of MRU (Monthly Retained Users)
- Application usage patterns known
Instructions
Step 1: Understand Clerk Pricing Model
| Plan | Price | MRU Included | Extra MRU |
|---|
| Free (Hobby) | $0/mo | 50,000 MRU | N/A |
| Pro | $25/mo ($20/mo billed annually) | 50,000 MRU | $0.02/MRU |
| Business | $300/mo ($250/mo billed annually) | 50,000 MRU | $0.02/MRU |
| Enterprise | Custom | Custom | Custom |
Key pricing concepts:
- MRU = unique user who returns to your app 24+ hours after signing up ("first day free" — sign-up-day activity never counts)
- Users who sign up and never return are not billed
- Users who only visit public pages are not counted
- Bot/crawler sessions are not counted
- Test/development instances are free and unlimited
Step 2: Reduce MRU Count
import { clerkMiddleware, createRouteMatcher } from '@clerk/nextjs/server'
const requiresAuth = createRouteMatcher([
'/dashboard(.*)',
'/settings(.*)',
'/api/protected(.*)',
])
export default clerkMiddleware(async (auth, req) => {
((req)) {
auth.()
}
})