Skip to content

kangjinghang/agent-chatlens

Repository files navigation

Agent ChatLens

A beautiful web viewer for AI agent session files
Inspect, analyze, and debug your Claude Code & OpenClaw conversation sessions with ease.
Drop a .jsonl session file and explore β€” zero setup required.

Try it live β€” no install needed Β· Run locally Β· δΈ­ζ–‡

License: MIT TypeScript React 18 PRs Welcome

Drop Zone Chat View

Timeline View


Why Agent ChatLens?

Working with AI coding agents like Claude Code produces rich conversation logs, but reviewing them in the terminal is painful. Agent ChatLens gives you a beautiful chat-style interface to browse, search, and analyze your sessions β€” with zero setup.

Just drag & drop a .jsonl file and start exploring.

✨ Features

Chat-Style Interface

  • πŸ’¬ Turn-based layout β€” Messages grouped into user/assistant turns, just like a chat app
  • 🧠 Thinking blocks β€” Collapsible reasoning/thinking display with signature info
  • πŸ“‹ Code copy β€” One-click copy buttons on code blocks
  • ⏱️ Timestamps & durations β€” Tool execution time badges, total turn duration

Tool Visualization

  • πŸ› οΈ Tool-specific rendering β€” Smart display for Bash, Edit, Write, Read, Grep, Glob, and more
  • πŸ“Š Inline diff view β€” Visualize code changes in Edit tool calls
  • πŸ“ˆ Timeline view β€” Gantt chart showing tool call execution timeline with duration bars
  • πŸ”½ Collapse/expand tools β€” Toggle all tool calls collapsed, with per-item override

Performance

  • ⚑ Virtual scrolling β€” Handles large sessions (4000+ messages) without lag
  • πŸ“Š Session statistics β€” Turns, tool calls, total tokens, session duration at a glance
  • πŸŒ™ Dark / light theme toggle

Zero Config

  • πŸ“ Drag & drop JSONL files for instant viewing
  • πŸ” Auto-detects OpenClaw and Claude Code formats
  • πŸ’» Pure frontend β€” No backend, no install, no signup. Just open and use.

πŸš€ Quick Start

Online (fastest)

Go to kangjinghang.github.io/agent-chatlens and drop a .jsonl file. That's it.

Local development

git clone https://github.com/kangjinghang/agent-chatlens.git
cd agent-chatlens
bun install
bun run dev

Then open http://localhost:3000 and drop a .jsonl file.

πŸ“ Supported Formats

OpenClaw Sessions

Files from ~/.openclaw/agents/*/sessions/*.jsonl

{"type":"session","version":3,"id":"abc-123",...}
{"type":"message","id":"m1","message":{"role":"user","content":[{"type":"text","text":"Hello"}]}}
{"type":"message","id":"m2","message":{"role":"assistant","content":[{"type":"thinking","thinking":"..."},{"type":"text","text":"Hi!"},{"type":"toolCall","id":"c1","name":"read","arguments":{...}}]}}
{"type":"message","id":"m3","message":{"role":"toolResult","toolCallId":"c1","toolName":"read","content":[...]}}

Claude Code Sessions

Files from ~/.claude/projects/*/*.jsonl

{"type":"user","uuid":"u1","message":{"role":"user","content":"Hello"}}
{"type":"assistant","uuid":"a1","message":{"role":"assistant","content":[{"type":"text","text":"Hi!"}]}}
{"type":"assistant","uuid":"a2","message":{"role":"assistant","content":[{"type":"tool_use","id":"t1","name":"Bash","input":{"command":"ls"}}]}}
{"type":"user","uuid":"u2","message":{"role":"user","content":[{"type":"tool_result","tool_use_id":"t1","content":"file.txt"}]}}

πŸ› οΈ Tech Stack

Technology Purpose
React 18 + TypeScript UI framework
Vite Fast builds & dev server
Tailwind CSS Styling
@tanstack/react-virtual Virtual scrolling for large sessions
react-markdown + remark-gfm Markdown rendering
react-syntax-highlighter Code highlighting
lucide-react Icons

πŸ“¦ Build

bun run build        # Production build
bun run preview      # Preview production build

πŸ§ͺ Testing

bun test            # Run tests once
bun run test:watch  # Watch mode

🀝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ“„ License

MIT Β© kangjinghang

πŸ”— Keywords

AI agent, session viewer, JSONL viewer, OpenClaw, Claude Code, agent debugging, conversation analysis, tool call visualization, virtual scrolling, React, TypeScript

About

πŸ” A beautiful web viewer for AI agent session files. Browse Claude Code & OpenClaw conversations with chat-style UI, timeline visualization, and zero setup.

Topics

Resources

License

Stars

Watchers

Forks

Contributors

Languages