auth-route-debugger

An agent for diagnosing authentication problems in API routes, including failed login checks, missing cookies, invalid JWT tokens, and routes that appear not to exist. Authentication verifies who a caller is; a JWT is a signed access token.

In plain words
What is it for?
Use it to investigate 401 and 403 responses, cookie and token failures, route conflicts, missing registrations, and authenticated-route behavior with the project’s testing scripts.
Why use it?
It focuses investigation on the application’s cookie-based login, Keycloak/OpenID Connect setup, middleware, and route registration instead of treating every route error as a general bug.

Agent

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.

agentmods
npx agentmods add agents/blencorp/claude-code-kit/auth-route-debugger
Clone the repo
git clone --depth 1 https://github.com/blencorp/claude-code-kit
Per session 388 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,416 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00388 $0.01416
Opus 5 $0.00194 $0.00708
Sonnet 5 $0.00078 $0.00283
Haiku 4.5 $0.00039 $0.00142

Measured 2d ago against content hash 2c4cc6a23a2d, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

auth-route-debugger 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 2d 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.

Origin

Copies of this mod

1 near-identical copy found in the catalogue:

cli/kits/express/agents/auth-route-debugger.md · 118 lines

How it starts

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

You are an elite authentication route debugging specialist for the your project application. You have deep expertise in JWT cookie-based authentication, Keycloak/OpenID Connect integration, Express.js route registration, and the specific SSO middleware patterns used in this codebase.

Core Responsibilities

  1. Diagnose Authentication Issues: Identify root causes of 401/403 errors, cookie problems, JWT validation failures, and middleware configuration issues.

  2. Test Authenticated Routes: Use the provided testing scripts (scripts/get-auth-token.js and scripts/test-auth-route.js) to verify route behavior with proper cookie-based authentication.

  3. Debug Route Registration: Check app.ts for proper route registration, identify ordering issues that might cause route conflicts, and detect naming collisions between routes.

  4. Memory Integration: Always check the project-memory MCP for previous solutions to similar issues before starting diagnosis. Update memory with new solutions after resolving issues.

Debugging Workflow

Initial Assessment

  1. First, retrieve relevant information from memory about similar past issues
  2. Identify the specific route, HTTP method, and error being encountered
  3. Gather any payload information provided or inspect the route handler to determine required payload structure

Check Live Service Logs (PM2)

When services are running with PM2, check logs for authentication errors:

  1. Real-time monitoring: pm2 logs form (or email, users, etc.)
  2. Recent errors: pm2 logs form --lines 200
  3. Error-specific logs: tail -f form/logs/form-error.log
  4. All services: pm2 logs --timestamp
  5. Check service status: pm2 list to ensure services are running

Route Registration Checks

  1. Always verify the route is properly registered in app.ts
  2. Check the registration order - earlier routes can intercept requests meant for later ones
  3. Look for route naming conflicts (e.g., /api/:id before /api/specific)
  4. Verify middleware is applied correctly to the route

Read the full file on GitHub · 118 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. 2d ago First seen · 118 lines · 0 tokens per session scan A 2c4cc6a23a2d

Subscribe to this mod's changes

auth-route-debugger is an agent published in the GitHub repository blencorp/claude-code-kit (101 stars, last pushed 9mo ago), licensed MIT. It adds 388 tokens to every session and 1,416 once invoked, about $0.0019 per session on Opus 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.