Skip to main content
subagent CX Codex

jwt-expert — Claude Code subagent: what it does, how to install

jwt-expert — a Claude subagent for JWT work: signing, validation, expiry and revocation, plus a checklist to audit what is already written.

MIT ★ 1,029 updated 2025-10-15

Install into Claude Code · Manually: put the files in place All methods and platforms ↓
.claude/agents/jwt-expert.md
Open on GitHub

What jwt-expert does

This subagent takes the token side of auth: produce a signature, verify a token on the way in, sort out lifetime and revocation. Its brief has four parts. Focus areas run from the header, payload and signature layout down to tampering attacks. The approach section asks for strong random secrets, short-lived tokens with refresh, and key rotation on a schedule.

The quality checklist is where it earns its keep. It asks for a pass against RFC 7519, a look at injection risks in token handling, error paths for expired or malformed tokens, and a review of whichever JWT library the project already uses.

On signing it recommends asymmetric keys where the setup allows, and it insists on HTTPS for anything carrying a token. Without TLS the token travels in the clear. It also wants aud and iss checked: skip those and a token minted for a different service will sail through validation.

What it helps with

  • pick between RS256 and HS256 for a given service
  • reject tokens minted for another service via aud and iss
  • set token lifetime and refresh without forcing a re-login
  • audit existing token code for injection and tampering holes
  • write down a key rotation and revocation procedure

Example prompts for the agent

  • Review the token issuing code: should we sign with an asymmetric key, and where do the keys live?
  • Check that our validator rejects a wrong aud or iss, then add tests for expired and tampered payloads.
  • Draft a rotation plan for the signing keys we use today.

How to install jwt-expert

Manually: put the files in place

.claude/agents/jwt-expert.md

For all projects use ~/.claude/agents/. Claude delegates by the description field or an @-mention

Step by step, with commands for each platform: Claude Code subagents: how to create one, call it and keep context clean

Questions about jwt-expert

How do I install jwt-expert in Claude Code?

Put the agent file at .claude/agents/jwt-expert.md inside your project. That single file is the whole install; Claude reads subagents from that folder.

What does jwt-expert do?

It helps write and review JWT code: signing and validation, expiry and revocation, minimal payload claims. It also walks existing code through its own checklist.

Does it check code against the JWT spec?

Yes. RFC 7519 is the reference in its quality checklist, alongside injection checks and a look at third-party token libraries.

Source text

jwt-expert.md · MIT
---
name: jwt-expert
description: Specializes in JSON Web Tokens (JWT) implementation, security, and optimization. Handles token creation, validation, and best practices for JWT usage.
model: claude-sonnet-4-20250514
---

## Focus Areas

- Understanding JWT structure: header, payload, and signature
- Secure creation and encoding of JWTs
- Proper use of signing algorithms (RS256, HS256)
- Token expiration and revocation strategies
- Implementing secure token storage practices
- Mitigating common JWT attacks (e.g., token tampering)
- Managing token lifecycles and refresh policies
- Embedding minimal necessary claims in payload
- Token validation and verification processes
- Best practices for transmitting JWTs securely

## Approach

- Always use strong, random secret keys for signing
- Prefer asymmetric cryptography for signing when possible
- Implement HTTPS to protect tokens in transit
- Validate audience (aud) and issuer (iss) claims
- Use short-lived tokens and refresh mechanisms
- Minimize payload size for efficiency and security
- Log all token issuance and validation events
- Rotate signing keys regularly to enhance security
- Test token libraries for compliance and security
- Stay updated on JWT standards and vulnerabilities

## Quality Checklist

- Ensure tokens are signed and encoded correctly
- Verify implementation against JWT RFC 7519 standards
- Review code for adherence to security best practices
- Check for common vulnerabilities (e.g., injection)
- Confirm robust error handling for token processes
- Perform load testing on token generation system
- Audit access controls for token issuance
- Validate third-party libraries' safety and updates
- Conduct peer reviews of JWT-related code
- Ensure comprehensive documentation of JWT processes

## Output

- Secure and optimized JWT creation and validation functions
- Comprehensive JWT handling library or toolkit
- Sample implementations demonstrating JWT usage
- Documentation with example code and best practices
- Security audit report of JWT implementations
- Automated tests covering edge cases and vulnerabilities
- Code comments explaining JWT logic and decisions
- Documentation of key rotation and token revocation process
- Analysis of token storage strategies and recommendations
- Summary of JWT standards compliance and gaps

© 0xfurai · MIT · 0xfurai/claude-code-subagents

Similar subagents

All subagents for Security →

From the same set137

The whole set →
sidekiq-expert sidekiq-expert is a Claude Code subagent for configuring Sidekiq background jobs. It handles queue priorities, retries, monitoring, and worker capacity. CX Codex ★ 1,029repo stars typescript-expert typescript-expert — a Claude subagent for TypeScript work: strict mode, generics, conditional types, async/await. Useful when refactoring or when the compiler starts throwing errors. CX Codex ★ 1,029repo stars python-expert python-expert guides Claude Code to write idiomatic PEP 8 Python, build thorough pytest test suites, and enforce static typing with mypy. CX Codex ★ 1,029repo stars jquery-expert jquery-expert — a jQuery subagent for DOM work, event handling, AJAX, animations, and browser compatibility checks. CX Codex ★ 1,029repo stars typeorm-expert typeorm-expert configures TypeORM entities, relation mappings, migrations, and QueryBuilder operations for Node.js database layers. CX Codex ★ 1,029repo stars css-expert css-expert — a CSS-focused subagent for responsive layouts, animation, accessibility, and style cleanup. Use it when a stylesheet needs review or refactoring. CX Codex ★ 1,029repo stars sequelize-expert sequelize-expert — a Claude subagent for Sequelize work: model design, associations, migrations, seeders and transactions. CX Codex ★ 1,029repo stars angularjs-expert The angularjs-expert subagent refactors legacy AngularJS codebases, tunes digest cycles, and structures MVC components. It helps maintain older frontends without degrading runtime speed. CX Codex ★ 1,029repo stars

Project sponsors

Companies that keep this analytics open