[BUG] Cowork plugin skill update truncates SKILL.md to old file's exact byte length

Open 💬 0 comments Opened Jul 7, 2026 by Nutwarith

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?

When editing a Cowork plugin's skill file (SKILL.md) via the plugin customization workflow and clicking "Update" on the packaged .plugin file, the installed file gets silently truncated to the exact byte length of the original (pre-edit) file, regardless of how much new content was added. Truncation happens mid-content, even mid multi-byte UTF-8 character.

What Should Happen?

The installed skill file should fully match the new packaged .plugin content, even when it's larger than the original file.

Error Messages/Logs

No error shown to the user or in the assistant's tool output — the truncation is silent. Only detectable by reading back the installed file and comparing byte size / md5 hash against the intended new content.

Steps to Reproduce

  1. In Cowork mode, use the plugin customization workflow to edit a skill's SKILL.md inside an installed plugin, adding enough content to increase total file size beyond the original.
  2. Package the updated plugin directory as a .plugin zip and present it via present_files.
  3. Click "Update" on the presented .plugin card to install it.
  4. Read back the installed file from the plugin's mount (.remote-plugins/<plugin_id>/skills/<skill_name>/SKILL.md).
  5. Compare byte size and md5 against the newly packaged file.

Observed: installed file = 19,107 bytes (matches PRE-EDIT original exactly), vs. packaged file = 22,139 bytes. Repeated the Update click a second time — resulting file had the identical md5 hash both times, confirming deterministic truncation, not a race condition.

Claude Model

None

Is this a regression?

No, this never worked

Last Working Version

N/A — this is the first time this plugin/skill was customized through this workflow, so there's no known prior working version to reference.

Claude Code Version

N/A — Claude Desktop / Cowork mode

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

PowerShell

Additional Information

Additional context for reproducing/diagnosing:

  • Plugin affected: custom "loftbot" plugin (plugin.json name: "loftbot"), skill: document-godtowa
  • Original SKILL.md: 19,107 bytes / 251 lines
  • Packaged replacement SKILL.md: 22,139 bytes / 281 lines
  • Installed result after clicking "Update": 19,107 bytes / 239 lines — exact same byte count as the ORIGINAL file, not the new one
  • The cutoff point lands mid-table, mid multi-byte UTF-8 character (file ends on an incomplete byte sequence), suggesting the write is bounded by the old file's length rather than the new content's length
  • Reproduced twice with identical resulting md5 hash both times — rules out a transient/race-condition explanation
  • Suspected root cause: the plugin save/patch mechanism likely opens the existing file for writing without truncating it first (missing O_TRUNC or equivalent), so content beyond the original file's size is silently dropped
  • Platform: Claude Desktop, Cowork mode, Windows
  • Impact: any plugin skill edit that increases file size beyond the original will silently install broken/incomplete instructions with no error surfaced

View original on GitHub ↗