Skip to content

// Guide

My Cursor App Is Broken. Here Is the Actual Fix.

Tim Sullivan · Sonder, Kyneton · 10 July 2026 · Reviewed 7 October 2026

You let Cursor's Agent mode loose on a feature, it touched twelve files across three directories, and now something that was working yesterday has stopped. Or your build passes but production throws a runtime error about a function that does not exist. Or three months of daily prompting has left you with a codebase nobody, including you, fully understands anymore.

Cursor breaks differently from browser-based tools like Bolt or Lovable. It edits your real local files directly, which means the breaks are real too. But it also means you have something those tools often lack: a git history that tells you exactly what changed and when. Here is how to read what went wrong, what you can safely undo yourself, and when the accumulated drift is deep enough that a proper audit is the faster path.

Cursor app not opening at all? Two different problems

"Cursor app not opening" means two very different things, so split it before you try to fix it.

  • The Cursor editor itself will not launch: a blank window, a splash screen that hangs, or nothing at all. That is an install problem, not a code problem. Fully quit and relaunch first. If it persists, clear Cursor's application cache, disable GPU acceleration if the window opens black, check your antivirus has not quarantined it, and reinstall as the last resort. Your settings and projects survive a reinstall.
  • The app you built with Cursor will not start. That is a code or environment problem, and the terminal will tell you why: a missing dependency after a session that touched package.json, a port already in use, or a Node version mismatch. Read the first error in the stack, not the last one, and feed that exact line back to the model or into the checks below.

The rest of this guide covers the second case, because that is the one that gets worse the longer you prompt at it.

Why Cursor breaks differently from other AI tools

Cursor agents can read and edit repository files and run tools, subject to current guardrails and run settings. Review changes and permissions before using them against live services. Different builders have different environment and publishing behaviour; none removes the need for release checks.

An agent may help with an isolated, reproducible bug. Keep the change small and verify it against a saved baseline. Repeated unsuccessful patches are a reason to investigate the logs, dependencies and access controls, not proof of a specific context-window failure.

Check the actual Git status and history rather than assuming the agent committed or did not commit. Agents can run terminal tools subject to permissions. Preserve uncommitted changes before switching or restoring project states.

Diagnose it: six symptoms, six causes

Use this table to identify possible causes and useful checks. Symptoms can have more than one cause; confirm the diagnosis with logs and a reproducible example.

Common Cursor app failures after Agent sessions, possible causes, and whether they are self-fixable.
Symptom Possible cause to investigate Can you fix it yourself?
App throws errors after an Agent session that touched many files Incomplete instructions, incompatible edits, missing dependencies or stale assumptions can cause regressions. Session length alone does not diagnose the cause. Preserve the current state, read the logs and compare the last changes against the previously working version before making another patch. Often, if you have git. Run git diff HEAD~1 to see exactly what changed in the last commit. Narrowing the problem to a specific file makes it fixable.
Runtime error about a function or method that does not exist Possible cause: Agent hallucinated an API call. It referenced a method that does not exist in the library version you are running, or invented a function name that sounds like something the library should have but does not. Yes. Search the error message, find the call in your code, check the library's actual documentation for what exists, and replace the hallucinated call with the real one.
Something stopped working but you do not know what changed Possible cause: Hours of Agent work accumulated without commits. The working tree diverged from the last known-good state, but there is no record of the intermediate steps. Preserve current work first. Use the diff and logs to identify a candidate regression, then test a targeted revert on a separate branch. Do not discard unrelated changes.
A .env file or API key appeared in a git commit Possible cause: Agent added or restructured files without checking that .env is excluded in .gitignore, or generated a new secrets file in a location that is not excluded. If an actual secret was exposed, rotate it and review its use. History cleanup needs a coordinated recovery plan because it can affect other clones. Removing a file from the latest version does not revoke a credential.
Logic is duplicated across multiple files and both versions are now active Possible cause: Agent solved the same problem twice in different places, or partially refactored something and left the old version running alongside the new one. Both are being called, and they conflict. Sometimes. If the duplication is in a single feature area, you can trace the call paths and remove one version. If it is across the whole codebase, you need to understand the full data flow before touching it.
App builds but behaves differently in production than locally Possible cause: Secrets or configuration values in your local .env were never added to your deployment platform. Your local app runs against real services; your deployed app is missing the connection strings to reach them. Compare the requirements of the published app with its configured environment. Add only the intended production credentials and settings, then test a controlled change.

The two-hour rule

If repeated attempts are not resolving the same error, pause new changes. Save the current state and identify a known working version. Inspect what changed before deciding whether to revert, repair or seek help.

Incomplete instructions, incompatible edits, missing dependencies or stale assumptions can cause regressions. Session length alone does not diagnose the cause. Preserve the current state, read the logs and compare the last changes against the previously working version before making another patch.

Starting a fresh Agent session with a narrower, more specific prompt consistently outperforms continuing an exhausted session. Scope the task to one file or one concern. Let it finish. Commit. Then open the next session.

The five-minute triage you can do yourself right now

Before you pay anyone, run these five checks. They use tools you already have, they cost nothing, and they tell you exactly how serious the situation is.

  1. Check what is uncommitted. Run git status in the project directory. If you see a large list of modified files with no recent commits, that is your immediate problem: hours of Agent work with no checkpoint. Do not run git checkout . yet. First take stock of what is there.
  2. Check what the last few sessions actually changed. Run git log --oneline -10 to see the recent commit history, then git show --stat HEAD to see which files the most recent commit touched. If one commit changed thirty files, that session's diff is where to start looking.
  3. Verify your .gitignore excludes .env. Run cat .gitignore | grep -i env. If nothing appears, run git log --all --full-history -- .env immediately to check whether the file was ever committed. If it was, treat every secret in it as already compromised and rotate those keys now, before fixing anything else.
  4. Roll back to the last known-good commit and test. Find a commit from before the problem with git log, run git stash on your uncommitted changes, then git checkout <commit-hash> to test that the issue actually started in a specific session. This tells you the blast radius before you start fixing.
  5. Match your local .env against your deployment environment. Open your deployment dashboard and compare it against your local .env line by line. Anything present locally but absent in production is a likely source of "works on my machine" failures.

If checks one through three came back clean, you are likely dealing with an isolated Agent context problem in a specific session. If check three found secrets in git history, that is urgent and the order of operations is not optional: rotate keys first, then fix the codebase.

When git revert is not enough

A git revert or git reset is the right move when the problem lives in one session's changes. It is not the right move when the problem is in the architecture that months of prompting built. These are the situations where reverting leaves you back at a codebase that was already broken in ways you did not fully see:

  • Authentication grafted on rather than designed in. Auth added as an afterthought tends to protect some routes and miss others, with no consistent pattern an audit can validate quickly.
  • Unverified database access controls. Browser access using a publishable key can be appropriate when grants and RLS policies enforce the intended permissions. Enabled RLS with no policies normally denies API access through that key. Check actual grants, policies and any privileged-key usage with authorised test records before diagnosing exposure.
  • Dependency drift. Three months of "upgrade this package when it breaks" leaves a codebase with mixed major versions, deprecated APIs still in use, and security advisories that nobody reviewed.
  • No tests, no CI. Without a test suite, every Agent session is a trust exercise. Without CI, the only environment where "it works" has ever been verified is your laptop.

If any of these apply, you are in rescue territory rather than patch territory. Not sure if you have a security problem or an architecture problem? Our vibe-code security checklist helps you separate the two. Read our vibe code rescue service page for how we approach the rescue. Built with a different tool? The same patterns apply to Bolt, Lovable, v0, Replit, and Windsurf apps.

What a rescue actually costs

There is no verified market-price dataset behind this guide. Request an audit-based quote that separates investigation, urgent security work, repair, testing, deployment and ongoing support. The tool used to build the app does not determine the price.

What actually moves the cost is the state of the codebase when you arrive. No test suite means the audit starts from zero with no safety net. Secrets in git history mean a rotation exercise across every connected service before the code work begins. No CI means every change after the rescue goes out on faith.

Compare the proposed investigation, security checks, test coverage and handover rather than the supplier's location or job title. A low quote may exclude important work, while a high quote does not establish quality. Ask each supplier to explain its assumptions and exclusions.

What a professional rescue actually does

The order matters. Building features on a broken foundation breaks the features. A proper rescue runs in this sequence:

  1. We start with an agreed investigation scope and written findings. Further issues may emerge during repair, and any change in scope needs a separate decision.
  2. Secrets rotated and moved to the correct layer. Any key that belongs server-side is moved server-side. Any key that was committed to git history is rotated and scrubbed.
  3. Row Level Security and server-side auth. Data policies written for your actual schema, not assumed. Authentication enforced at the server and database layer, not just the frontend route guard.
  4. Dependency audit and update. Every package reviewed for active security advisories, major version mismatches addressed in a controlled upgrade rather than letting the next Agent session handle it.
  5. Tests and CI. Check critical paths on proposed changes so covered regressions can be caught before release. Tests reduce risk within their coverage; they do not guarantee that every bug or production issue will be detected.
  6. Staged deployment. A preview environment that mirrors production. "Works on my machine" stops being the only verification available.
  7. Then your feature list. Deliberately last. On ground that can hold it.

This is the approach we take on our vibe code rescue service, which covers apps built with Cursor, Bolt, Lovable, v0, Replit, Windsurf, and similar tools. Built with a different AI tool? Bolt, Lovable, v0, Replit, and Windsurf each have their own guide.

Frequently asked questions

Can Cursor Agent mode fix its own broken code?

An agent may help with an isolated, reproducible bug. Save a baseline, describe the actual error, keep changes narrow and verify the result. Repeated unsuccessful patches call for investigating logs and dependencies; a fixed session duration does not diagnose the cause or guarantee a better repair.

Should I revert to a working commit or keep patching with Cursor?

Consider reverting a confirmed regression after preserving current changes and identifying a known working commit. Test it on a separate branch or preview; code recovery does not automatically restore databases or external service state.

Does Cursor Agent mode commit my changes to git automatically?

Cursor agents can run terminal tools subject to permissions and run settings. Whether a commit exists depends on what actually happened in your project. Inspect Git status, history and checkpoints, and save changes before attempting recovery.

When do I need a professional rescue versus just using git revert?

A git revert is the right move when the problem is in one session's changes. A professional rescue is the right move when the problem is months of accumulated drift: dependencies that crept past major versions, authentication that was grafted on rather than designed in, database queries that bypass Row Level Security policies, or an architecture that has been patched so many times that nobody fully understands how the pieces connect. Git shows you the history; a rescue fixes what the history built.

Primary guidance checked 7 October 2026: OWASP authorisation guidance; Supabase row-level security; Cursor agent security. Platform documentation explains capabilities; it does not verify this project or establish a rescue price, timeline or commercial result.

// Start the rescue

Sonder rescues broken Cursor apps.

Based in Kyneton, serving Australian businesses. We start with an agreed investigation scope and written findings, then quote the repair and release checks. Findings may reveal further work that needs a separate decision.

Tell us the problem and the deadline so we can confirm availability and the next step.