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/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.
With the globally installed skill, these commands work from any directory:
node "$HOME/.agents/skills/session-viewer/scripts/session-viewer.ts" <session.jsonl> --out /tmp/session.html --open
Useful modes:
node "$HOME/.agents/skills/session-viewer/scripts/session-viewer.ts" <session.jsonl> --out session.html
node "$HOME/.agents/skills/session-viewer/scripts/session-viewer.ts" <session.jsonl> --raw --out session.html
node "$HOME/.agents/skills/session-viewer/scripts/session-viewer.ts" --blank --out viewer.html --open
For another installation location, resolve scripts/session-viewer.ts relative
to this SKILL.md. The Persops source is modules/ai/skills/session-viewer.
Defaults:
- detects
codex,claude, orpi-openclaw - embeds normalized session data into one HTML file
- keeps tool input/output text in the DOM so browser search can find it
--rawembeds the original JSONL and lets the browser parse it--blankcreates a reusable file-picker viewer
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 JSONLscripts/importers/claude.ts: Claude Code JSONLscripts/importers/pi-openclaw.ts: Pi/OpenClaw session JSONL
Validate from the Persops repository root:
node --test modules/ai/skills/session-viewer/scripts/session-viewer.test.ts
make check