claude-code - 💡(How to fix) Fix [BUG] Cowork Edit tool silently fails to save changes to Obsidian vault files (Cowork desktop app) [1 comments, 2 participants]

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…
GitHub stats
anthropics/claude-code#52493Fetched 2026-04-24 06:05:43
View on GitHub
Comments
1
Participants
2
Timeline
7
Reactions
0
Author
Timeline (top)
labeled ×6commented ×1

This bug is in Cowork mode of the Claude desktop app (not the Claude Code CLI). The Cowork file tools (Edit, Read, Write) use the same Claude Code platform.

Error Message

In Cowork, the Edit tool reports successful edits for markdown files in an Obsidian vault, but changes do NOT actually persist to disk. Edits appear in Claude's virtual view for the remainder of the session but are reverted by external synchronization (likely Obsidian sync or OneDrive). The Write tool on new files works correctly. No error is surfaced.

  • After Edit, verify that new_string is present in the file and surface failure as an error instead of silent success, OR
  • Detect "file belongs to sync-active directory" (e.g., .obsidian/, .dropbox/, OneDrive marker) and warn user/Claude at session start.

Error Messages/Logs

No error is surfaced. Claude sees the edited version in subsequent Read operations within the same session (virtual view stays), but external bash sees the reverted version.

  1. Critical: Verify-after-write on Edit tool. Re-read the file after Edit reports success; check new_string is present; surface failure as an error.
  2. Important: Detect sync-active vault (presence of .obsidian/, .git/, OneDrive markers) and warn Claude or user at session start.

Root Cause

This bug is in Cowork mode of the Claude desktop app (not the Claude Code CLI). The Cowork file tools (Edit, Read, Write) use the same Claude Code platform.

Fix Action

Fix / Workaround

Detailed reproduction, environment, workaround, and recommendations in Skill/anthropic_bug_report_2026-04-23.md in the affected vault (~8KB). Available on request from the reporting user.

The reporting user maintains Skill/anthropic_bug_report_2026-04-23.md (~8KB, markdown) in the affected vault with the complete reproduction, environment, workaround, and recommended fixes. Available on request.

Key workaround (confirmed)

Code Example

No errors, no warnings. The core of the bug — Edit reports success silently while changes are reverted by external sync.

Verification via Cowork workspace bash after Edit:


$ wc -l /sessions/.../mnt/ewa/Skill/Журнал решений.md
282 lines

$ grep -c "РЕГРЕССИЯ СОХРАНЕНИЯ" /sessions/.../mnt/ewa/Skill/Журнал решений.md
0

$ grep -c "blind_v5_4.11" /sessions/.../mnt/ewa/Skill/Журнал решений.md
0


During the session, bash append via `cat addendum >> journal` showed content added — file grew from 221 to 282 lines. Yet `grep` for just-appended content returns 0 — content reverted by external sync within seconds.

Affected user's mod-time comparison on the same day shows `План.md` (Write-created) and `Журнал решений.md` (Edit-targeted) modified at different times, with Journal modifications visible at one moment then absent from grep the next — consistent with external sync overwrite race.
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?

Context

This bug is in Cowork mode of the Claude desktop app (not the Claude Code CLI). The Cowork file tools (Edit, Read, Write) use the same Claude Code platform.

Problem

In Cowork, the Edit tool reports successful edits for markdown files in an Obsidian vault, but changes do NOT actually persist to disk. Edits appear in Claude's virtual view for the remainder of the session but are reverted by external synchronization (likely Obsidian sync or OneDrive). The Write tool on new files works correctly. No error is surfaced.

Scope of data loss (this user)

  • Skill/Журнал решений.md (project decision log) — ~30 entries (records 49-74) written across previous sessions were silently lost. Physical file contains only records 1-48 plus fragment of 61.
  • Skill/Текущий статус.md — edits this session (strengthened opening-ritual + "Evening 2026-04-23" log) not saved.
  • Skill/Роли диспача.md — new section "Role labels in responses" not saved.
  • книги/rules/R-NC-01.md — confidence markers expected in v2 not present.

Pattern

  • Edit fails silently on pre-existing files under active Obsidian/OneDrive sync.
  • Write on newly-created files works (sync does not revert unknown files).
  • bash grep after Edit reveals content reverted within seconds.

Full report

Detailed reproduction, environment, workaround, and recommendations in Skill/anthropic_bug_report_2026-04-23.md in the affected vault (~8KB). Available on request from the reporting user.

Severity: High

Silent data loss is the worst failure mode. Users who don't manually verify every Edit through external tools (bash grep) will not detect it until they lose hours of work.

What Should Happen?

Edit tool should save changes durably to disk. Changes should persist across session boundaries and external sync events.

If external sync interferes, the tool should do one of:

  • Use atomic-write semantics that sync cannot revert, OR
  • After Edit, verify that new_string is present in the file and surface failure as an error instead of silent success, OR
  • Detect "file belongs to sync-active directory" (e.g., .obsidian/, .dropbox/, OneDrive marker) and warn user/Claude at session start.

At minimum: fail loudly, not silently.

Error Messages/Logs

No errors, no warnings. The core of the bug — Edit reports success silently while changes are reverted by external sync.

Verification via Cowork workspace bash after Edit:


$ wc -l /sessions/.../mnt/ewa/Skill/Журнал решений.md
282 lines

$ grep -c "РЕГРЕССИЯ СОХРАНЕНИЯ" /sessions/.../mnt/ewa/Skill/Журнал решений.md
0

$ grep -c "blind_v5_4.11" /sessions/.../mnt/ewa/Skill/Журнал решений.md
0


During the session, bash append via `cat addendum >> journal` showed content added — file grew from 221 to 282 lines. Yet `grep` for just-appended content returns 0 — content reverted by external sync within seconds.

Affected user's mod-time comparison on the same day shows `План.md` (Write-created) and `Журнал решений.md` (Edit-targeted) modified at different times, with Journal modifications visible at one moment then absent from grep the next — consistent with external sync overwrite race.

Steps to Reproduce

  1. Open Cowork in Claude desktop app on Windows 11.
  2. Select a folder on disk that is an Obsidian vault with active Obsidian sync (e.g., C:\Obsidian\<vault>\). The vault may also be in a OneDrive-synced path (possibly contributing).
  3. Ask Claude to use Edit tool on an existing markdown file in the vault (200+ lines), e.g., add a new paragraph between existing lines of a decision log.
  4. Edit tool returns "The file has been updated successfully".
  5. Immediately use the workspace bash to verify: grep "<new text>" /path/to/file — new text is found (virtual view still matches).
  6. Wait 10-60 seconds, or do any subsequent task.
  7. Re-run grep on the same <new text>new text is gone, file reverted to pre-edit state.

No error is surfaced. Claude sees the edited version in subsequent Read operations within the same session (virtual view stays), but external bash sees the reverted version.

Simpler repro from a fresh session: open a fresh Cowork window, point to the same vault, bash cat the file — the Edit'd content from the prior session is gone.

Claude Model

None

Is this a regression?

I don't know

Last Working Version

No response

Claude Code Version

Cowork desktop app (not Claude Code CLI). Model: Claude Opus 4.7. Version of CLI not applicable — Cowork-specific deployment.

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

Windows Terminal

Additional Information

Full technical report (in vault)

The reporting user maintains Skill/anthropic_bug_report_2026-04-23.md (~8KB, markdown) in the affected vault with the complete reproduction, environment, workaround, and recommended fixes. Available on request.

Key workaround (confirmed)

  1. Use Write tool (full file overwrite) instead of Edit (partial patch) where possible.
  2. For large files where Write is impractical, create new companion files (<name>_addendum.md, <name>_дополнение.md) — external sync does not revert unknown files.
  3. Verify every edit with bash grep immediately after; do not trust the "Edit successful" message.

Recommended fix priority

  1. Critical: Verify-after-write on Edit tool. Re-read the file after Edit reports success; check new_string is present; surface failure as an error.
  2. Important: Detect sync-active vault (presence of .obsidian/, .git/, OneDrive markers) and warn Claude or user at session start.
  3. Nice to have: Transactional edit queue that bypasses continuous sync race.

Environment specifics

  • OS: Windows 11 Pro (dropdown above set to macOS as that was the default — please read as Windows 11)
  • Browser/app: Cowork in Claude desktop app
  • Vault: Obsidian vault at C:\Obsidian\<name>\ with Obsidian sync active (possibly also within OneDrive-synced tree)
  • Session model: Claude Opus 4.7
  • Terminal: Cowork's own workspace-bash (not an external terminal)

Note on form fields

This Bug Report template is oriented toward Claude Code CLI. The "Claude Code Version", "Platform", "Operating System", and "Terminal/Shell" fields map imperfectly to Cowork's desktop-app context. Please interpret them accordingly.

Affected user

The user can provide a vault snapshot or session transcript (subject to privacy) for diagnosis. Please reach out via this issue.

extent analysis

TL;DR

The most likely fix is to implement a verify-after-write mechanism on the Edit tool to check if the changes are persisted to disk before reporting success.

Guidance

  • The issue seems to be related to the Edit tool not handling external sync correctly, causing changes to be reverted silently.
  • To mitigate this, using the Write tool (full file overwrite) instead of Edit (partial patch) can help, especially for large files where Write is impractical.
  • Creating new companion files for edits can also help, as external sync does not revert unknown files.
  • Implementing a verify-after-write mechanism on the Edit tool can help detect and surface failures instead of reporting silent success.

Example

No specific code example can be provided without more context on the implementation details of the Edit tool and the external sync mechanism.

Notes

The provided information suggests that the issue is specific to the Cowork mode of the Claude desktop app and the Obsidian vault with active Obsidian sync. The exact technical details of the implementation may be necessary to provide a more comprehensive solution.

Recommendation

Apply a workaround by using the Write tool or creating new companion files for edits until a more permanent fix can be implemented, such as verifying changes after write on the Edit tool. This is because silent data loss is a critical issue that needs immediate attention, and a verify-after-write mechanism can help prevent such losses.

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