← ClaudeAtlas

llm-safe-writelisted

Safely write large files or files with CJK/special characters using incremental Edit strategy instead of direct Write. Use when: writing a file longer than 50 lines, file contains CJK characters (Chinese/Japanese/Korean), Write tool failed with "Unterminated string" or JSON truncation, writing Python/JS/TS files with multiple functions, embedding CJK strings in source code, user says "write failed", "file won't write", "large file write", "CJK write error", "encoding error on write", or "file too long to write". Also use when DISPATCHING file-writing tasks to subagents (the task tool's own JSON arguments truncate the same way Write does) — split large CJK payloads into multiple sequential subagent calls, each carrying ≤120 lines of target content. **Do NOT undertrigger** — when a file may exceed 50 lines or contain non-ASCII characters, use this Skill proactively instead of bare Write.
ThinkDonk/llm-safe-write · ★ 0 · AI & Automation · score 73
Install: claude install-skill ThinkDonk/llm-safe-write
## When to use me Use this skill when: - You need to write a file that is **longer than 50 lines** - The file contains **CJK characters** (Chinese, Japanese, Korean) or special escape sequences - A previous **Write tool call failed** with `Unterminated string` or JSON truncation errors - You are about to write a Python/JS/TS file with more than a few functions - You need to embed **CJK strings** in source code Do NOT use this skill when: - The file is short (< 50 lines) and ASCII-only — just use Write directly - You are making small edits to an existing file — just use Edit directly ## Prerequisites: Understanding Write Tool JSON Truncation The Write tool serializes file content as a JSON string for transport. CJK characters occupy 3-4 bytes each in UTF-8. When a multi-byte character happens to cross an internal buffer boundary, the JSON string gets truncated, causing `Unterminated string` errors. ASCII-only content avoids this because each character is exactly 1 byte. **Key facts**: - Truncation is **probabilistic** — short files and pure ASCII rarely trigger it, but long files or CJK content trigger it frequently - Bash tool also fails when passing multi-line Python code via PowerShell — PowerShell interprets quotes, backticks, curly braces, silently corrupting code - You may try Write for files under 50 lines, but expect frequent failures above this threshold. For files > 50 lines or containing CJK, go directly to skeleton + Edit. The 50-line threshold is conservative