Collect comprehensive debug information for Clerk issues. An agent skill from jeremylongshore/tons-of-skills-marketplace.

MITAuto-check passedSales & Support

Install Clerk Debug Bundle

skills CLI
$ npx skills add jeremylongshore/tons-of-skills-marketplace --skill clerk-debug-bundle -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install jeremylongshore/tons-of-skills-marketplace clerk-debug-bundle --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/jeremylongshore/tons-of-skills-marketplace.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/.curated/clerk-debug-bundle .claude/skills/clerk-debug-bundle && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
clerk-debug-bundle
GitHub stars
2.8k
Token cost
~2k tokens
SKILL.md length
201 words
Files
2 (incl. references)
Skills in repo
3,342
Repo updated
First seen
Licence
MIT

At a glance

Collect comprehensive debug information for Clerk issues. An agent skill from jeremylongshore/tons-of-skills-marketplace.

  • Works in 5 steps: Environment Debug Script → Runtime Health Check Endpoint → Client-Side Debug Component → …
  • Troubleshooting complex problems
  • SKILL.md covers Current State, Overview, Prerequisites and Instructions, plus 5 more sections
  • Calls npm, curl and npx; reaches api.clerk.com; needs CLERK_SECRET_KEY and NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY

What it does

Clerk Debug Bundle is an agent skill from jeremylongshore/tons-of-skills-marketplace. Collect comprehensive debug information for Clerk issues. Use when troubleshooting complex problems, preparing support tickets, or diagnosing intermittent issues. Trigger with phrases like "clerk debug", "clerk diagnostics", "clerk support ticket", "clerk troubleshooting".

Its SKILL.md is about 2k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files, including reference files (for example `references/implementation-guide.md`). Compatibility notes: Designed for Claude Code

It sits in Sales & Support, covering Customer support. The repository describes itself as: Model-agnostic agent-skills platform with a harness-free canonical layer, verified adapters, and the ccpi package manager. Explore at tonsofskills.com. The licence is MIT.

When your agent uses it

  • Troubleshooting complex problems
  • Preparing support tickets
  • Diagnosing intermittent issues
  • With phrases like clerk debug

Example prompts

  • “clerk debug”
  • “clerk diagnostics”
  • “clerk support ticket”
  • “/clerk-debug-bundle”

Requirements

  • Node.js
  • A credential in NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY
  • A credential in CLERK_SECRET_KEY
  • Compatibility (from SKILL.md): Designed for Claude Code
  • Pre-approved tools (allowed-tools): Read, Write, Edit, Bash(npm:*), Bash(node:*), Grep

Workflow steps

5 steps, taken from the step headings in SKILL.md.

  1. Environment Debug Script
  2. Runtime Health Check Endpoint
  3. Client-Side Debug Component
  4. Request Debug Middleware
  5. Generate Support Bundle

What it can do on your machine

Read from SKILL.md and the folder at commit cfae287. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Read
    • Write
    • Edit
    • Bash(npm:*)
    • Bash(node:*)
    • Grep

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • npm
    • curl
    • npx
    • jq
    • node

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • api.clerk.com

    Also links to:

    • clerk.com
    • github.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • CLERK_SECRET_KEY
    • NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

  • Compatibility

    Designed for Claude Code

    From compatibility in the SKILL.md frontmatter.

Context cost

Clerk Debug Bundle loads about 2k tokens when it runs, and up to ~3.7k if it reads all its reference files. Until then it costs about 73 tokens; SKILL.md has 201 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~73
When it runs · the whole SKILL.md, loaded when a task matches
~2k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~3.7k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from jeremylongshore/tons-of-skills-marketplace at commit cfae287, republished under its MIT licence (© jeremylongshore). 201 words, ~2,043 tokens.

Download SKILL.mdSave it as .claude/skills/clerk-debug-bundle/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
clerk-debug-bundle
description
Collect comprehensive debug information for Clerk issues. Use when troubleshooting complex problems, preparing support tickets, or diagnosing intermittent issues. Trigger with phrases like "clerk debug", "clerk diagnostics", "clerk support ticket", "clerk troubleshooting".
allowed-tools
Read, Write, Edit, Bash(npm:*), Bash(node:*), Grep
compatibility
Designed for Claude Code
version
1.15.0
license
MIT
author
Jeremy Longshore <jeremy@intentsolutions.io>
tags
saas, clerk, debugging

Clerk Debug Bundle

Current State

!node --version 2>/dev/null || echo 'N/A' !npm list @clerk/nextjs @clerk/clerk-react @clerk/express 2>/dev/null | grep clerk || echo 'No Clerk packages found'

Overview

Collect all necessary debug information for Clerk troubleshooting and support tickets. Generates an environment report, runtime health check, client-side debug panel, and support bundle.

Prerequisites

  • Clerk SDK installed
  • Access to application logs
  • Browser with developer tools

Instructions

Step 1: Environment Debug Script
typescript
// scripts/clerk-debug.ts
import { createClerkClient } from '@clerk/backend'

async function collectDebugInfo() {
  const info: Record<string, any> = {
    timestamp: new Date().toISOString(),
    nodeVersion: process.version,
    platform: process.platform,
    env: {
      hasPK: !!process.env.NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY,
      hasSK: !!process.env.CLERK_SECRET_KEY,
      pkPrefix: process.env.NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY?.slice(0, 8) + '...',
      nodeEnv: process.env.NODE_ENV,
    },
  }

  // Test API connectivity
  try {
    const clerk = createClerkClient({ secretKey: process.env.CLERK_SECRET_KEY! })
    const users = await clerk.users.getUserList({ limit: 1 })
    info.apiConnectivity = { status: 'ok', userCount: users.totalCount }
  } catch (err: any) {
    info.apiConnectivity = { status: 'error', message: err.message, code: err.status }
  }

  // Check package versions
  try {
    const pkg = require('./package.json')
    info.packages = Object.entries(pkg.dependencies || {})
      .filter(([k]) => k.includes('clerk'))
      .reduce((acc, [k, v]) => ({ ...acc, [k]: v }), {})
  } catch {
    info.packages = 'Could not read package.json'
  }

  console.log(JSON.stringify(info, null, 2))
  return info
}

collectDebugInfo()

Run with:

bash
npx tsx scripts/clerk-debug.ts
Step 2: Runtime Health Check Endpoint
typescript
// app/api/clerk-health/route.ts
import { auth, clerkClient } from '@clerk/nextjs/server'

export async function GET() {
  const checks: Record<string, { status: string; detail?: string }> = {}

  // Check 1: SDK loaded
  checks.sdk = { status: 'ok', detail: 'Clerk SDK loaded' }

  // Check 2: Auth function works
  try {
    const { userId } = await auth()
    checks.auth = { status: 'ok', detail: userId ? `Authenticated as ${userId}` : 'Not authenticated (expected for health check)' }
  } catch (err: any) {
    checks.auth = { status: 'error', detail: err.message }
  }

  // Check 3: Backend API connectivity
  try {
    const client = await clerkClient()
    await client.users.getUserList({ limit: 1 })
    checks.backendApi = { status: 'ok', detail: 'API reachable' }
  } catch (err: any) {
    checks.backendApi = { status: 'error', detail: err.message }
  }

  // Check 4: Environment variables
  checks.envVars = {
    status: process.env.CLERK_SECRET_KEY ? 'ok' : 'error',
    detail: process.env.CLERK_SECRET_KEY ? 'Secret key configured' : 'CLERK_SECRET_KEY missing',
  }

  const allOk = Object.values(checks).every((c) => c.status === 'ok')
  return Response.json({ healthy: allOk, checks }, { status: allOk ? 200 : 503 })
}
Step 3: Client-Side Debug Component
typescript
'use client'
import { useAuth, useUser, useSession } from '@clerk/nextjs'
import { useState } from 'react'

export function ClerkDebugPanel() {
  const { userId, isLoaded: authLoaded, getToken } = useAuth()
  const { user, isLoaded: userLoaded } = useUser()
  const { session } = useSession()
  const [tokenPreview, setTokenPreview] = useState<string | null>(null)

  if (process.env.NODE_ENV === 'production') return null // Hide in prod

  const inspectToken = async () => {
    const token = await getToken()
    if (token) {
      const payload = JSON.parse(atob(token.split('.')[1]))
      setTokenPreview(JSON.stringify(payload, null, 2))
    }
  }

  return (
    <details style={{ position: 'fixed', bottom: 10, right: 10, background: '#1a1a2e', color: '#eee', padding: 12, borderRadius: 8, fontSize: 12, zIndex: 9999 }}>
      <summary>Clerk Debug</summary>
      <pre>
        Auth loaded: {String(authLoaded)}{'\n'}
        User loaded: {String(userLoaded)}{'\n'}
        User ID: {userId || 'null'}{'\n'}
        Email: {user?.primaryEmailAddress?.emailAddress || 'N/A'}{'\n'}
        Session ID: {session?.id || 'null'}{'\n'}
        Session status: {session?.status || 'N/A'}{'\n'}
        Last active: {session?.lastActiveAt ? new Date(session.lastActiveAt).toISOString() : 'N/A'}
      </pre>
      <button onClick={inspectToken}>Inspect JWT</button>
      {tokenPreview && <pre>{tokenPreview}</pre>}
    </details>
  )
}
Step 4: Request Debug Middleware
typescript
// middleware.ts — add debug logging (development only)
import { clerkMiddleware } from '@clerk/nextjs/server'

export default clerkMiddleware(async (auth, req) => {
  if (process.env.CLERK_DEBUG === 'true') {
    const { userId, sessionId } = await auth()
    console.log(`[Clerk Debug] ${req.method} ${req.nextUrl.pathname}`, {
      userId: userId || 'anonymous',
      sessionId: sessionId?.slice(0, 8) || 'none',
      cookies: req.cookies.getAll().map((c) => c.name).filter((n) => n.startsWith('__clerk')),
    })
  }
})
Step 5: Generate Support Bundle
bash
#!/bin/bash
# scripts/clerk-support-bundle.sh
set -euo pipefail

BUNDLE_DIR="clerk-debug-$(date +%Y%m%d-%H%M%S)"
mkdir -p "$BUNDLE_DIR"

# Package versions
npm list --depth=0 2>/dev/null | grep clerk > "$BUNDLE_DIR/packages.txt" || true

# Environment check (redacted)
echo "NODE_ENV: ${NODE_ENV:-not set}" > "$BUNDLE_DIR/env.txt"
echo "Has PK: $([ -n "${NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY:-}" ] && echo yes || echo no)" >> "$BUNDLE_DIR/env.txt"
echo "Has SK: $([ -n "${CLERK_SECRET_KEY:-}" ] && echo yes || echo no)" >> "$BUNDLE_DIR/env.txt"
echo "PK prefix: ${NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY:0:8}..." >> "$BUNDLE_DIR/env.txt"

# Middleware check
[ -f middleware.ts ] && cp middleware.ts "$BUNDLE_DIR/" || echo "No middleware.ts found" > "$BUNDLE_DIR/middleware-missing.txt"

# Health check
curl -s http://localhost:3000/api/clerk-health > "$BUNDLE_DIR/health.json" 2>/dev/null || echo '{"error":"app not running"}' > "$BUNDLE_DIR/health.json"

# Bundle it
tar czf "${BUNDLE_DIR}.tar.gz" "$BUNDLE_DIR"
rm -rf "$BUNDLE_DIR"
echo "Support bundle: ${BUNDLE_DIR}.tar.gz"

Output

  • Environment debug script showing SDK versions and API connectivity
  • /api/clerk-health endpoint for runtime health checks
  • Client-side debug panel (dev-only) showing auth state and JWT contents
  • Request logging middleware with Clerk cookie inspection
  • Support bundle script for filing Clerk support tickets

Error Handling

IssueDebug Action
Auth not workingHit /api/clerk-health, check backendApi status
Token issuesUse debug panel "Inspect JWT" to view claims and expiry
Middleware not runningEnable CLERK_DEBUG=true, check console for request logs
Session not persistingCheck debug panel for __clerk cookies, verify domain

Examples

Quick One-Liner Debug Check
bash
# Verify Clerk API connectivity from CLI
curl -s -H "Authorization: Bearer $CLERK_SECRET_KEY" \
  https://api.clerk.com/v1/users?limit=1 | jq '.total_count'

Resources

Next Steps

Proceed to clerk-rate-limits for understanding Clerk rate limits.

© jeremylongshore, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file (references) in skills/.curated/clerk-debug-bundle of jeremylongshore/tons-of-skills-marketplace.

  • SKILL.md
  • references/implementation-guide.md

Open the folder on GitHubat commit cfae287

Compare with similar skills

Clerk Debug Bundle next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Clerk Debug Bundle compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Clerk Debug Bundle this skilljeremylongshore/tons-of-skills-marketplace2.8k—~2kAutomated safety check: PassMIT
Siftranknoperator/siftrank225—~2.9kAutomated safety check: PassMIT
Supporthaacked/dotfiles134—~2.9kAutomated safety check: PassNone
Customer Support Agentmastra-ai/mastra29k—~2.2kAutomated safety check: PassCustom licence
Ticket TriageBevel-Software/Hexis1001 repos~2.9kAutomated safety check: PassApache-2.0
Add Agent Adaptersafedep/gryph172—~679Automated safety check: PassApache-2.0

Similar skills

  • Siftrank

    noperator/siftrank

    Find needles in haystacks with SiftRank. An agent skill from noperator/siftrank.

    225 GitHub stars~2.9k tokensUpdated 21 days ago
    Sales & SupportAuto-check passed
  • Support

    haacked/dotfiles

    Support hero workflow — start a ticket investigation with auto-organized notes, find existing notes, or generate the weekly highlights log.

    134 GitHub stars~2.9k tokensUpdated yesterday
    Sales & SupportAuto-check passed
  • Customer Support Agent

    mastra-ai/mastra

    Authoring playbook for building agents that triage and reply to customer messages — support tickets, email inquiries, chat questions, refund requests, or product issues.

    29k GitHub stars~2.2k tokensUpdated today
    Sales & SupportAuto-check passed
  • Ticket Triage

    Bevel-Software/Hexis

    Triage and prioritize a support ticket or customer issue. An agent skill from Bevel-Software/Hexis.

    100 GitHub starsUsed in 1 repo~2.9k tokens
    Sales & SupportAuto-check passed
  • Add Agent Adapter

    safedep/gryph

    A skill your agent uses when adding support for a new AI coding agent to Gryph, or when changing how an existing agent adapter is wired.

    172 GitHub stars~679 tokensUpdated 6 days ago
    Sales & SupportAuto-check passed
  • Agent Support Matrix

    jazzyalex/agent-sessions

    Maintain Agent Sessions agent support matrix and JSON/JSONL parsing compatibility.

    895 GitHub stars~587 tokensUpdated 2 days ago
    Sales & SupportAuto-check passed

More from jeremylongshore/tons-of-skills-marketplace

All 3,342 skills in this repo
  • Performing Security Code Review

    jeremylongshore/tons-of-skills-marketplace

    Execute this skill enables AI assistant to conduct a security-focused code review using the security-agent plugin.

    2.8k GitHub starsUsed in 2 repos~1.3k tokens
    Auto-check: notes
  • Adapting Transfer Learning Models

    jeremylongshore/tons-of-skills-marketplace

    Build this skill automates the adaptation of pre-trained machine learning models using transfer learning techniques.

    2.8k GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Agent Context Loader

    jeremylongshore/tons-of-skills-marketplace

    Execute proactive auto-loading: automatically detects and loads agents.md files.

    2.8k GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Aggregating Performance Metrics

    jeremylongshore/tons-of-skills-marketplace

    Aggregate and centralize performance metrics from applications, systems, databases, caches, and services.

    2.8k GitHub stars~1.2k tokensUpdated today
    Auto-check passed
  • Analyzing Capacity Planning

    jeremylongshore/tons-of-skills-marketplace

    Execute this skill enables AI assistant to analyze capacity requirements and plan for future growth.

    2.8k GitHub stars~947 tokensUpdated today
    Auto-check passed
  • Analyzing Database Indexes

    jeremylongshore/tons-of-skills-marketplace

    Process use when you need to work with database indexing. An agent skill from jeremylongshore/tons-of-skills-marketplace.

    2.8k GitHub stars~2k tokensUpdated today
    Auto-check passed

Categories

Questions about Clerk Debug Bundle

What does Clerk Debug Bundle do?

Collect comprehensive debug information for Clerk issues. An agent skill from jeremylongshore/tons-of-skills-marketplace. Clerk Debug Bundle is an agent skill from jeremylongshore/tons-of-skills-marketplace. Collect comprehensive debug information for Clerk issues.

When should I use Clerk Debug Bundle?

Clerk Debug Bundle fits situations like: troubleshooting complex problems; preparing support tickets; diagnosing intermittent issues; with phrases like clerk debug.

How do I install Clerk Debug Bundle in Claude Code?

Run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill clerk-debug-bundle -a claude-code`. Or copy the skill folder (skills/.curated/clerk-debug-bundle in jeremylongshore/tons-of-skills-marketplace) into .claude/skills/clerk-debug-bundle in your project. Claude Code loads it when a task matches its description.

How do I install Clerk Debug Bundle in Codex?

Run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill clerk-debug-bundle -a codex`. Or copy the skill folder (skills/.curated/clerk-debug-bundle in jeremylongshore/tons-of-skills-marketplace) into .agents/skills/clerk-debug-bundle in your project. Codex loads it when a task matches its description.

Can I use Clerk Debug Bundle in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill clerk-debug-bundle -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/clerk-debug-bundle, .gemini/skills/clerk-debug-bundle, .github/skills/clerk-debug-bundle and .opencode/skills/clerk-debug-bundle in your project.

What does Clerk Debug Bundle need to run?

Going by SKILL.md and its folder, Clerk Debug Bundle needs the command-line tools its instructions call (npm, curl, npx, jq and node) and credentials named CLERK_SECRET_KEY and NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY. Our summary lists: Node.js; A credential in NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY; A credential in CLERK_SECRET_KEY. Its frontmatter pre-approves these tools: Read, Write, Edit, Bash(npm:*), Bash(node:*), Grep. Compatibility (from SKILL.md): Designed for Claude Code.

Does Clerk Debug Bundle access the network?

SKILL.md names 3 domains. In commands or code: api.clerk.com; the agent is likely to contact it when it follows the instructions. As links in the text: clerk.com and github.com. This is read from the text; nothing was executed.

Is Clerk Debug Bundle safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Clerk Debug Bundle use?

Clerk Debug Bundle is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Clerk Debug Bundle use?

About 2k tokens (SKILL.md is roughly 8.2k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 1.6k tokens, read only when the agent opens those files.

What are the alternatives to Clerk Debug Bundle?

Skills that share tags, products or a category with Clerk Debug Bundle: Siftrank (noperator/siftrank, 225 stars), Support (haacked/dotfiles, 134 stars), Customer Support Agent (mastra-ai/mastra, 29k stars) and Ticket Triage (Bevel-Software/Hexis, 100 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Clerk Debug Bundle?

jeremylongshore (a GitHub user) maintains it in jeremylongshore/tons-of-skills-marketplace, which has 2,827 GitHub stars. The repository holds 3,342 skills in this directory. The repository was last updated on October 10, 2026.

Source: jeremylongshore/tons-of-skills-marketplace on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.