Getting the chat to add file content without deleting older content in the file

I’m mostly using the latest Claude Sonnet in the chat, but switched it up to GPT 4o only to have it produce the same results.

I’m working on longer project and Claude has made a mess of things, creating redundant files and functions. I created a Project Architecture.xml file so between me (a non-coder) and the LLMs, we can keep track of what’s really happening in the app. I have spent over an hour asking the LLMs to add the information I had them compile regarding the function map across four different files. Even when focusing on one file at a time, Clade and ChatGPT were both unable to simply add the new information without deleting lines from the XML file, often completely unrelated to the content being added (Claude kept trying to delete a to-do section at the bottom, for example). The struggle is layers of this nonsense, of having to remind the LLMs of our chat and context, of watching it jump from functions to screens or hallucinate a request for style sheets or even hallucinate a function not found in the current file. Code implementation in an XML file shouldn’t be this disastrous and I have no idea how to make it easier.

1 Like

Ditto. Probably connected to Cursor now deleting code indiscriminately & loosing context

I have been doing this to address this problem.

Note: if you ever respond with any code from any file, please make sure you respond with the FULL code in the file, not just a partial.

good idea @jonleung . put this in the Rules for AI as well!

we’re releasing a fix for the deletion of files pretty soon, should resolve these problems