[BUG] VS Code Extension; Code Edits Don't Sync
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
Found 3 possible duplicate issues:
- https://github.com/anthropics/claude-code/issues/7889
- https://github.com/anthropics/claude-code/issues/3513
- 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
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.
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!
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.
The issue is still occuring