I have reproduced the issue on the latest CLI version.
Yes, I am on the latest version
I have searched existing posts and this report is not a duplicate.
Yes, this isn’t a duplicate
In which of these areas are you experiencing a problem?
Theme
Expected behavior
Pushes local version of JSON changes to remote.
Actual behavior
When running shopify theme dev --theme-editor-sync, if a JSON file (like a template or section schema) gets modified by an external process (in my case, manual edits Claude Code), the CLI deletes the file entirely instead of syncing or merging the changes.
Yeah have similar things happen enough times that I just avoid the flag which isn’t a great thing to suggest and the proper thing to do is making an issue here - but it just seems really temperamental.
Love the idea of how it’s supposed to work and when it works - it’s AWESOME. But I haven’t found enough consistency to “trust” it to work.
I was able to recreate this today withbthe verbose flag. I shared the logs with a Shopify Team member where I could reach them directly, as I didn’t want to post something potentially sensitive publicly on here.
I do have these steps about how I recreated the issue.
I tried to pull changes using theme pull in a terminal window, when I forgot I had theme dev running in different window. The dev process deleted a few context json files for no apparent reason. The files did exist remotely on both main and dev.
It removed it in a reconciliation attempt I believe
Happy to help in any way I can with this.
I appreciate the follow up info! So we have two different things going on. One is that while running theme dev we have files sometimes deleting, and then we have the scenario where theme dev is running and we call theme pull. I will be working on fixes for both scenarios.