# Session Viewer

Render Codex, Claude Code, OpenClaw, or Pi session JSONL transcripts as a searchable...

- Repository: https://github.com/openclaw/agent-skills (1113 stars)
- Category: AI and agents
- License: MIT
- Last updated: 2026-11-01
- Runs scripts: yes, review before use

## Install

Claude Code: `npx skills add openclaw/agent-skills --skill session-viewer -g -a claude-code -y`
Codex: `npx skills add openclaw/agent-skills --skill session-viewer -g -a codex -y`
Cursor: `npx skills add openclaw/agent-skills --skill session-viewer -g -a cursor -y`
Gemini CLI: `npx skills add openclaw/agent-skills --skill session-viewer -g -a gemini-cli -y`

## Description

Render Codex, Claude Code, OpenClaw, or Pi session JSONL transcripts as a searchable, shareable single-file HTML viewer.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Session Viewer

Use when asked to view, export, inspect, or share a Codex, Claude Code, OpenClaw, or Pi session transcript in a browser.

## Commands

When the session path is not known and the `agent-transcript` skill is available, use it first to find the likely JSONL session:

```bash
.agents/skills/agent-transcript/scripts/agent-transcript find \
  --query "$USER_GOAL_OR_TITLE $BRANCH_OR_URL" \
  --cwd "$PWD" \
  --since-days 14
```

Pick the highest-confidence `file` result, then render it with `session-viewer`.

From a repo that has this skill:

```bash
node skills/session-viewer/scripts/session-viewer.ts <session.jsonl> --out /tmp/session.html --open
```

Useful modes:

```bash
node skills/session-viewer/scripts/session-viewer.ts <session.jsonl> --out session.html
node skills/session-viewer/scripts/session-viewer.ts <session.jsonl> --raw --out session.html
node skills/session-viewer/scripts/session-viewer.ts --blank --out viewer.html --open
```

In a downstream repo that syncs shared skills under `.agents/skills`, replace
`skills/session-viewer` with `.agents/skills/session-viewer`.

Defaults:

- detects `codex`, `claude`, or `pi-openclaw`
- embeds normalized session data into one HTML file
- keeps tool input/output text in the DOM so browser search can find it
- reads the complete session file, preserving full history in both export modes
- `--raw` embeds the original JSONL and lets the browser parse it
- `--blank` creates a reusable file-picker viewer

For an explicitly partial export, use `--max-read-bytes N` with a positive integer byte limit (for example, `--max-read-bytes 8388608` for 8 MiB). Oversized files retain the head and tail, with a visible omission warning in the CLI and exported viewer. Truncated boundary records may be omitted; `--raw` embeds only the retained JSONL. Files at or below the limit remain complete. Short reads are retried; an unexpected end of file fails the export instead of reporting a complete read.

The rest: https://github.com/openclaw/agent-skills/blob/HEAD/skills/session-viewer/SKILL.md
