Your agent ran 47 tools.
What actually happened?

Replay any Claude Code or Cursor session. Step through diffs, tool calls, and token costs. Runs locally.

$ npm i -g agent-replay
works with Claude Code Cursor
localhost:3000/sessions/a8f3c1
Opus 4.6 12m 34s Tools 47 Input 98.2K Output 44.1K Cost $2.84
User
Fix the auth middleware to handle expired tokens
Thinking
I need to understand the current auth flow...
Read
src/middleware/auth.ts
Grep
/tokenExpir/
Read
src/lib/jwt.ts
Edit
src/middleware/auth.ts
Bash
npm run test:auth
Claude
The auth middleware now handles expired...
Edit
src/middleware/auth.ts
@@ -23,8 +23,14 @@
export async function authMiddleware(req: Request) {
const token = req.headers.get('authorization')?.split(' ')[1];
- if (!token) return unauthorized();
- const payload = jwt.verify(token);
+ if (!token) return unauthorized('Missing token');
+
+ const payload = jwt.verify(token, {
+ clockTolerance: 30,
+ ignoreExpiration: false,
+ });
+
+ if (payload.exp && Date.now() >= payload.exp * 1000) {
+ return unauthorized('Token expired');
+ }
req.user = payload;
return next();

A session, replayed

Timeline playback
Step through every event. Scrub at 1x–8x.
step Space play 1x 2x 4x 8x
Local only
Your data stays yours.
localhost:3000
reads ~/.claude/
cloud
account
telemetry
Diffs, not JSON
Syntax highlighted. In context.
const token = getToken();
- if (!token) return;
+ if (!token) {
+ throw new AuthError();
+ }
Search & filter
Find anything. Jump to errors.
Token costs
Per-model pricing. Know what each session costs.
Opus
$2.84
Sonnet
$0.62
Haiku
$0.08
Export
Share sessions. One click.
.md
Markdown
.json
JSON

Get started

1 $ npm i -g agent-replay one-time setup
2 $ agent-replay starts a local server
3 your browser opens with all your sessions
Supports Claude Code Cursor Windsurf (soon)