claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

[BUG] VS Code Extension; Code Edits Don't Sync

Open Soren-O opened this issue 2 months ago • 5 comments

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?

I use VS code to write and compile my LaTeX documents. The new claude-code extension for VS code works great for this, because Claude really helps with editing LaTeX documents.

However, sometimes after Claude makes edits these don't get applied to the main.tex file. If you try to compile or save the main.tex, the error appears,

"Failed to save 'main.tex': The content of the file is newer. Please compare your version with the file contents or overwrite the content of the file with your changes."

If you try to overwrite, the "overwrite" doesn't actually overwrite the the changes Claude made.

What Should Happen?

Claude should be able to see edits made to main.tex even if the file has not been recompiled since then.

Error Messages/Logs

Failed to save 'main.tex': The content of the file is newer. Please compare your version with the file contents or overwrite the content of the file with your changes.

Steps to Reproduce

Open a LaTeX file with the VS code LaTeX editor. Make some changes to the file, but do not compile or build the project! Claude won't see these changes on Claude's end. Then, when Claude tries to make changes it will be de-synced. If you press "overwrite" this doesn't actually apply Claude's edits (as desired.)

The way to avoid this is to just always remember to compile/build before having Claude make new edits, but this it is inconvenient to recompile after every tiny edit.

Claude Model

Sonnet (default)

Is this a regression?

I don't know

Last Working Version

No response

Claude Code Version

2.0.8 (Claude Code)

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

VS Code integrated terminal

Additional Information

It is pretty easy to reproduce the bug

Soren-O avatar Oct 08 '25 19:10 Soren-O

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/7889
  2. https://github.com/anthropics/claude-code/issues/3513
  3. https://github.com/anthropics/claude-code/issues/5981

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

github-actions[bot] avatar Oct 08 '25 19:10 github-actions[bot]

It's not a great workaround by any means, but you can enable autoSave in vscode and mostly avoid this. They obviously need better integration with the IDE.

TTimo avatar Oct 28 '25 16:10 TTimo

It's not a great workaround by any means, but you can enable autoSave in vscode and mostly avoid this. They obviously need better integration with the IDE.

Ah, thanks!

Soren-O avatar Oct 29 '25 21:10 Soren-O

This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.

github-actions[bot] avatar Dec 09 '25 10:12 github-actions[bot]

The issue is still occuring

Soren-O avatar Dec 09 '25 18:12 Soren-O