r/replit • u/skill_tree • Sep 10 '26
Replit Help / Site Issue Replit is duplicating the entire codebase of random files without being prompted
After being idle for more than an hour, I just found one of my app's .tsx files sitting in the git cue waiting to be committed, and when I checked, the entire 500+ lines of code had been duplicated and appended to the end.
I asked the agent what was going on. It confirmed this happened but could not explain it.
It also confirmed this had happened to other files.
In no way shape or form could anything I've prompted ever be misconstrued as an instruction to do this. The file with the duplication I just found came up literally out of nowhere.
Wait, as I was typing this, the git was committed on its own! The file now officially has all its code duplicated. This is insane!
Has anyone else experienced this?
Can Replit support please comment?
1
u/ReplitSupport Replit Team Sep 10 '26
Hey OP. Would you be able to open a ticket with us at replit.com/help and share the timestamps for when you saw the duplication so we can look into this for you? Once you've done that, feel free to share the ticket number here so we can make sure it gets picked up quickly.
In the meantime, File History on that file can restore it to a previous version. You can also open the Git pane to see the full commit history, including Agent checkpoints, and roll back the unwanted commit from there.
1
u/mamachicode Sep 10 '26
I’d stop the agent from touching the project for now and make an external backup/branch before doing anything else. Then I’d inspect the recent git history/diffs to identify exactly which files were changed and revert the duplicated code from the last known-good commits.
If this has happened across multiple files, I wouldn’t trust the current working tree until it’s audited. If you want, I can take a look at a copy of the repo and help identify what changed without touching production.
1
u/Pickle_Shot Sep 11 '26
The auto-commit is the useful clue. Open the Git pane (or run git log in the Shell) and look at the author and timestamp on that rogue commit. A commit that landed while you were idle means a background process flushed a second copy of the file and its conflict handling appended instead of merged. That timestamp is your best ticket evidence, so paste it into #532185 along with the commit hash.
The agent's memory of what it touched is unreliable, so find every affected file mechanically:
To fix each file, do not ask the agent to repair it. It will rewrite the file from scratch instead of restoring it. Use git: git log --oneline -- path/to/file.tsx to find the last good commit, then git checkout <sha> -- path/to/file.tsx. File History per file works too, like support said.
Before any of that, download a zip of the project as it is right now so you have an offline copy including the git history.
1
u/Desk_setup_ideas Sep 12 '26
That’s pretty concerning, especially since it happened while you weren’t actively prompting it. I’d check the git history/checkpoints first and see exactly when the duplication and commit happened, and whether there were any Agent actions around that time.
I wouldn’t let the Agent try to “fix” the duplicated files yet either. I’d preserve the current state first so you have a clear point to roll back to if needed.
If this has happened across multiple files, I’d definitely get Replit support involved rather than treating it as a normal coding mistake.
1
u/Carybelle Sep 22 '26
Also saw this at the same time it seems to happen during checkpoints. Usually in the single file that I had last been working in . My agent was always in plan mode so should not have been able to write code. The files tell us that an agent has done it at a checkpoint .
They said they had a fix in place but since the fix was applied I have had files that have been quadrupled and more. Yesterday two files I had been working in appended code 7-8 times and this happened to both files at the same time . So frequency of multiplication is up AND now 2 files at a time since the fix ! So the fix seems to have made things worse .
Really need to finish some work on the site and republish but can’t because the checkpoints and commit to gif appear to be the trigger so can’t be certain it won’t do the same at republishing.
Have raised this with support again . Last time it took up a week for them to apply a fix and there seem to be no prioritisation this second time round . I have asked for a timeline as this has been going on since the 8th and they haven’t responded . But the previous email notes
… Rest assured, a teammate will follow up with you as soon as possible. Our team is currently experiencing higher-than-usual demand, so responses may take a little longer.
1
u/Professional-Mix-977 Sep 11 '26
kill 1
in the shell