Index of every page on this site: llms.txt
All skills
vicnaum avatar

/ai-conversation-extractor

@cc33127
Run it yourself

Convert AI conversation transcripts (Claude Code, Codex CLI, ChatGPT JSONL; Cursor IDE SQLite) to readable Markdown. Use when the user wants to: (1) convert .jsonl conversation transcripts to .md, (2) strip binary/base64 data from AI conversation logs, (3) make AI conversation history human-readable, (4) process session exports from ~/.claude/ or ~/.codex/, (5) batch-convert a folder of conversation JSONL files, or (6) list, search, or export Cursor IDE chat/composer conversations. Triggers on mentions of JSONL conversations, transcript conversion, conversation export, readable conversation logs, or Cursor chat history.

Use this Skill: https://skilld.dev/gh/vicnaum/vics-agent-skills/ai-conversation-extractor

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

scriptsREADME.md

≈2.4k tokens on demand. Your agent reads this file only when SKILL.md points to it.

Claude Code JSONL Format Reference

Claude Code stores conversation transcripts as JSONL files — one JSON object per line. Each line is a record with a type field that determines its structure.

Sources: ccrider schema, claude-code-transcripts, deepwiki guide.


File Locations

~/.claude/
├── history.jsonl                              # Global command history
├── settings.json                              # Global settings (cleanupPeriodDays, etc.)
├── CLAUDE.md                                  # Global personal memory
└── projects/
    └── <encoded-project-path>/                # e.g. -Users-neil-xuku-invoice
        ├── <sessionId>.jsonl                  # Main session transcripts
        ├── agent-<shortId>.jsonl              # Subagent session transcripts
        ├── CLAUDE.md                          # Project-local memory
        └── memory/
            └── MEMORY.md                      # Persistent project memory
  • Session IDs are UUIDs (e.g., 859cd961-d542-49dc-926f-6cd2c9d55be4)
  • Project path encoding: /Users/neil/xuku/invoice → -Users-neil-xuku-invoice
  • Log retention: 30 days by default. Set "cleanupPeriodDays": 99999 in ~/.claude/settings.json to keep longer.

Record Types

1. summary — Session Title (First Line)

Always the first line of a session file. Contains the generated session title.

{
  "type": "summary",
  "summary": "Human-readable session title",
  "leafUuid": "uuid-of-final-message"
}
Field Description
summary Generated title describing the session
leafUuid UUID of the last message in the conversation (or null)

Note: Older session files may lack a summary line and start directly with file-history-snapshot or user records.

2. file-history-snapshot — Editor State Backup

Tracks which files were modified and their backup versions. Appears at session start and after file modifications.

{
  "type": "file-history-snapshot",
  "messageId": "<uuid>",
  "snapshot": {
    "messageId": "<uuid>",
    "trackedFileBackups": {
      "src/detect.py": {
        "backupFileName": "43435dffea7b8ba3@v5",
        "version": 5,
        "backupTime": "2026-02-09T23:51:07.948Z"
      }
    },
    "timestamp": "2026-02-09T23:51:07.948Z"
  },
  "isSnapshotUpdate": false
}

3. user — User Messages & Tool Results

User-typed messages and tool results returned to the assistant.

Common Envelope Fields

Present on all user and assistant records:

Field Type Description
type string "user" or "assistant"
uuid string This record's UUID
parentUuid string|null Parent message UUID (null for first)
timestamp string ISO 8601
sessionId string Session UUID (matches filename)
cwd string Working directory
version string Claude Code version (e.g., "2.1.37")
gitBranch string Current git branch
slug string Session slug (e.g., "lazy-finding-token")
isSidechain boolean Branched conversation
isMeta boolean Auto-injected message (e.g., /init instructions)
userType string Usually "external"
Plain text content
{
  "type": "user",
  "message": { "role": "user", "content": "Please read this file" }
}
Structured content blocks
{
  "type": "user",
  "message": {
    "role": "user",
    "content": [
      { "type": "text", "text": "Here's my question..." },
      { "type": "image", "source": { "type": "base64", "media_type": "image/png", "data": "..." } },
      { "type": "document", "source": { "type": "base64", "media_type": "application/pdf", "data": "..." } }
    ]
  }
}
Tool result (largest records — can be megabytes)
{
  "type": "user",
  "message": {
    "role": "user",
    "content": [{
      "type": "tool_result",
      "tool_use_id": "toolu_01GDkdQqCUmNQihyJQJWW6R2",
      "content": "File created successfully at: /path/to/file.py",
      "is_error": false
    }]
  },
  "toolUseResult": { ... },
  "sourceToolAssistantUUID": "<uuid>"
}

The content inside tool_result can be a string or a list of content blocks (text, image, document).

toolUseResult variants

The top-level toolUseResult field carries structured metadata. Format varies by tool:

File read:

{ "type": "text", "file": { "filePath": "...", "content": "...", "numLines": 154, "startLine": 1, "totalLines": 154 } }

Shell command (Bash):

{ "stdout": "output...", "stderr": "", "interrupted": false, "isImage": false }

File write (Write/Create):

{ "type": "create", "filePath": "...", "content": "...", "structuredPatch": [], "originalFile": null }

Glob:

{ "filenames": ["/path/a.py", "/path/b.py"], "durationMs": 538, "numFiles": 2, "truncated": false }

WebFetch:

{ "bytes": 12345, "code": 200, "codeText": "OK", "result": "...", "durationMs": 450, "url": "..." }

TodoWrite:

{ "oldTodos": [...], "newTodos": [...] }
Optional user fields
Field Description
thinkingMetadata { "level": "high", "disabled": false, "triggers": [] }
planContent Full plan markdown (when exiting plan mode)
todos Current todo list state
permissionMode e.g. "bypassPermissions"

4. assistant — Assistant Messages

Follows the Anthropic Messages API format.

{
  "type": "assistant",
  "message": {
    "model": "claude-opus-4-6",
    "id": "msg_01Qkv88sj4UQBCuFueGbZnbe",
    "type": "message",
    "role": "assistant",
    "content": [ ... ],
    "stop_reason": "end_turn",
    "usage": {
      "input_tokens": 3,
      "cache_creation_input_tokens": 5398,
      "cache_read_input_tokens": 15436,
      "output_tokens": 25,
      "service_tier": "standard"
    }
  },
  "requestId": "req_011CXyPjbCramHhoo564y7si"
}

stop_reason: "end_turn", "max_tokens", null (while streaming).

Content block types

text — Visible response:

{ "type": "text", "text": "I'll start by exploring the codebase." }

thinking — Internal reasoning (extended thinking):

{ "type": "thinking", "thinking": "The user wants me to...", "signature": "EvECCkYICxgCKkD..." }

tool_use — Tool invocation:

{ "type": "tool_use", "id": "toolu_01GDkd...", "name": "Read", "input": { "file_path": "/path/to/file" } }

Common tool names: Read, Write, Glob, Grep, Bash, Task, TodoWrite, ExitPlanMode, WebFetch, WebSearch.

Streaming: one response = multiple JSONL lines

A single assistant turn is streamed as multiple records sharing the same message.id:

  1. Line with text block
  2. Line with tool_use block
  3. (User lines with tool_result blocks return)
  4. More assistant lines continuing the response

5. progress — Hook Events

Internal notifications. Not conversation content.

{
  "type": "progress",
  "data": {
    "type": "hook_progress",
    "hookEvent": "PostToolUse",
    "hookName": "PostToolUse:Read",
    "command": "callback"
  },
  "parentToolUseID": "toolu_019CB9...",
  "toolUseID": "toolu_019CB9..."
}

6. system — System Metadata

Turn duration, local commands, status updates.

Turn duration:

{ "type": "system", "subtype": "turn_duration", "durationMs": 44534 }

Local command (e.g., /resume, /compact):

{ "type": "system", "subtype": "local_command", "content": "<command-name>/compact</command-name>", "level": "info" }

Message Threading

Messages form a tree via parentUuid → uuid links. The main conversation is a linear chain; isSidechain: true marks branched explorations.

To reconstruct order: start at parentUuid: null, follow the chain. The summary's leafUuid points to the final message.

Session Continuation

When a session is resumed (/resume), messages append to the same .jsonl file with the same sessionId.

Agent Sessions

Subagent transcripts use agent-<shortId>.jsonl naming. Same message format, but isSidechain is typically true.


Size Profile (typical long session)

Category % of file Description
Base64 blobs ~95% Images/PDFs in tool results and document blocks
Tool result text ~2% Shell output, file contents (plain text)
Envelope metadata ~2% UUIDs, timestamps, usage stats
Thinking <1% Extended thinking blocks + signatures
Visible text <1% User messages + assistant responses
Tool calls <1% Tool name + JSON input

History File

~/.claude/history.jsonl — global command history (not a conversation):

{ "display": "the command text", "pastedContents": {}, "timestamp": 1759022024295, "project": "/Users/neil/project" }

Related Tools

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

1 alert6mo3 checks · Risk SAFE
  • Gen Agent Trust Hub6mo

    This skill is a utility for converting AI conversation logs (such as Claude Code or ChatGPT exports) from JSONL format to Markdown. It runs locally using standard Python libraries, removes large binary data like images, and preserves human-readable text. No suspicious network activity, obfuscation, or malicious patterns were detected.

  • Socket6mo

    No alerts

  • Snyk6mo

    Risk: HIGH · 1 issue

Signed by skilld at cc33127. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 6 days ago.

Activeupdated 5 months ago

README badge

README badge for vicnaum/vics-agent-skills/ai-conversation-extractor