---
title: "Cursor or Claude Code rewrote files and the app stopped working"
description: "Cursor and Claude Code rewrite many files per turn. How to restore a checkpoint or Git state, get the app starting again, and stop it happening next time."
url: https://whocanfixmyapp.com/problems/cursor-or-claude-code-rewrote-files-app-stopped-working
---

[Home](https://whocanfixmyapp.com/) / [Problems](https://whocanfixmyapp.com/problems) / [AI loops and credits](https://whocanfixmyapp.com/problems#ai-loops-and-credits)

# Cursor or Claude Code rewrote files and the app stopped working

VC-05 · Cursor · Claude Code · Updated October 2026 · By [Nathaniel Kelley](https://whocanfixmyapp.com/authors/nathaniel-kelley)

Quick verdict

Partly fixable yourself. Restore the checkpoint or Git state, then retest.

- **How serious**: High
- **Fix it yourself?**: Partly, some steps need a developer
- **Typical cost**: €99–$990 for a single fix, or $49–$800 one-off check ([prices](https://whocanfixmyapp.com/pricing))
- **Top rated for Cursor**: [Afterbuild Labs](https://whocanfixmyapp.com/companies/afterbuild-labs) · **10.0**/10

**What you see.** After one long Cursor or Claude Code session, the app will not start and dozens of files changed.

## Why it happens

Coding agents edit many files in one turn. Cursor's Agent and Claude Code both read your code, decide what to change, and write the changes without waiting for you to approve each file. A broad prompt such as fix all the errors or clean up the project gives them permission to touch everything. If the agent misreads how two parts connect, it rewrites both, and the app stops starting.

The agents keep safety nets, but they have limits. Cursor saves checkpoints before significant changes and restores files only, not the chat. Claude Code snapshots files before each prompt and keeps the 100 most recent checkpoints per session. Neither tracks files changed by shell commands such as `rm` or `mv`, and neither replaces Git. If you never committed, there may be no clean state to return to.

## Fix it yourself

1. In Cursor, hover over the message before the damage and click **Restore Checkpoint**. Files roll back to that point, the chat stays.
2. In Claude Code, run `/rewind` or press `Esc` twice, pick the prompt before the break, and choose **Restore code**.
3. If the project is in Git, run `git status` and `git diff` to see what changed, then `git checkout -- .` to discard uncommitted edits.
4. Start the app again. If it works, commit right away so the next session has a safe point.
5. Start a fresh chat for the next task. Both vendors advise a new chat when switching tasks, and Claude Code suggests `/clear` after two failed corrections.
6. Next time, use Plan mode first and name the exact files the agent may edit.

## When to get an engineer

Hire when there is no checkpoint or commit to return to, when the agent ran a database command, or when the app starts but behaves differently in ways you cannot test. Send the engineer the repo, the agent chat transcript and the error from the first failed start. A single fix is €99–$990 and takes about 2 days. A one-off check of the whole codebase is $49–$800. See [our Cursor guide](https://whocanfixmyapp.com/guides/cursor) and [Claude Code guide](https://whocanfixmyapp.com/guides/claude-code).

## Top-rated companies for Cursor apps

Ranked by our score: published prices, scope of work, AI tools named, timing and a low-risk first step. [How we score](https://whocanfixmyapp.com/methodology#score).

- 1 · [Afterbuild Labs](https://whocanfixmyapp.com/companies/afterbuild-labs) · **10.0**/10 · Best for: A check before launch · Free first step · from $49
- 2 · [Redlab](https://whocanfixmyapp.com/companies/redlab) · **10.0**/10 · Best for: A full rescue by one team that keeps building · Free first step · from $490
- 3 · [Vibe Code Rescue (Lev Arakelyan)](https://whocanfixmyapp.com/companies/vibe-code-rescue-lev-arakelyan) · **9.0**/10 · Best for: A one-off check and a cleanup · From $299

[All 58 Cursor companies, ranked](https://whocanfixmyapp.com/best/cursor-developers)

## Check these

CODE-01 · High

The code lives in a Git repository you own

Connect GitHub or export the project. If the builder account is lost, the product should not be.

CODE-02 · Medium

The flows that make money have tests

Sign-up, checkout and the core action. A few end-to-end tests catch most regressions from new prompts.

CODE-03 · Medium

Dead code and duplicate components are removed

Search for components with near-identical names. Three versions of one button means three places to fix every bug.

OPS-01 · Critical

Database backups run automatically and a restore has been tested

Check what your database plan actually includes, then restore a backup into a test project once.

## Questions

### Will restoring a checkpoint undo database changes?

No. Checkpoints in Cursor and Claude Code restore files only. A migration or delete that already ran against your database stays. Restore the database from its own backup.

### Why did it change files I never mentioned?

Agents follow imports and fix whatever they think is related. Limit them by naming files in the prompt, using Plan mode, and keeping rules in .cursor/rules or CLAUDE.md.

Sources: [Cursor: Checkpoints](https://cursor.com/docs/agent/chat/checkpoints); [Cursor: Agent troubleshooting](https://cursor.com/help/troubleshooting/agent-issues); [Claude Code: Checkpointing](https://code.claude.com/docs/en/checkpointing); [Claude Code: Best practices](https://code.claude.com/docs/en/best-practices).

**Cursor guide**

What Cursor builds, where it breaks and how to check it: [Cursor and Windsurf apps: when AI-written code needs an engineer](https://whocanfixmyapp.com/guides/cursor).

**Same category**

- [Lovable keeps saying it fixed the bug: how to get out of the loop without burning credits](https://whocanfixmyapp.com/problems/lovable-stuck-in-a-fix-loop)
- [Replit agent stuck in a loop or deleted my data: what to do now](https://whocanfixmyapp.com/problems/replit-agent-stuck-or-lost-data)
- [Bolt keeps breaking what it just fixed](https://whocanfixmyapp.com/problems/bolt-keeps-breaking-what-it-just-fixed)
- [Replit Agent burned my credits and the app still doesn't work](https://whocanfixmyapp.com/problems/replit-agent-burned-credits-nothing-works)
- [The agent ran a migration and my data is gone](https://whocanfixmyapp.com/problems/agent-ran-a-migration-and-my-data-is-gone)
- [My app worked yesterday and I changed nothing](https://whocanfixmyapp.com/problems/app-worked-yesterday-nothing-changed)

[All ai loops and credits problems](https://whocanfixmyapp.com/problems#ai-loops-and-credits)

**Run every check**

The [production checklist](https://whocanfixmyapp.com/checklist) has all 24 checks with a verdict.
