Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
daymade avatar

Fixing Claude Export Conversations

  • 540 installs
  • 1.3k repo stars
  • Updated August 4, 2026
  • daymade/claude-code-skills

fixing-claude-export-conversations is an agent skill that repairs broken Claude conversation export JSON when imports fail, threads truncate, or tool blocks corrupt for developers preserving agent archives.

About

fixing-claude-export-conversations is a Claude Code skill from daymade/claude-code-skills for salvaging Claude conversation export files that fail to import or load cleanly. The skill targets common JSON breakage—truncated message threads, malformed tool-use blocks, and schema inconsistencies—that block archival review, compliance audits, and dataset preparation for skill fine-tuning. Developers reach for fixing-claude-export-conversations when Claude Desktop or CLI exports stop parsing, conversation history appears cut off, or automated pipelines reject export JSON that must remain searchable and reproducible.

  • Export JSON schema repair
  • Truncation and encoding fixes
  • Tool-call block recovery
  • Validation before re-import
  • Preserves audit trails

Fixing Claude Export Conversations by the numbers

  • 540 all-time installs (skills.sh)
  • Ranked #78 of 596 Debugging skills by installs in the Skillselion catalog
  • Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/daymade/claude-code-skills --skill fixing-claude-export-conversations

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs540
repo stars1.3k
Last updatedAugust 4, 2026
Repositorydaymade/claude-code-skills

How do you fix broken Claude export JSON files?

Repair broken Claude conversation export JSON when imports fail, threads truncate, or tool blocks corrupt so archives, audits, and skill fine-tuning stay usable.

Who is it for?

Developers maintaining Claude conversation archives, audit logs, or fine-tuning datasets from export files.

Skip if: Teams with intact exports that import without errors should skip fixing-claude-export-conversations.

When should I use this skill?

Claude export JSON fails to import, conversation threads are truncated, or tool blocks appear corrupt in archived chats.

What you get

Repaired export JSON, restored message threads, valid tool blocks, and import-ready conversation archives

  • Repaired export JSON
  • Restored conversation threads

Files

SKILL.mdMarkdownGitHub ↗

Fixing Claude Code Export Conversations

Reconstruct broken line wrapping in Claude Code exported .txt files.

Quick Start

# Fix and show stats
uv run <skill-path>/scripts/fix-claude-export.py <export.txt> --stats

# Custom output
uv run <skill-path>/scripts/fix-claude-export.py <export.txt> -o fixed.txt

# Validate the result (53 automated checks)
uv run <skill-path>/scripts/validate-claude-export-fix.py <export.txt> fixed.txt

Replace <skill-path> with the resolved path to this skill's directory. Find it with:

find ~/.claude -path "*/fixing-claude-export-conversations/scripts" -type d 2>/dev/null

Workflow

Copy this checklist and track progress:

- [ ] Step 1: Locate the exported .txt file
- [ ] Step 2: Run fix script with --stats
- [ ] Step 3: Run validation suite
- [ ] Step 4: Spot-check output (tables, CJK paragraphs, tool results)
- [ ] Step 5: Deliver fixed file to user

Step 1: Locate the file. Claude Code exports use the naming pattern YYYY-MM-DD-HHMMSS-<slug>.txt.

Step 2: Run the fix script.

uv run <skill-path>/scripts/fix-claude-export.py <input.txt> -o <output.txt> --stats

Review the stats output — typical results: 20-25% line reduction, 80+ table borders fixed, 160+ table cells fixed.

Step 3: Run the validation suite.

uv run <skill-path>/scripts/validate-claude-export-fix.py <input.txt> <output.txt>

All checks must pass. If any fail, investigate before delivering. Use --verbose for full details on passing checks too.

Step 4: Spot-check. Open the output and verify:

  • Tables have intact borders (box-drawing characters on single lines)
  • CJK/English mixed text has pangu spacing (Portal 都需要, not Portal都需要)
  • Tool result blocks () have complete content on joined lines
  • Diff output within tool results has each line number on its own line

Step 5: Deliver the fixed file to the user.

What Gets Fixed

The script handles 10 content types using a state-machine with next-line look-ahead:

  • User prompts ( prefix, dw=76 padding) — paragraph joins with pangu spacing
  • Claude responses ( prefix) — narrative, bullet, and numbered list joins
  • Claude paragraphs (2-space indent) — next-line look-ahead via _is_continuation_fragment
  • Tables — border reconstruction, cell re-padding with pipe-count tracking
  • Tool calls (● Bash( etc.) — path and argument reconstruction
  • Tool results ( prefix) — continuation joins including deeper-indented fragments
  • Plan text (5-space indent) — next-line look-ahead via _is_plan_continuation_fragment
  • Agent tree (├─/└─) — preserved structure
  • Separators (────, ---) — never joined
  • Tree connectors (standalone ) — preserved

Key Design Decisions

Next-line look-ahead (not dw thresholds): Instead of asking "was this line wrapped?" (fragile threshold), the script asks "does the next line look like a continuation?" by examining its content patterns — lowercase start, CJK ideograph start, opening bracket, hyphen/slash/underscore continuation.

Pangu spacing: Inserts spaces between ASCII alphanumeric characters and CJK ideographs at join boundaries. Also triggers for %, #, +, : adjacent to CJK.

Mid-token detection: Joins without space when boundaries indicate identifiers (BASE_ + URL), paths (documents + /05-team), or hyphenated names (ready + -together). Exception: -- prefix gets a space (run + --headed).

Safety

  • Never modifies the original file
  • Marker counts verified: , , , , must match input/output
  • Runaway join detection: warns if any line exceeds 500 display-width
  • Strict UTF-8 encoding — no silent fallbacks

Dependencies

Python 3.10+ via uv run — zero external packages (stdlib only: unicodedata, argparse, re, pathlib, dataclasses).

Related skills

How it compares

Choose fixing-claude-export-conversations over generic JSON linting when the breakage is Claude-specific thread or tool-block structure.

FAQ

What problems does fixing-claude-export-conversations solve?

fixing-claude-export-conversations repairs Claude export JSON that fails import, truncates threads, or contains corrupt tool blocks. The skill restores archives needed for audits, backups, and dataset preparation.

When should developers use fixing-claude-export-conversations?

Use fixing-claude-export-conversations when Claude Desktop or CLI exports no longer parse or load completely. It fits developers preserving conversation history for review or fine-tuning workflows.

Debuggingworkflow

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.