[BUG] "Copy to your skills" silently truncates existing files when file size increases

Resolved 💬 3 comments Opened Mar 28, 2026 by aksat-dev Closed May 27, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

<html>
<body>
<!--StartFragment--><html><head></head><body><h2>What's Wrong?</h2>
<p>When updating a custom skill via <strong>"Copy to your skills"</strong> in Claude.ai (Cowork), existing files that increase in size are <strong>silently truncated</strong> to their original byte count. New files in the same <code>.skill</code> package deploy correctly. No error message is shown.</p>
<p><strong>Note:</strong> This bug occurs in <strong>Claude.ai / Cowork</strong> (browser interface), not Claude Code CLI. Filing here as custom skills share the same infrastructure.</p>
<h2>Steps to Reproduce</h2>
<ol>
<li>Create a custom skill with a file (e.g., <code>SKILL.md</code>) of size <strong>N bytes</strong></li>
<li>Install via "Copy to your skills" — deploys correctly</li>
<li>Modify the file so its size increases to <strong>N+M bytes</strong> (e.g., add new sections)</li>
<li>Re-package as <code>.skill</code> (zip) and install via "Copy to your skills"</li>
<li>The deployed file is truncated back to exactly <strong>N bytes</strong></li>
</ol>
<h2>Observed Behavior</h2>

File | In .skill zip | After Deploy | Status
-- | -- | -- | --
SKILL.md (modified, +3,713 bytes) | 14,680 bytes | 10,967 bytes | TRUNCATED to original size
profile.md (modified, +1,731 bytes) | 7,950 bytes | 6,219 bytes | TRUNCATED to original size
new_file.md (new file) | 2,841 bytes | 2,841 bytes | OK
10 unchanged files | various | various | OK

<p>Key observations:</p>
<ul>
<li>Only <strong>existing files that increased in size</strong> are truncated</li>
<li>Truncated size <strong>exactly matches the previous deployment's file size</strong></li>
<li>Adding 229 bytes at the beginning → 229 bytes lost from the end (confirmed)</li>
<li><strong>New files</strong> (no previous version) deploy at full size — no truncation</li>
<li>Content inside the <code>.skill</code> zip is verified complete — truncation occurs during install</li>
<li><strong>Reproducible</strong>: tested 3 times with consistent results</li>
</ul>
<h2>Additional Finding</h2>
<p>Before a recent app update (2026-03-28), files that <em>decreased</em> in size were padded with null bytes (<code>\x00</code>) to maintain the original size. After the update, null padding was resolved, but truncation on size increase persists.</p>
<h2>Expected Behavior</h2>
<p>All files in a <code>.skill</code> package should be written at their full size, regardless of whether they previously existed or changed in size.</p>
<h2>Impact</h2>
<p>Silent data loss when updating custom skills. Users adding content to existing skill files lose content from the end without any warning or error.</p>
<h2>Workaround</h2>
<p>Never increase the size of existing files. Add new information as new files only.</p>
<h2>Environment</h2>
<ul>
<li>Platform: Claude.ai (Cowork, browser interface)</li>
<li>OS: Windows</li>
<li>Deployment method: Settings &gt; Features &gt; Skills &gt; "Copy to your skills"</li>
<li>App version: latest as of 2026-03-28</li>
</ul></body></html><!--EndFragment-->
</body>
</html>

What Should Happen?

All files in a .skill package should be written at their full size when installed via "Copy to your skills", regardless of whether they previously existed or changed in size. If a file grows from 6,219 bytes to 7,950 bytes, the deployed file should be 7,950 bytes with complete content.

Error Messages/Logs

No error messages are displayed. The truncation is completely silent.
The only way to detect it is by comparing file sizes before and after deployment.

Before deploy (inside .skill zip):
  SKILL.md: 14,680 bytes
  profile.md: 7,950 bytes

After deploy (in skills folder):
  SKILL.md: 10,967 bytes (truncated to pre-update size)
  profile.md: 6,219 bytes (truncated to pre-update size)

Steps to Reproduce

  1. Create a custom skill with a SKILL.md file (any content, e.g. 100 lines)
  2. Package as .skill file and install via Settings > Features > Skills > "Copy to your skills"
  3. Verify the file deploys correctly
  4. Add new content to SKILL.md (e.g. add 30 more lines, increasing file size)
  5. Re-package as .skill and install again via "Copy to your skills"
  6. Check the deployed SKILL.md — it will be truncated to the original size from step 2
  7. The new content at the end of the file is silently lost

Note: This occurs in Claude.ai / Cowork (browser), not Claude Code CLI.
New files added to the package deploy correctly at full size.
Only existing files that increase in size are affected.

Claude Model

None

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

N/A — this bug occurs in Claude.ai (Cowork, browser interface), not Claude Code CLI

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

Additional finding: Before a recent app update (2026-03-28), files that decreased in size were padded with null bytes (\x00) to maintain the original size. After the update, null padding was resolved, but truncation on size increase persists.

This suggests the install process uses a fixed buffer based on the original file size. The null padding fix addressed one direction (shrink), but the other direction (grow) still truncates.

Workaround: Add new information as new files only (which deploy correctly). Never increase the size of existing files in a skill package.

Platform: Windows (not macOS — the terminal selector above doesn't have a Windows/browser option)

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗