view-team-session

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

View Team Session

查看团队会话

Generate a self-contained HTML viewer from Claude Code session JSONL logs. Works for both solo sessions and agent team sessions, showing the full conversation timeline with filtering, search, and collapsible tool calls.
从Claude Code会话JSONL日志生成独立HTML查看器。适用于单人会话和Agent团队会话,可展示完整对话时间线,支持筛选、搜索和可折叠工具调用功能。

How It Works

工作原理

Claude Code stores conversation logs as JSONL files at
~/.claude/projects/<project>/<session-id>.jsonl
. When agent teams are used, each agent gets its own JSONL file in the same project directory, linked by a shared
teamName
field.
Browsers can't read local JSONL files directly, so the skill uses a Python script to extract the data and embed it into a self-contained HTML playground.
Claude Code将对话日志以JSONL文件格式存储在
~/.claude/projects/<project>/<session-id>.jsonl
。使用Agent团队时,每个Agent都会在同一项目目录下生成独立的JSONL文件,通过共享的
teamName
字段关联。
浏览器无法直接读取本地JSONL文件,因此该skill使用Python脚本提取数据,并将其嵌入到独立的HTML playground中。

Usage

使用方法

Run the generate script with a session ID using
uv run
:
bash
uv run {SKILL_DIR}/scripts/generate.py SESSION_ID [--output path] [--no-open]
  • SESSION_ID
    — the UUID from the JSONL filename (e.g.,
    605eef0e-40be-4e0f-8a34-0a977c60399d
    )
  • --output path
    — custom output path (default:
    .claude/output/<session-id>.html
    )
  • --no-open
    — skip auto-opening in browser
The script will:
  1. Scan
    ~/.claude/projects/*/
    to find the session's JSONL file
  2. If it's a team session, discover all teammate JSONL files via the shared
    teamName
    field
  3. Parse all files into structured events (speech, DMs, tool calls, thinking, etc.)
  4. Deduplicate inter-agent DMs (each DM exists in both sender and receiver logs — only the sender's copy is kept since it has richer metadata)
  5. Embed the data into the HTML template and write the output file
Replace
{SKILL_DIR}
with the actual path to this skill directory when constructing the command.
使用
uv run
执行生成脚本并传入会话ID:
bash
uv run {SKILL_DIR}/scripts/generate.py SESSION_ID [--output path] [--no-open]
  • SESSION_ID
    — JSONL文件名中的UUID(例如
    605eef0e-40be-4e0f-8a34-0a977c60399d
  • --output path
    — 自定义输出路径(默认值:
    .claude/output/<session-id>.html
  • --no-open
    — 跳过自动在浏览器中打开的步骤
脚本将执行以下操作:
  1. 扫描
    ~/.claude/projects/*/
    目录找到对应会话的JSONL文件
  2. 如果是团队会话,通过共享的
    teamName
    字段查找所有团队成员的JSONL文件
  3. 将所有文件解析为结构化事件(发言、私信、工具调用、思考过程等)
  4. 对Agent间的私信进行去重(每条私信在发送者和接收者的日志中均存在,仅保留发送者的副本,因为其包含更丰富的元数据)
  5. 将数据嵌入HTML模板并写入输出文件
构造命令时,请将
{SKILL_DIR}
替换为该skill目录的实际路径。

Finding Session IDs

查找会话ID

If the user doesn't provide a session ID, help them find one:
bash
undefined
如果用户未提供会话ID,可协助用户通过以下命令查找:
bash
undefined

List recent sessions for the current project

列出当前项目的最近10条会话

ls -lt ~/.claude/projects/<project>/*.jsonl | head -10
ls -lt ~/.claude/projects/<project>/*.jsonl | head -10

Search for sessions containing specific content

搜索包含特定内容的会话

grep -l "search term" ~/.claude/projects/<project>/*.jsonl

The session ID is the filename without the `.jsonl` extension.
grep -l "search term" ~/.claude/projects/<project>/*.jsonl

会话ID是去掉`.jsonl`后缀的文件名。

Output

输出

The generated HTML is a single self-contained file with:
  • Header showing team name, session ID, duration, event count
  • Sidebar with agent toggles, event type filters, and content search
  • Timeline of event cards with agent-colored borders
  • Default view shows speech and DMs only; tool calls, thinking, and system events are togglable
  • Dark theme (GitHub-dark style)
Output files go to
.claude/output/
by default.
生成的HTML是单个独立文件,包含以下功能:
  • 页眉:展示团队名称、会话ID、时长、事件总数
  • 侧边栏:提供Agent切换、事件类型筛选和内容搜索功能
  • 时间线:带Agent专属颜色边框的事件卡片
  • 默认视图:仅展示发言和私信内容;工具调用、思考过程和系统事件可手动切换显示
  • 深色主题(GitHub深色风格)
输出文件默认存储在
.claude/output/
目录下。