Analyze OpenClaw session .jsonl files in the browser with detailed token, cost, latency, and model/provider breakdowns.
- Parses one or more OpenClaw session JSONL files client-side.
- Normalizes each record into timeline events.
- Computes:
- message counts
- input/output/total tokens
- estimated cost (from configurable model pricing)
- duration and inter-message latency distribution
- role/model/provider usage
- Visualizes everything in an interactive dashboard:
- Overview charts
- Timeline table with filtering/sorting/expanded raw JSON
- Highlights panel
- Exports:
- summary JSON
- message-level CSV
- Next.js 16 (App Router)
- React 19
- TypeScript
- Tailwind CSS + shadcn/ui + Radix UI
- Recharts
- Node.js 22+ (verified with
v22.21.1) pnpm(or Corepack, which ships with Node 22)
If pnpm is not installed globally, use corepack pnpm ... commands below.
corepack pnpm installcorepack pnpm devOpen http://localhost:3000.
corepack pnpm buildcorepack pnpm startIf 3000 is already used, set PORT:
$env:PORT=3200
corepack pnpm startValidated in this workspace on February 10, 2026:
corepack pnpm installsucceeded.corepack pnpm buildsucceeded.corepack pnpm dev --port 3100served HTTP 200 and returned page content containingOpenClaw.- Production start also served HTTP 200 when run with
PORT=3200.
- Upload one or more
.jsonlfiles from the landing page. - Wait for parsing progress to complete.
- In dashboard:
- switch between combined and per-file views
- adjust detected model pricing in the
Model Pricingpanel - explore
Overview,Timeline, andHighlights - export summary JSON or message CSV
Parser behavior is implemented in lib/parse-session-file.ts.
- Input is newline-delimited JSON (
.jsonl). - Empty lines are skipped.
- Malformed JSON lines are ignored and added to warnings.
- Supported record patterns:
type: "session"type: "message"with nestedmessagepayloadtype: "custom"
For message records, the app extracts:
role,model,provider- token usage:
input,output,cacheRead,cacheCreation,totalTokens - raw cost (reference only, not used as final displayed estimate)
- text blocks from
message.contentwheretype === "text"
Cost computation is implemented in lib/compute-stats.ts.
- Displayed estimated cost is recomputed from configured pricing map.
- Pricing units are dollars per 1M tokens.
- Estimated cost currently includes:
- input tokens
- output tokens
- cache-read tokens
- Default model pricing is seeded from
lib/default-pricing.tsand can be edited in the UI (components/model-pricing-config.tsx).
app/
layout.tsx # Root layout, theme provider
page.tsx # Landing page + upload flow
globals.css # Global theme + custom styles
components/
dashboard.tsx # Main analytics dashboard
upload-dropzone.tsx # File upload UI
parse-progress.tsx # Parsing progress display
summary-cards.tsx # KPI cards
charts.tsx # Recharts visualizations
timeline-table.tsx # Search/sort/filter timeline table
highlights.tsx # Derived highlights
model-pricing-config.tsx # Per-model price editor
export-buttons.tsx # JSON/CSV downloads
warnings-panel.tsx # Parse warnings
ui/* # shadcn/radix primitives
hooks/
use-analysis.ts # External-store hook
lib/
analysis-store.ts # Module-level shared app state
parse-session-file.ts # JSONL parsing + normalization
compute-stats.ts # Metrics/cost/latency aggregation
default-pricing.ts # Known model pricing defaults
types.ts # Shared types
corepack pnpm lintcurrently fails because the script usesnext lintwith Next 16 in this repo setup.- TypeScript build errors are currently ignored by config (
next.config.mjssetstypescript.ignoreBuildErrors = true). - All processing is client-side in browser memory; very large files may impact responsiveness.
# Install
corepack pnpm install
# Dev server
corepack pnpm dev
# Build
corepack pnpm build
# Start production
corepack pnpm start