---
title: "session-recorder"
description: "Claude Code plugin for persona-based user testing. Simulates Boomers, Millennials, Gen Z, and Gen Alpha users to find UX issues before real users do."
canonical_url: "https://skilld.dev/gh/ncklrs/claude-chrome-user-testing/session-recorder"
last_updated: "2026-09-30T03:19:26.000Z"
---

> Index of every page on this site: [llms.txt](https://skilld.dev/llms.txt)

> **Skill from skilld.dev.** Follow the user's requested action.
> If the user asked to fork this Skill, follow the fork workflow below. Do not execute the Skill instructions while copying it.
> Otherwise, follow the instructions below for this session. You do not need to install anything.
>
> If the user asked to install this Skill, run `npx skilld install ncklrs/claude-chrome-user-testing/session-recorder`. Install writes the Skill files into the project, so every session loads them.
>
> ## Fork workflow
>
> A fork creates an editable local Skill with its original author and licence. The request authorizes copying and local installation.
> 1. Check `./skills/session-recorder`, the project lockfile, and selected Agent targets together. If the local directory or installed Skill exists, stop. Never overwrite an existing directory or Agent target.
> 2. Read [source metadata](https://skilld.dev/api/v1/skills/ncklrs/claude-chrome-user-testing/session-recorder) once. Use sourceUrl, sourceCommit, skillPath, sourceGone, and license. If the source is gone or its path is missing, stop. If license is null, read licence files at the source commit.
> 3. Fetch only the source commit into a temporary Git repository. Do not clone full history. Derive repository_url from sourceUrl, including repository renames. If sourceCommit is absent, resolve the sourceUrl ref once. Set source_commit to that actual commit. Run these commands in one shell call:
>
> ```sh
> git init --quiet "$temporary_dir"
> git -C "$temporary_dir" fetch --quiet --depth=1 "$repository_url" "$source_commit"
> git -C "$temporary_dir" checkout --quiet --detach FETCH_HEAD
> ```
>
> Read applicable licence declarations and notices at that commit. If copying is not permitted, report the restriction and stop.
> 4. Inspect source entries together, then copy the directory containing skillPath into `./skills/session-recorder`. Use the user's path if selected. Keep the original SKILL.md, relative links, scripts, binary assets, and executable modes. Exclude .git metadata. Reject symlinks and paths outside the Skill directory. After checking entries, use cp -a where available. A regular source directory needs no custom copy script. Do not save this page wrapper as SKILL.md.
> Preserve author credit, notices, and applicable licence files from repository or parent directories. Add PROVENANCE.md with the Skill page, source URL, actual commit, original path, and licence. Retain any existing PROVENANCE.md and record new provenance separately. Batch source inspection, copying, and provenance work where practical.
> 5. In the project root, run `skilld install ./skills/session-recorder --mode copy --plain`. If skilld is unavailable, use `npx skilld install ./skills/session-recorder --mode copy --plain`. This known command needs no help lookup. Install does not support --json. Use detected Agent targets, or add --agent for the targets the user selected. Install the local path, never the upstream selector. If installation fails, preserve the local copy and report the exact failure.
> 6. Confirm the local lockfile source and installed Agent copies once. Report the local path, actual commit, and Agent targets. After edits, reinstall the same local path. Upstream updates must not replace it. Do not publish or push unless the user asks.

# Session Recorder Skill

Record user testing sessions as Playwright Traces for replay and analysis. Traces capture the full testing session including screenshots, DOM snapshots, network requests, and console logs.

## When to Use

- `--record` flag is present in the command
- User wants to replay or share a testing session
- Need to debug issues found during testing
- Creating documentation of UX issues

## Trace File Format

Playwright Trace files (`.zip`) contain:
- **Screenshots**: Captured at each action
- **DOM Snapshots**: Full page state at each step
- **Network Requests**: All HTTP requests/responses
- **Console Logs**: JavaScript console output
- **Action Timeline**: Timestamped sequence of all interactions

## Implementation

### Starting a Recording

At the beginning of a test session when `--record` flag is present:

```javascript
// Via browser_run_code
async (page) => {
  // Ensure recordings directory exists
  const fs = require('fs');
  const path = require('path');
  const recordingsDir = process.env.RECORD_PATH || 'recordings';
  if (!fs.existsSync(recordingsDir)) {
    fs.mkdirSync(recordingsDir, { recursive: true });
  }

  // Start tracing
  await page.context().tracing.start({
    screenshots: true,
    snapshots: true,
    sources: false  // Don't include source code
  });

  return 'Recording started';
}
```

### Stopping a Recording

At the end of a test session:

```javascript
// Via browser_run_code
async (page) => {
  const tracePath = process.env.TRACE_PATH;
  await page.context().tracing.stop({ path: tracePath });
  return `Trace saved to: ${tracePath}`;
}
```

## Trace Filename Convention

Format: `{command}-{persona}-{YYYY-MM-DD-HHmmss}.zip`

Examples:
- `user-test-genz-digital-native-2025-01-06-143022.zip`
- `stripe-test-impulse-buyer-2025-01-06-143156.zip`
- `user-test-boomer-tech-averse-2025-01-06-150830.zip`

### Generating Filename

```javascript
const generateTracePath = (command, personaId, basePath = 'recordings') => {
  const now = new Date();
  const timestamp = now.toISOString()
    .replace(/[-:]/g, '')
    .replace('T', '-')
    .slice(0, 15);
  return `${basePath}/${command}-${personaId}-${timestamp}.zip`;
};
```

## Recording Flow

### 1. Pre-Test Setup

When `--record` flag is detected:

```
1. Parse --record-path or use default 'recordings/'
2. Generate trace filename
3. Ensure output directory exists
4. Start Playwright tracing
5. Announce: "Starting session recording..."
```

### 2. During Test

- All browser interactions are automatically captured
- Screenshots taken at each action
- Network requests logged
- No additional steps needed

### 3. Post-Test Cleanup

```
1. Stop tracing with output path
2. Verify file was created
3. Report: "Session recorded to: {path}"
4. Report: "View at: https://trace.playwright.dev"
```

## Viewing Traces

Traces can be viewed at: https://trace.playwright.dev

### Instructions for Users

1. Open [trace.playwright.dev](https://trace.playwright.dev) in browser
2. Drag and drop the `.zip` trace file
3. Explore the timeline:
   - Click actions to see screenshots
   - View network requests tab
   - Check console output
   - See DOM snapshots at each step

### Trace Viewer Features

| Tab | Description |
|-----|-------------|
| Actions | Timeline of all interactions |
| Network | HTTP requests and responses |
| Console | JavaScript console output |
| Source | (Optional) Source code context |

## Integration with Test Modes

### Standard Mode

```
Starting session recording...

"Hi, I'm Harold. Let me see what this website is about..."
[Full narration continues]

Session recorded to: recordings/user-test-boomer-tech-averse-2025-01-06-143022.zip
View trace at: https://trace.playwright.dev (drag and drop the file)
```

### Quiet Mode (`--quiet --record`)

```
Testing https://example.com as boomer-tech-averse...
Recording session...

[Screenshot: confusion-nav.png]
[Screenshot: task-complete.png]

# Summary
- Tasks: 2/3 completed
- Issues: 1 critical, 2 major

Session recorded to: recordings/user-test-boomer-tech-averse-2025-01-06-143022.zip
View trace at: https://trace.playwright.dev
```

### Multi-Persona Mode (`--personas --record`)

Each persona test gets its own trace file:

```
recordings/
├── user-test-boomer-tech-averse-2025-01-06-143022.zip
├── user-test-genz-digital-native-2025-01-06-143024.zip
└── user-test-millennial-tech-skeptic-2025-01-06-143026.zip
```

## Error Handling

### Tracing Not Supported

If browser doesn't support tracing:
```
Warning: Session recording not available. Continuing without recording.
```

### Directory Creation Failed

If recordings directory can't be created:
```
Error: Could not create recordings directory. Check permissions.
```

### Trace Save Failed

If trace file can't be saved:
```
Warning: Failed to save trace file. Test results are still available.
```

## Best Practices

1. **Use with CI/CD**: Combine `--record` with `--quiet` for automated testing
2. **Share Traces**: Trace files are self-contained, easily shareable
3. **Storage**: Traces can be large (10-50MB); manage storage accordingly
4. **Privacy**: Traces may contain sensitive data; handle appropriately
