claude-code - 💡(How to fix) Fix [BUG] Cowork silently corrupts files in OneDrive folders with Files-On-Demand

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

<p class="font-claude-response-body break-words whitespace-normal leading-[1.7]">When a Cowork session has access to a folder that lives in a OneDrive (or any cloud-sync) directory with Files-On-Demand enabled, Cowork's file tools (<code class="bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]">Read</code>, <code class="bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]">Edit</code>, <code class="bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]">Write</code>, and the Linux mount that powers <code class="bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]">bash</code>) operate on the local <strong>placeholder/stub</strong> of a file rather than the actual cloud-hydrated content. When Cowork then writes to the file (thinking it has the canonical version), it silently overwrites the user's full cloud copy with the truncated stub plus whatever edits Cowork made. <strong>The user loses data silently.</strong> No error, no warning, no diff prompt.</p> <li class="font-claude-response-body whitespace-normal break-words pl-2"><strong>Detect Files-On-Demand placeholders before reading.</strong> On every file Read from a OneDrive/iCloud/Google Drive folder, check <code class="bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]">stat</code> for <code class="bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]">Blocks == 0 &amp;&amp; Size &gt; 0</code>. If detected, either (a) force hydration by reading via a Windows API call that resolves the placeholder (the standard Win32 <code class="bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]">CreateFile</code>/<code class="bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]">ReadFile</code> does this automatically when called from a non-FILE_FLAG_OPEN_NO_RECALL context), or (b) error out and surface to the user: "This file is currently cloud-only. Click to download for editing, then retry."</li> <li class="font-claude-response-body whitespace-normal break-words pl-2"><strong>Warn prominently in the docs / agent system prompt.</strong> Even just adding to the system prompt "Cloud-sync folders (OneDrive, iCloud, Google Drive) with Files-On-Demand can serve truncated placeholder files; verify with <code class="bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]">stat ... Blocks</code> before treating large files as canonical" would let agents detect and route around the problem.</li> ### Error Messages/Logs

Fix Action

Fix / Workaround

<html> <body> <!--StartFragment--><h2 class="text-text-100 mt-3 -mb-1 text-[1.375rem] font-bold">Bug report: Cowork silently corrupts files in OneDrive folders with Files-On-Demand</h2> <h3 class="text-text-100 mt-3 -mb-1 text-[1.125rem] font-bold">Summary</h3> <p class="font-claude-response-body break-words whitespace-normal leading-[1.7]">When a Cowork session has access to a folder that lives in a OneDrive (or any cloud-sync) directory with Files-On-Demand enabled, Cowork's file tools (<code class="bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]">Read</code>, <code class="bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]">Edit</code>, <code class="bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]">Write</code>, and the Linux mount that powers <code class="bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]">bash</code>) operate on the local <strong>placeholder/stub</strong> of a file rather than the actual cloud-hydrated content. When Cowork then writes to the file (thinking it has the canonical version), it silently overwrites the user's full cloud copy with the truncated stub plus whatever edits Cowork made. <strong>The user loses data silently.</strong> No error, no warning, no diff prompt.</p> <h3 class="text-text-100 mt-3 -mb-1 text-[1.125rem] font-bold">Reproduction</h3> <ol class="[li_&amp;]:mb-0 [li_&amp;]:mt-1 [li_&amp;]:gap-1 [&amp;:not(:last-child)_ul]:pb-1 [&amp;:not(:last-child)_ol]:pb-1 list-decimal flex flex-col gap-1 pl-8 mb-3"> <li class="font-claude-response-body whitespace-normal break-words pl-2">Create a file in a OneDrive folder (e.g., <code class="bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]">C:\Users\me\OneDrive\Documents\Projects\big-file.md</code>) that is &gt;100 KB and has been synced to cloud but evicted from local cache (the "cloud-only" green-circle icon, or any Files-On-Demand state where the file isn't fully kept on disk).</li> <li class="font-claude-response-body whitespace-normal break-words pl-2">Connect that folder to Cowork.</li> <li class="font-claude-response-body whitespace-normal break-words pl-2">Have Cowork read or edit the file. From Cowork's perspective, the file appears to be ~130 KB (the typical placeholder size, regardless of true content size). All sections past that byte boundary appear truncated/missing.</li> <li class="font-claude-response-body whitespace-normal break-words pl-2">Have Cowork write to the file (e.g., via <code class="bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]">Edit</code>, <code class="bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]">Write</code>, or <code class="bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]">cp</code> over the mount).</li> <li class="font-claude-response-body whitespace-normal break-words pl-2"><strong>Result:</strong> the actual file on disk is now the truncated content Cowork saw, plus Cowork's edits. The user's full canonical content is destroyed unless OneDrive's version history can be used to roll back.</li> </ol> <h3 class="text-text-100 mt-3 -mb-1 text-[1.125rem] font-bold">Evidence from this session</h3> <p class="font-claude-response-body break-words whitespace-normal leading-[1.7]">Files destroyed or corrupted by this pattern in one session:</p> <div class="overflow-x-auto w-full px-2 mb-6"> File | Real size (user view) | What Cowork saw | What got written back -- | -- | -- | -- 04-decisions.md | ~158 KB (51 ADRs) | ~114 KB (truncated mid-ADR-040, ADRs 041–045 missing) | If we'd written, would have lost ADRs 041–045. Recovered by reconstructing the lost ADRs from cross-references in other docs. 14-ui-mockups.html | ~258 KB (15 sections) | ~24 KB (only sections 1 + start of 2) | Cowork "rebuilt" sections 3–15 with a different (worse) design language. User had to restore from OneDrive version history. 10-runtime-design.md | ~194 KB (full §1–§10) | ~137 KB (truncated mid-§5.13, missing §5.14–§5.19 + §6–§10) | Multiple times. Eventually resolved by user uploading canonical via chat. Multiple SVG diagrams | ~30 KB | ~30 KB but truncated mid-tag | Render failures (cairosvg couldn't parse); each required patch-via-/tmp workaround. </div> <p class="font-claude-response-body break-words whitespace-normal leading-[1.7]">The unifying signal that distinguishes a real file from a Files-On-Demand placeholder:</p> <div role="group" aria-label="bash code" tabindex="0" class="relative group/copy bg-bg-000/50 border-0.5 border-border-400 rounded-lg focus:outline-none focus-visible:ring-2 focus-visible:ring-accent-100"><div class="sticky opacity-0 group-hover/copy:opacity-100 group-focus-within/copy:opacity-100 top-2 py-2 h-12 w-0 float-right"><div class="absolute right-0 h-8 px-2 items-center inline-flex z-10"><button class="inline-flex items-center justify-center relative isolate shrink-0 can-focus select-none disabled:pointer-events-none disabled:opacity-50 disabled:shadow-none disabled:drop-shadow-none border-transparent transition font-base duration-300 ease-[cubic-bezier(0.165,0.85,0.45,1)] h-8 w-8 rounded-md backdrop-blur-md _fill_10ocf_9 _ghost_10ocf_96" type="button" aria-label="Copy to clipboard" data-state="closed"><div class="relative"><div class="transition-all opacity-100 scale-100" style="width: 20px; height: 20px; display: flex; align-items: center; justify-content: center;"><svg width="20" height="20" viewBox="0 0 20 20" fill="currentColor" xmlns="http://www.w3.org/2000/svg" class="transition-all opacity-100 scale-100" aria-hidden="true" style="flex-shrink: 0;"><path d="M12.5 3A1.5 1.5 0 0 1 14 4.5V6h1.5A1.5 1.5 0 0 1 17 7.5v8a1.5 1.5 0 0 1-1.5 1.5h-8A1.5 1.5 0 0 1 6 15.5V14H4.5A1.5 1.5 0 0 1 3 12.5v-8A1.5 1.5 0 0 1 4.5 3zm1.5 9.5a1.5 1.5 0 0 1-1.5 1.5H7v1.5a.5.5 0 0 0 .5.5h8a.5.5 0 0 0 .5-.5v-8a.5.5 0 0 0-.5-.5H14zM4.5 4a.5.5 0 0 0-.5.5v8a.5.5 0 0 0 .5.5h8a.5.5 0 0 0 .5-.5v-8a.5.5 0 0 0-.5-.5z"></path></svg></div><div class="absolute inset-0 flex items-center justify-center"><div class="transition-all opacity-0 scale-50" style="width: 20px; height: 20px; display: flex; align-items: center; justify-content: center;"><svg width="20" height="20" viewBox="0 0 20 20" fill="currentColor" xmlns="http://www.w3.org/2000/svg" class="transition-all opacity-0 scale-50" aria-hidden="true" style="flex-shrink: 0;"><path d="M15.188 5.11a.5.5 0 0 1 .752.626l-.056.084-7.5 9a.5.5 0 0 1-.738.033l-3.5-3.5-.064-.078a.501.501 0 0 1 .693-.693l.078.064 3.113 3.113 7.15-8.58z"></path></svg></div></div></div></button></div></div><div class="text-text-500 font-small p-3.5 pb-0">bash</div><div class="overflow-x-auto"><pre class="code-block__code !my-0 !rounded-lg !text-sm !leading-relaxed p-3.5" style="color: rgb(20, 24, 31); background: transparent; font-family: var(--font-mono);"><code class="language-bash" style="color: rgb(20, 24, 31); background: transparent; font-family: var(--font-mono); white-space: pre;"><span><span>$ </span><span class="token token" style="color: rgb(0, 81, 194);">stat</span><span> </span><span class="token token" style="color: rgb(0, 128, 128);">10</span><span>-runtime-design.md </span></span><span><span> Size: </span><span class="token token" style="color: rgb(0, 128, 128);">137377</span><span> Blocks: </span><span class="token token" style="color: rgb(0, 128, 128);">0</span><span> IO Block: </span><span class="token token" style="color: rgb(0, 128, 128);">262144</span><span> regular </span><span class="token token" style="color: rgb(0, 81, 194);">file</span><span> </span></span><span> ^^^^^^^^^ </span><span> ZERO BLOCKS on disk despite non-zero Size</span></code></pre></div></div> <p class="font-claude-response-body break-words whitespace-normal leading-[1.7]"><code class="bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]">Blocks: 0</code> (or any value much smaller than <code class="bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]">Size / 4096</code>) is the giveaway. The Windows attribute is <code class="bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]">FILE_ATTRIBUTE_RECALL_ON_OPEN</code> / <code class="bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]">FILE_ATTRIBUTE_RECALL_ON_DATA_ACCESS</code>.</p> <h3 class="text-text-100 mt-3 -mb-1 text-[1.125rem] font-bold">Suggested mitigations (in order of impact)</h3> <ol class="[li_&amp;]:mb-0 [li_&amp;]:mt-1 [li_&amp;]:gap-1 [&amp;:not(:last-child)_ul]:pb-1 [&amp;:not(:last-child)_ol]:pb-1 list-decimal flex flex-col gap-1 pl-8 mb-3"> <li class="font-claude-response-body whitespace-normal break-words pl-2"><strong>Detect Files-On-Demand placeholders before reading.</strong> On every file Read from a OneDrive/iCloud/Google Drive folder, check <code class="bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]">stat</code> for <code class="bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]">Blocks == 0 &amp;&amp; Size &gt; 0</code>. If detected, either (a) force hydration by reading via a Windows API call that resolves the placeholder (the standard Win32 <code class="bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]">CreateFile</code>/<code class="bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]">ReadFile</code> does this automatically when called from a non-FILE_FLAG_OPEN_NO_RECALL context), or (b) error out and surface to the user: "This file is currently cloud-only. Click to download for editing, then retry."</li> <li class="font-claude-response-body whitespace-normal break-words pl-2"><strong>Refuse to write to a file that looks dramatically smaller than the version Cowork last saw.</strong> A simple guard: if a write is about to replace a file whose previous size was &gt;2× larger, require an explicit confirmation or skip. This single check would have prevented every data-loss incident in this session.</li> <li class="font-claude-response-body whitespace-normal break-words pl-2"><strong>Warn prominently in the docs / agent system prompt.</strong> Even just adding to the system prompt "Cloud-sync folders (OneDrive, iCloud, Google Drive) with Files-On-Demand can serve truncated placeholder files; verify with <code class="bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]">stat ... Blocks</code> before treating large files as canonical" would let agents detect and route around the problem.</li> <li class="font-claude-response-body whitespace-normal break-words pl-2"><strong>Use the OneDrive / iCloud / Google Drive API directly when available.</strong> For OneDrive folders, Microsoft Graph API can read the cloud copy regardless of local state. Cowork could detect a OneDrive path and use Graph instead of the local mount for files &gt;N KB.</li> <li class="font-claude-response-body whitespace-normal break-words pl-2"><strong>For the Linux mount specifically:</strong> force-hydrate every file in the connected folder on session start, or document clearly that the mount is "best-effort over Files-On-Demand" and provide a fallback path.</li> </ol> <h3 class="text-text-100 mt-3 -mb-1 text-[1.125rem] font-bold">Workaround we used (which should not be the user's job)</h3> <p class="font-claude-response-body break-words whitespace-normal leading-[1.7]">For every doc edit in this session past the first incident:</p> <ol class="[li_&amp;]:mb-0 [li_&amp;]:mt-1 [li_&amp;]:gap-1 [&amp;:not(:last-child)_ul]:pb-1 [&amp;:not(:last-child)_ol]:pb-1 list-decimal flex flex-col gap-1 pl-8 mb-3"> <li class="font-claude-response-body whitespace-normal break-words pl-2">User drags the file into chat (uploads to Cowork's <code class="bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]">/uploads/</code> folder, which is in <code class="bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]">AppData</code> — outside OneDrive, no Files-On-Demand layer).</li> <li class="font-claude-response-body whitespace-normal break-words pl-2">Cowork reads from <code class="bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]">/uploads/</code>, edits a copy in <code class="bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]">/outputs/</code> (also <code class="bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]">AppData</code>).</li> <li class="font-claude-response-body whitespace-normal break-words pl-2">User manually opens both files in their editor, copies the patched version, pastes over the OneDrive original.</li> <li class="font-claude-response-body whitespace-normal break-words pl-2">Cowork verifies indirectly (file size in Windows Explorer matches Cowork's patched-file size).</li> </ol> <p class="font-claude-response-body break-words whitespace-normal leading-[1.7]">This is six manual steps per edit on what should be a single-tool-call operation. The user effectively had to operate two file systems and broker between them. They (rightly) called this out as a Cowork-team-should-fix-it problem.</p> <h3 class="text-text-100 mt-3 -mb-1 text-[1.125rem] font-bold">Severity</h3> <p class="font-claude-response-body break-words whitespace-normal leading-[1.7]"><strong>High.</strong> The default Windows + OneDrive configuration (Files-On-Demand on, the default since Windows 10 1709) is the trigger. Anyone using Cowork against a OneDrive project folder is at risk of silent data loss on any large file the agent edits. The user has no way to know it happened until they notice the missing content later.</p><!--EndFragment--> </body> </html>
RAW_BUFFERClick to expand / collapse

Preflight Checklist

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

What's Wrong?

<html> <body> <!--StartFragment--><h2 class="text-text-100 mt-3 -mb-1 text-[1.375rem] font-bold">Bug report: Cowork silently corrupts files in OneDrive folders with Files-On-Demand</h2> <h3 class="text-text-100 mt-3 -mb-1 text-[1.125rem] font-bold">Summary</h3> <p class="font-claude-response-body break-words whitespace-normal leading-[1.7]">When a Cowork session has access to a folder that lives in a OneDrive (or any cloud-sync) directory with Files-On-Demand enabled, Cowork's file tools (<code class="bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]">Read</code>, <code class="bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]">Edit</code>, <code class="bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]">Write</code>, and the Linux mount that powers <code class="bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]">bash</code>) operate on the local <strong>placeholder/stub</strong> of a file rather than the actual cloud-hydrated content. When Cowork then writes to the file (thinking it has the canonical version), it silently overwrites the user's full cloud copy with the truncated stub plus whatever edits Cowork made. <strong>The user loses data silently.</strong> No error, no warning, no diff prompt.</p> <h3 class="text-text-100 mt-3 -mb-1 text-[1.125rem] font-bold">Reproduction</h3> <ol class="[li_&amp;]:mb-0 [li_&amp;]:mt-1 [li_&amp;]:gap-1 [&amp;:not(:last-child)_ul]:pb-1 [&amp;:not(:last-child)_ol]:pb-1 list-decimal flex flex-col gap-1 pl-8 mb-3"> <li class="font-claude-response-body whitespace-normal break-words pl-2">Create a file in a OneDrive folder (e.g., <code class="bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]">C:\Users\me\OneDrive\Documents\Projects\big-file.md</code>) that is &gt;100 KB and has been synced to cloud but evicted from local cache (the "cloud-only" green-circle icon, or any Files-On-Demand state where the file isn't fully kept on disk).</li> <li class="font-claude-response-body whitespace-normal break-words pl-2">Connect that folder to Cowork.</li> <li class="font-claude-response-body whitespace-normal break-words pl-2">Have Cowork read or edit the file. From Cowork's perspective, the file appears to be ~130 KB (the typical placeholder size, regardless of true content size). All sections past that byte boundary appear truncated/missing.</li> <li class="font-claude-response-body whitespace-normal break-words pl-2">Have Cowork write to the file (e.g., via <code class="bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]">Edit</code>, <code class="bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]">Write</code>, or <code class="bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]">cp</code> over the mount).</li> <li class="font-claude-response-body whitespace-normal break-words pl-2"><strong>Result:</strong> the actual file on disk is now the truncated content Cowork saw, plus Cowork's edits. The user's full canonical content is destroyed unless OneDrive's version history can be used to roll back.</li> </ol> <h3 class="text-text-100 mt-3 -mb-1 text-[1.125rem] font-bold">Evidence from this session</h3> <p class="font-claude-response-body break-words whitespace-normal leading-[1.7]">Files destroyed or corrupted by this pattern in one session:</p> <div class="overflow-x-auto w-full px-2 mb-6"> File | Real size (user view) | What Cowork saw | What got written back -- | -- | -- | -- 04-decisions.md | ~158 KB (51 ADRs) | ~114 KB (truncated mid-ADR-040, ADRs 041–045 missing) | If we'd written, would have lost ADRs 041–045. Recovered by reconstructing the lost ADRs from cross-references in other docs. 14-ui-mockups.html | ~258 KB (15 sections) | ~24 KB (only sections 1 + start of 2) | Cowork "rebuilt" sections 3–15 with a different (worse) design language. User had to restore from OneDrive version history. 10-runtime-design.md | ~194 KB (full §1–§10) | ~137 KB (truncated mid-§5.13, missing §5.14–§5.19 + §6–§10) | Multiple times. Eventually resolved by user uploading canonical via chat. Multiple SVG diagrams | ~30 KB | ~30 KB but truncated mid-tag | Render failures (cairosvg couldn't parse); each required patch-via-/tmp workaround. </div> <p class="font-claude-response-body break-words whitespace-normal leading-[1.7]">The unifying signal that distinguishes a real file from a Files-On-Demand placeholder:</p> <div role="group" aria-label="bash code" tabindex="0" class="relative group/copy bg-bg-000/50 border-0.5 border-border-400 rounded-lg focus:outline-none focus-visible:ring-2 focus-visible:ring-accent-100"><div class="sticky opacity-0 group-hover/copy:opacity-100 group-focus-within/copy:opacity-100 top-2 py-2 h-12 w-0 float-right"><div class="absolute right-0 h-8 px-2 items-center inline-flex z-10"><button class="inline-flex items-center justify-center relative isolate shrink-0 can-focus select-none disabled:pointer-events-none disabled:opacity-50 disabled:shadow-none disabled:drop-shadow-none border-transparent transition font-base duration-300 ease-[cubic-bezier(0.165,0.85,0.45,1)] h-8 w-8 rounded-md backdrop-blur-md _fill_10ocf_9 _ghost_10ocf_96" type="button" aria-label="Copy to clipboard" data-state="closed"><div class="relative"><div class="transition-all opacity-100 scale-100" style="width: 20px; height: 20px; display: flex; align-items: center; justify-content: center;"><svg width="20" height="20" viewBox="0 0 20 20" fill="currentColor" xmlns="http://www.w3.org/2000/svg" class="transition-all opacity-100 scale-100" aria-hidden="true" style="flex-shrink: 0;"><path d="M12.5 3A1.5 1.5 0 0 1 14 4.5V6h1.5A1.5 1.5 0 0 1 17 7.5v8a1.5 1.5 0 0 1-1.5 1.5h-8A1.5 1.5 0 0 1 6 15.5V14H4.5A1.5 1.5 0 0 1 3 12.5v-8A1.5 1.5 0 0 1 4.5 3zm1.5 9.5a1.5 1.5 0 0 1-1.5 1.5H7v1.5a.5.5 0 0 0 .5.5h8a.5.5 0 0 0 .5-.5v-8a.5.5 0 0 0-.5-.5H14zM4.5 4a.5.5 0 0 0-.5.5v8a.5.5 0 0 0 .5.5h8a.5.5 0 0 0 .5-.5v-8a.5.5 0 0 0-.5-.5z"></path></svg></div><div class="absolute inset-0 flex items-center justify-center"><div class="transition-all opacity-0 scale-50" style="width: 20px; height: 20px; display: flex; align-items: center; justify-content: center;"><svg width="20" height="20" viewBox="0 0 20 20" fill="currentColor" xmlns="http://www.w3.org/2000/svg" class="transition-all opacity-0 scale-50" aria-hidden="true" style="flex-shrink: 0;"><path d="M15.188 5.11a.5.5 0 0 1 .752.626l-.056.084-7.5 9a.5.5 0 0 1-.738.033l-3.5-3.5-.064-.078a.501.501 0 0 1 .693-.693l.078.064 3.113 3.113 7.15-8.58z"></path></svg></div></div></div></button></div></div><div class="text-text-500 font-small p-3.5 pb-0">bash</div><div class="overflow-x-auto"><pre class="code-block__code !my-0 !rounded-lg !text-sm !leading-relaxed p-3.5" style="color: rgb(20, 24, 31); background: transparent; font-family: var(--font-mono);"><code class="language-bash" style="color: rgb(20, 24, 31); background: transparent; font-family: var(--font-mono); white-space: pre;"><span><span>$ </span><span class="token token" style="color: rgb(0, 81, 194);">stat</span><span> </span><span class="token token" style="color: rgb(0, 128, 128);">10</span><span>-runtime-design.md </span></span><span><span> Size: </span><span class="token token" style="color: rgb(0, 128, 128);">137377</span><span> Blocks: </span><span class="token token" style="color: rgb(0, 128, 128);">0</span><span> IO Block: </span><span class="token token" style="color: rgb(0, 128, 128);">262144</span><span> regular </span><span class="token token" style="color: rgb(0, 81, 194);">file</span><span> </span></span><span> ^^^^^^^^^ </span><span> ZERO BLOCKS on disk despite non-zero Size</span></code></pre></div></div> <p class="font-claude-response-body break-words whitespace-normal leading-[1.7]"><code class="bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]">Blocks: 0</code> (or any value much smaller than <code class="bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]">Size / 4096</code>) is the giveaway. The Windows attribute is <code class="bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]">FILE_ATTRIBUTE_RECALL_ON_OPEN</code> / <code class="bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]">FILE_ATTRIBUTE_RECALL_ON_DATA_ACCESS</code>.</p> <h3 class="text-text-100 mt-3 -mb-1 text-[1.125rem] font-bold">Suggested mitigations (in order of impact)</h3> <ol class="[li_&amp;]:mb-0 [li_&amp;]:mt-1 [li_&amp;]:gap-1 [&amp;:not(:last-child)_ul]:pb-1 [&amp;:not(:last-child)_ol]:pb-1 list-decimal flex flex-col gap-1 pl-8 mb-3"> <li class="font-claude-response-body whitespace-normal break-words pl-2"><strong>Detect Files-On-Demand placeholders before reading.</strong> On every file Read from a OneDrive/iCloud/Google Drive folder, check <code class="bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]">stat</code> for <code class="bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]">Blocks == 0 &amp;&amp; Size &gt; 0</code>. If detected, either (a) force hydration by reading via a Windows API call that resolves the placeholder (the standard Win32 <code class="bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]">CreateFile</code>/<code class="bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]">ReadFile</code> does this automatically when called from a non-FILE_FLAG_OPEN_NO_RECALL context), or (b) error out and surface to the user: "This file is currently cloud-only. Click to download for editing, then retry."</li> <li class="font-claude-response-body whitespace-normal break-words pl-2"><strong>Refuse to write to a file that looks dramatically smaller than the version Cowork last saw.</strong> A simple guard: if a write is about to replace a file whose previous size was &gt;2× larger, require an explicit confirmation or skip. This single check would have prevented every data-loss incident in this session.</li> <li class="font-claude-response-body whitespace-normal break-words pl-2"><strong>Warn prominently in the docs / agent system prompt.</strong> Even just adding to the system prompt "Cloud-sync folders (OneDrive, iCloud, Google Drive) with Files-On-Demand can serve truncated placeholder files; verify with <code class="bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]">stat ... Blocks</code> before treating large files as canonical" would let agents detect and route around the problem.</li> <li class="font-claude-response-body whitespace-normal break-words pl-2"><strong>Use the OneDrive / iCloud / Google Drive API directly when available.</strong> For OneDrive folders, Microsoft Graph API can read the cloud copy regardless of local state. Cowork could detect a OneDrive path and use Graph instead of the local mount for files &gt;N KB.</li> <li class="font-claude-response-body whitespace-normal break-words pl-2"><strong>For the Linux mount specifically:</strong> force-hydrate every file in the connected folder on session start, or document clearly that the mount is "best-effort over Files-On-Demand" and provide a fallback path.</li> </ol> <h3 class="text-text-100 mt-3 -mb-1 text-[1.125rem] font-bold">Workaround we used (which should not be the user's job)</h3> <p class="font-claude-response-body break-words whitespace-normal leading-[1.7]">For every doc edit in this session past the first incident:</p> <ol class="[li_&amp;]:mb-0 [li_&amp;]:mt-1 [li_&amp;]:gap-1 [&amp;:not(:last-child)_ul]:pb-1 [&amp;:not(:last-child)_ol]:pb-1 list-decimal flex flex-col gap-1 pl-8 mb-3"> <li class="font-claude-response-body whitespace-normal break-words pl-2">User drags the file into chat (uploads to Cowork's <code class="bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]">/uploads/</code> folder, which is in <code class="bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]">AppData</code> — outside OneDrive, no Files-On-Demand layer).</li> <li class="font-claude-response-body whitespace-normal break-words pl-2">Cowork reads from <code class="bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]">/uploads/</code>, edits a copy in <code class="bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]">/outputs/</code> (also <code class="bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]">AppData</code>).</li> <li class="font-claude-response-body whitespace-normal break-words pl-2">User manually opens both files in their editor, copies the patched version, pastes over the OneDrive original.</li> <li class="font-claude-response-body whitespace-normal break-words pl-2">Cowork verifies indirectly (file size in Windows Explorer matches Cowork's patched-file size).</li> </ol> <p class="font-claude-response-body break-words whitespace-normal leading-[1.7]">This is six manual steps per edit on what should be a single-tool-call operation. The user effectively had to operate two file systems and broker between them. They (rightly) called this out as a Cowork-team-should-fix-it problem.</p> <h3 class="text-text-100 mt-3 -mb-1 text-[1.125rem] font-bold">Severity</h3> <p class="font-claude-response-body break-words whitespace-normal leading-[1.7]"><strong>High.</strong> The default Windows + OneDrive configuration (Files-On-Demand on, the default since Windows 10 1709) is the trigger. Anyone using Cowork against a OneDrive project folder is at risk of silent data loss on any large file the agent edits. The user has no way to know it happened until they notice the missing content later.</p><!--EndFragment--> </body> </html>

What Should Happen?

Files should sync from onedrive to shared drive without issue.

Error Messages/Logs

Steps to Reproduce

see original message above

Claude Model

Opus

Is this a regression?

I don't know

Last Working Version

No response

Claude Code Version

Claude 1.8555.2 (a476c3) 2026-05-22T23:04:37.000Z

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

Other

Additional Information

No response

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING