Agent skill · software engineering · daymade

fixing-claude-export-conversations

Fixes broken line wrapping in Claude Code exported conversation files (.txt), reconstructing tables, paragraphs, paths, and tool calls that were hard-wrapped at fixed column widths. Includes an automated validation suite (generic, file-agnostic checks). Triggers when the user has a Claude Code export file with broken formatting, mentions "fix export", "fix conversation", "exported conversation", "make export readable", references a file matching YYYY-MM-DD-HHMMSS-*.txt, or has a .txt file with broken tables, split paths, or mangled tool output from Claude Code.

Why this skill is useful

Adds an executable script that automates the fixing of broken line wrapping in Claude Code exports, which the AI cannot generate on its own.

What it needs

Requires uv installed locally. About 3k tokens when loaded. Last updated 2026-08-07. 1,320 stars on the source repository.

What this skill does

Fixing Claude Code Export Conversations Reconstruct broken line wrapping in Claude Code exported .txt files. Quick Start Replace <skill-path> with the resolved path to this skill's directory. Find it with: Workflow Copy this checklist and track progress: Step 1: Locate the file. Claude Code exports use the naming pattern YYYY-MM-DD-HHMMSS-<slug>.txt. Step 2: Run the fix script. Review the stats output — typical results: 20-25% line reduction, 80+ table borders fixed, 160+ table cells fixed. Step 3: Run the validation suite. 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 iscontinuationfragment 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 isplancontinuationfragment 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 st …

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills daymade/claude-export-txt-better

View the source on GitHub

Browse the @skills marketplace