mcpField
O
openclaw-session-viewer

openclaw-session-viewer

github.com/theangrypitAgent workflows042 installsUpdated today
Repository

About openclaw-session-viewer

A skill for rendering Codex, Claude Code, OpenClaw, and Pi session transcripts as browser-viewable HTML. It supports normalized or raw exports, full-history reading, and a reusable file-picker viewer.

Key features

  1. 01Render supported session transcripts to HTML
  2. 02Normalized and raw export modes
  3. 03Reusable file-picker viewer
  4. 04Browser-searchable tool input and output
  5. 05Optional bounded file reads with omission warnings

Use cases

  1. 01Inspecting an agent session transcript in a browser
  2. 02Exporting a transcript to share
  3. 03Searching tool inputs and outputs in session history

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/theangrypit/theangryskills --skill openclaw-session-viewer

After installing, type/openclaw-session-viewerin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

LICENSE
MIRROR.md
package.json
tsconfig.json
agents/
openai.yaml
scripts/
html.ts
open-browser.ts
read-session.ts
session-viewer.test.ts
session-viewer.ts
styles.ts
scripts/core/
detect.ts
jsonl.ts
types.ts
scripts/importers/
claude.ts
codex.ts
pi-openclaw.ts

Details

From the project README

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:

.agents/skills/openclaw-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:

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

Useful modes:

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

In a downstream repo that syncs shared skills under .agents/skills, replace skills/openclaw-session-viewer with .agents/skills/openclaw-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.

This opt-in read limit applies only to CLI file exports. The browser's file picker continues to load complete files.

Where Sessions Live

Codex:

find "${CODEX_HOME:-$HOME/.codex}/sessions" -name 'rollout-*.jsonl' -type f | sort
ls -t "${CODEX_HOME:-$HOME/.codex}"/sessions/*/*/*/rollout-*.jsonl | head

OpenClaw/Pi:

AGENT_ID="<agentId>"
SESSION_DIR="${OPENCLAW_STATE_DIR:-$HOME/.openclaw}/agents/$AGENT_ID/sessions"
ls -t "$SESSION_DIR"/*.jsonl | head
find "${OPENCLAW_STATE_DIR:-$HOME/.openclaw}/agents" -path '*/sessions/*.jsonl' -type f | sort

Use sessions.json in the same directory to map session keys to session ids.

Claude Code:

find "$HOME/.claude/projects" -name '*.jsonl' -type f | sort
ls -t "$HOME/.claude/projects"/**/*.jsonl | head

Some Claude installs also keep exported JSON/JSONL under project-specific cache folders; prefer the newest JSONL with the target repo path in its parent folder.

Development

Scripts are native Node TypeScript. Keep them erasable:

  • ok: types, interfaces, unions, satisfies
  • avoid: enums, namespaces, decorators, parameter properties
  • no tsconfig path aliases; use relative imports

Importer ownership:

  • scripts/importers/codex.ts: Codex rollout JSONL
  • scripts/importers/claude.ts: Claude Code JSONL
  • scripts/importers/pi-openclaw.ts: Pi/OpenClaw session JSONL

Validate:

npm ci --ignore-scripts
npm run typecheck
node --test skills/openclaw-session-viewer/scripts/session-viewer.test.ts
scripts/validate-skills

Comments

Markdown supported