[BUG] Cowork: device_commit_files reports success on overwrites but the on-disk content lags exactly one commit behind (silent stale write, fresh mtime)

Status Open
Maintainer reply None cached
Activity 21 comments · opened Sep 10, 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?

Summary

When a cloud Cowork session writes back to a file that already exists on the linked device, device_commit_files returns {"written":[path],"rejected":[]}, the file's modification time advances to the moment of the call, and the content on disk is the payload from the previous commit. Committing the identical payload a second time lands it.

Creating a new file is unaffected and correct every time. Only overwrites are affected.

This is a silent data-integrity failure. The session has no signal that anything went wrong, and the file it just "wrote" looks freshly updated to any human or tool inspecting it, because the timestamp is current while the bytes are stale.

Impact

This is worse than a loud failure for two reasons.

  1. The success response is indistinguishable from a real write. An agent that follows the obvious contract, commit and move on, will report work as saved that was not saved.
  2. The timestamp lies in the same direction. A stale file carries the new write's mtime, so ordinary "has this been updated?" checks, sync tools, and human inspection all agree with the false success.

For anyone using a Cowork workspace with recurring update routines, the exposed operations are exactly the common ones: appending to a running log, updating a status line, bumping a version, editing a spec. Every one of those is an overwrite. The drift is invisible until someone reads the file much later.

Workaround

Commit the same payload twice, then stage the file back and grep the content for the intended change. Byte count is a weak check and the timestamp is no check at all. Where possible, do write-heavy work in Claude Code instead, which writes to disk directly and does not use this path. (Confirmed clean by test on the same machine: new file, two Write-tool overwrites, and one Edit-tool in-place edit, each verified from a separate PowerShell process, all four exact with no lag.)

Suggested area to look at

The off-by-one shape suggests something in the commit path is buffering or staging the payload and swapping in the previous one for the overwrite case, since the create case is correct. The mtime being updated from the current call while the bytes come from the prior call points at the metadata write and the content write reading from different sources.

What Should Happen?

After device_commit_files returns written with no rejections, the file on disk should contain the committed payload. If the write cannot be completed, the call should report the path in rejected rather than returning success.

Error Messages/Logs

Steps to Reproduce

Reproduction

Minimal repro, run against a plain local folder (C:\Users\<USER>\Downloads, not OneDrive-backed):

| Step | Action | Committed payload | Commit result | On disk immediately after |
|---|---|---|---|---|
| 1 | device_commit_files (new file) | VERSION-A… (43 bytes) | written, no rejections | 43 bytes, VERSION-A ✅ |
| 2 | device_commit_files (overwrite) | VERSION-B… (82 bytes) | written, no rejections | 43 bytes, VERSION-A ❌ (mtime advanced) |
| 3 | device_commit_files (same payload again) | VERSION-B… (82 bytes) | written, no rejections | 82 bytes, VERSION-B ✅ |
| 4 | device_commit_files (overwrite) | VERSION-C… (89 bytes) | written, no rejections | 82 bytes, VERSION-B ❌ (mtime advanced) |
| 5 | Wait 45 s, re-read, no intervening commit | — | — | 82 bytes, VERSION-B ❌ |

Payload lengths were chosen to differ, so byte count alone distinguishes the revisions without inspecting content. Content was checked as well via device_stage_files and matched the byte count in every case.

What this rules out

  • Not a read cache. Step 5 waited 45 seconds with no intervening commit and the stale content persisted. device_list_dir and device_stage_files agreed with each other at every step.
  • Not OneDrive. First observed on files under a OneDrive-synced folder, then reproduced identically in C:\Users\<USER>\Downloads, outside OneDrive entirely.
  • Not KB5124008. That update broke the Hyper-V Plan9 shares used by device_bash on this machine (see #92984). The local sandbox shell was completely non-functional throughout this testing while the file bridge kept working, so the two are on different code paths.
  • Not force. Behavior is identical with and without force: true, and with and without expectedMtimeMs.

Observed elsewhere in the same session

Reproduced five separate times across four different files before it was isolated:

  • two markdown files under a OneDrive-synced connected folder (~8 KB and ~65 KB), twice each
  • a .ps1 script file in the same folder
  • the Downloads test file above

In every case the pattern was the same: first commit reports success and leaves the prior revision, second identical commit lands the new content.

Claude Model

Opus

Is this a regression?

Yes, this worked in a previous version

Last Working Version

_No response_

Claude Code Version

Claude Desktop | 1.49585.0 |

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

Other

Additional Information

Environment

| | |
|---|---|
| Claude Desktop | 1.49585.0 |
| Platform | win32 x64 |
| Electron / Node | 44.2.0 / 24.20.0 |
| OS | Windows 11 25H2, OS Build 26200.9445 |
| Session type | Cowork cloud session linked to a desktop device |
| Model | claude-opus-5 |

Related Issue

This may be related to: https://github.com/anthropics/claude-code/issues/83354

View original on GitHub ↗

4 Comments

Skartrek · 1 month ago

+1, same behavior on my project (Windows, Cowork).

Confirming this on my setup as well:

Editing an existing file in the project via Cowork appears to succeed, but the file on disk reverts to the previous version shortly after.
Creating a new file works fine — the problem only shows up on edits to existing files.
Watched the write activity with Process Monitor: claude.exe performs two writes to the file in quick succession.

Environment: Windows 10, Claude 1.52386.3 (41896e) 2026-09-11T17:35:10.000Z, Cowork mode, project folder is a local project (not synced via OneDrive or similar)

GBalunis · 1 month ago

Follow-up with a stronger confirmation, and a note that this is still present after both the Windows fix and a desktop app update.

Environment now

  • Claude Desktop 1.52386.6 (was 1.49585.0 in the original report)
  • Windows 11 25H2, build 26200.9457 (KB5129195 out-of-band, which fixed the unrelated Plan9 regression)
  • win32 x64, Cowork cloud session linked to a desktop device

Why this run is better evidence. In the original report every read-back went through device_stage_files or device_list_dir, so a skeptic could argue the write landed and the read was stale. That could not be ruled out at the time because the local sandbox shell was down. With the sandbox restored, the file can now be read by a completely separate process on the user's own machine, outside the bridge entirely.

Result

| Action | Payload | Call result | cat via device_bash on the same machine |
|---|---|---|---|
| Create new file | VERSION-E… (85 bytes) | written, no rejections | 85 bytes, VERSION-E ✅ |
| Overwrite | VERSION-F… (94 bytes) | written, no rejections | 85 bytes, VERSION-E ❌ |
| Commit identical payload again | VERSION-F… (94 bytes) | written, no rejections | 94 bytes, VERSION-F ✅ |

The stale content is visible to a shell process on the host filesystem, not just to the bridge's own reader. It is the write that lags, not the read. The one-commit-behind behavior is unchanged from the original report, and creating a new file remains unaffected.

Practical note for anyone hitting this: if device_bash is available, editing the file in place through that shell (a read-modify-write) bypasses the defect entirely and is a better workaround than committing twice. The commit-twice-then-verify dance is only needed when the shell is unavailable, which is exactly the situation the September Plan9 regression created, so for about a week both safe write paths were closed at once.

PensionedITguy · 29 days ago

Confirming this independently - same symptom (success reported on both writes, on-disk content stuck at the earlier version, mtime updates but content doesn't) reproduced today on Windows 11 x64, Desktop app 1.52386.6 (Electron 44.2.0, Node 24.20.0), local SSD (not network/OneDrive).

Minimal repro: two device_commit_files calls to the same path back-to-back, no read in between, no other process touching the file — second write's content never lands, even after waiting 60+ seconds (not a propagation delay, permanent).

Also found a related variant: if a human edits the same file directly on disk between the agent's two writes, the agent's second write can revert the file entirely back to its own first write's content — losing both the human's edit and the agent's second edit.

samtuominen · 28 days ago

Confirming from a different machine (Windows 11 ARM64, build 28000.2954, Claude Desktop 1.49585.0.0, cloud Cowork sessions with the device bridge), with one refinement to the mechanism that may narrow where to look.

Four instances, 7 to 9 September 2026, across three separate projects and four sessions that were not aware of each other. In each, device_commit_files returned {"written":[path],"rejected":[]}, the destination mtime advanced, and the size on disk was the previous commit's (5,301 expected against 5,245 on disk; 33,320 against 28,531 on a .docx; 5,939 against 5,425; 16,615 against 15,729). Files were on OneDrive-synced paths; the thread has already ruled OneDrive out and we have nothing contradicting that.

The key looks like the reused stagedPath, not the overwrite as such. In a control run on the same machine on 9 September, nine files were committed across five calls, each from a container path not previously passed to device_commit_files in that session. All nine landed, verified by re-listing and re-staging. Three of the nine were successive overwrites of the same devicePath, from three different staged paths, and all three landed. Every one of our four failures had reused a stagedPath already sent earlier in the session. So repeated overwrites of one destination are fine when the source path is fresh; repeated sends from one source path are what lag. That is consistent with the one-commit-behind shape in the original report and with the double write seen in Process Monitor, and suggests the staged payload is being cached by source path on the container side and served once stale.

Workaround that has held for us since 9 September: a fresh container path for every commit, even for byte-identical content, and verification by listing the destination's size rather than trusting the response or the mtime. With device_bash available, a read-modify-write in place through the shell bypasses the path entirely, as noted above.

Not tested here: whether fileUuid is affected as well as stagedPath, and whether path alone or path plus size is the key.

Showing cached comments. Read the full discussion on GitHub ↗