fixing-claude-export-conversations — скилл для Claude Code
Возвращает вид экспортированному .txt из Claude: склеивает разорванные абзацы, собирает таблицы и пути, разбитые переносом по фиксированной ширине.
npx skills add daymade/claude-code-skills --skill fixing-claude-export-conversations -a claude-code
npx skills add daymade/claude-code-skills --skill claude-export-txt-better -a claude-codeЧто делает fixing-claude-export-conversations
Экспорт беседы из Claude в .txt часто выходит с поломанной вёрсткой: абзац разрезан на строки, рамка таблицы разъехалась, путь к файлу разорван пополам, вывод инструмента перемешан. Скилл прогоняет такой файл через скрипт fix-claude-export.py и восстанавливает структуру по типу содержимого: промпты пользователя, ответы, таблицы, вызовы и результаты инструментов, текст плана, дерево агентов.
Разрыв определяется по следующей строке, а не по порогу ширины: скрипт смотрит, похожа ли она на продолжение — начинается со строчной буквы, иероглифа, скобки или дефиса. При склейке смешанного текста между латиницей и CJK вставляется пробел. Идентификаторы, пути и имена через дефис соединяются без пробела.
Нужен Python 3.10+ и uv; внешних пакетов нет, только стандартная библиотека. После правки стоит прогнать validate-claude-export-fix.py: проверки сверяют счётчики маркеров ❯, ●, ✻, ⎿, … и предупреждают о слишком длинных склеенных строках. Исходный файл скрипт не трогает. Для живой веб-беседы или истории сессий скилл не подходит — там другие инструменты.
Какие задачи решает
- собрать обратно абзацы, разбитые экспортом на строки
- восстановить рамки и ячейки таблиц в тексте беседы
- склеить путь к файлу, разорванный переносом
- привести в порядок вывод инструментов и диффов
- проверить результат правки автоматическими проверками
Примеры запросов агенту
- Почини экспорт
2025-04-12-183045-refactor.txt, а потом прогони проверки - Собери таблицы в этом экспорте, они развалились при переносе
- Сделай читаемый файл из экспорта и покажи статистику правок
Как установить fixing-claude-export-conversations
1Через Skills CLI (Vercel)
npx skills add daymade/claude-code-skills --skill fixing-claude-export-conversations -a claude-codenpx skills add daymade/claude-code-skills --skill claude-export-txt-better -a claude-code2Вручную: положить файлы
~/.claude/skills/claude-export-txt-better/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/claude-export-txt-better/
1Через Skills CLI (Vercel)
npx skills add daymade/claude-code-skills --skill claude-export-txt-better -a codex2Вручную: положить файлы
.agents/skills/claude-export-txt-better/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add daymade/claude-code-skills --skill claude-export-txt-better -a cursor2Вручную: положить файлы
.cursor/skills/claude-export-txt-better/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install daymade/claude-code-skills claude-export-txt-better2Вручную: положить файлы
.github/skills/claude-export-txt-better/SKILL.md1Через Skills CLI (Vercel)
npx skills add daymade/claude-code-skills --skill claude-export-txt-better -a gemini-cli2Командой платформы
gemini skills install https://github.com/daymade/claude-code-skills --path daymade-claude-code/claude-export-txt-betterВручную: положить файлы
.devin/skills/claude-export-txt-better/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add daymade/claude-code-skills --skill claude-export-txt-better -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Вопросы о fixing-claude-export-conversations
Как установить fixing-claude-export-conversations в Claude Code?
Через npx skills add daymade/claude-code-skills --skill fixing-claude-export-conversations -a claude-code. После установки путь к скриптам находят командой find ~/.claude -path "*/fixing-claude-export-conversations/scripts" -type d.
Что делает fixing-claude-export-conversations?
Перестраивает разорванные переносами строки в экспортированном .txt: склеивает абзацы, собирает таблицы и пути, чинит вывод инструментов. Работает по файлу, оригинал остаётся нетронутым.
Что нужно для запуска скрипта?
Python 3.10+ и uv run. Внешние пакеты не требуются: скрипт использует только стандартную библиотеку.
Исходный текст
SKILL.md · MIT
--- name: fixing-claude-export-conversations disable-model-invocation: true description: >- Fixes broken line wrapping in Claude Code exported .txt conversation files — rebuilds tables, paragraphs, paths and tool calls hard-wrapped at a fixed width. Use for an export (YYYY-MM-DD-HHMMSS-*.txt) with broken tables, split paths, or mangled tool output, or "fix export" / "make export readable". Not for a live web conversation (use read-claude-web-conversation) or session history (use read-claude-code-history). --- # Fixing Claude Code Export Conversations Reconstruct broken line wrapping in Claude Code exported `.txt` files. ## Quick Start ```bash # 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 (per-check PASS/FAIL with evidence; all must pass) 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: ```bash 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.** ```bash 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.** ```bash 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`).
© daymade · MIT · daymade/claude-code-skills