The cursor adds blank lines

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

Without requesting changes in question mode, the cursor adds blank lines, thereby triggering diff in Git.

Steps to Reproduce

Just work in Cursor.

Screenshots / Screen Recordings

Operating System

MacOS

Current Cursor Version (Menu → About Cursor → Copy)

Version: 2.1.6 (Universal)
VSCode Version: 1.105.1
Commit: 92340560ea81cb6168e2027596519d68af6c90a0
Date: 2025-11-20T03:38:22.386Z
Electron: 37.7.0
Chromium: 138.0.7204.251
Node.js: 22.20.0
V8: 13.8.258.32-electron.0
OS: Darwin arm64 25.1.0

Does this stop you from using Cursor

No - Cursor works, but with this issue

3 Likes

Hey, thanks for the report. To understand why Agent is adding blank lines without being asked, I need:

  • Request ID: chat menu (top right) → Copy Request ID
  • What exactly did you ask Agent to do? What was your original request/prompt?
  • Which model is Agent using?
  • Does this happen consistently? Can you reproduce it with a specific type of request?

The Request ID is especially important so the engineering team can see exactly what Agent did. Once you share these details, we can look into it more deeply or escalate it as a bug if Agent is making changes outside the scope of your request.

I’m also seeing this issue. It seems to happen randomly, no relation to what the prompt is. Sometimes it will add the blank line to multiple files that were not in the scope of files that the agent edited.

I’ve also been experiencing this issue for a couple of weeks now. @deanrie In my case it happens only when I open the IDE, and it seems to somehow pick up files from past commits made and add lines at the end. So no Request ID. I rarely use the “Keep all” button, just d the commits directly or ask the model to commit the changes, not sure if it has anything to do with it, just throwing around random stuff.

Hey, thanks for the report. We’re seeing this from a few users. Could you please share:

  1. Request ID from your Agent chat (chat menu top right → Copy Request ID) for when the blank lines were added
  2. Exact prompt you gave to the Agent (what did you ask?)
  3. Does it always happen, or only with certain types of requests?

The detail about it happening on IDE startup is helpful - that might be a different pattern. If this is happening outside of Agent interactions, let us know and we can investigate further.

I’ve been having the same issue and its driving me mad as I can’t see what I’ve changed vs these extra line changes especially when you have done a lot of changes. I thought it was a setting I’d switched on but it happens to seemingly random files. Here’s my summary if it helps:

===============================

CURSOR EOF NORMALIZATION BUG - BUG REPORT FOR CURSOR TEAM

SUMMARY

Cursor IDE (v2.1.39, VSCode 1.105.1, Windows 10.0.26200) is automatically
modifying a fixed set of files on every IDE startup, adding/removing blank
lines at end of file (EOF-only changes). This occurs IMMEDIATELY upon
launching Cursor, before any files are opened or user actions are performed.

CRITICAL CLARIFICATION: This is a STARTUP BUG, not an Agent interaction bug.
The EOF modifications happen OUTSIDE of Agent sessions - they occur when you
open Cursor IDE, not when Agent is editing files. Files that were previously
modified by Agent (for legitimate code changes) become “sticky” and get EOF
normalization applied on every subsequent IDE startup.

===============================

100% CONFIRMED FACTS

  1. TRIGGER: IDE STARTUP (NOT USER ACTION)

    • Confirmed: Modifications occur IMMEDIATELY upon Cursor IDE launch
    • Test: Cleaned working tree → Closed Cursor → Opened Cursor (no files
      opened, no actions) → Closed Cursor → Files appear as modified
    • Result: All affected files show EOF-only changes even though no files
      were opened and no user interaction occurred
    • Conclusion: Bug is in Cursor’s startup/initialization process, not
      triggered by file access or user actions
  2. PATH-BASED, NOT CONTENT-BASED

    • Confirmed: Sticky behavior is tied to FILE PATHS, not file content or
      Git history
    • Test:
      • Created test copy of sticky file with identical content → Test copy
        does NOT become sticky
      • Deleted original sticky file and replaced with fresh file (no sticky
        history) at same path → File STILL becomes sticky
    • Result: Same path = sticky behavior, regardless of content or history
    • Conclusion: Cursor tracks these paths somewhere (not in repo, not in
      deleted cache directories)
  3. FIXED SET OF FILES (NOT RANDOM)

    • Confirmed: Same ~19 files appear as modified every time, not random
      selection
    • Pattern: Files span multiple directories (banking, meters, utilities,
      docs, frontend)
    • Observation: These files were previously modified by Cursor Agent mode
      in prior sessions
    • Conclusion: Bug affects a specific set of file paths, likely those
      previously touched by Agent
  4. EOF-ONLY CHANGES (NO CONTENT MODIFICATIONS)

    • Confirmed: All diffs show only blank lines added/removed at end of file
    • Example diff:
      @@ -161,3 +161,4 @@ export async function deleteInventoryItem(
      where: { id: itemId },
      });
      }
      +
    • Conclusion: Purely whitespace/EOF normalization, no code changes
  5. PERSISTS AFTER ALL STATE DELETIONS

    • Confirmed: Bug persists even after deleting:
      • %APPDATA%\Cursor\User\History\ (file history)
      • %APPDATA%\Cursor\User\workspaceStorage\ (workspace state)
      • %APPDATA%\Cursor\Cache\ (global cache)
      • %APPDATA%\Code* (VS Code shared cache)
      • .cursor/ and .vscode/ (per-repo IDE state)
    • Result: Files still appear as modified after all state deletions
    • Conclusion: State is stored elsewhere (Registry, installation directory,
      or reconstructed on startup)
  6. NOT CONFIGURATION-RELATED

    • Confirmed: All configurations are aligned:
      • .gitattributes: * text eol=lf
      • .editorconfig: end_of_line = lf, insert_final_newline = true
      • Workspace: files.eol = “\n”
      • Git: core.autocrlf = false
    • Test: Ran “git add --renormalize .” and committed → Issue persists
    • Conclusion: Not a Git or EditorConfig normalization issue
  7. NOT EXTENSION-RELATED

    • Confirmed: Bug persists with ALL EXTENSIONS DISABLED
    • Test: Disabled all Cursor extensions → Restarted IDE → Files still
      modified
    • Conclusion: Bug is in Cursor core, not extension behavior
  8. NOT NETWORK-RELATED

    • Confirmed: Bug occurs when COMPLETELY OFFLINE (Wi-Fi disabled)
    • Test: Disabled Wi-Fi → Cleaned repo → Opened Cursor → Files modified
    • Conclusion: Not caused by GitHub auto-fetch/pull or remote
      synchronization
  9. FRESH INSTALL TEMPORARILY FIXED, THEN RETURNED

    • Confirmed: Full uninstall/reinstall (including all app data deletion)
      TEMPORARILY RESOLVED the issue
    • Observation: Bug returned after some time (possibly after Agent mode was
      used again)
    • Conclusion: Bug is reproducible and returns when conditions are met
      (likely Agent-modified files)

===============================

CURRENT BEHAVIOR (DECEMBER 2025)

After a fresh install that temporarily fixed the issue, the bug has returned.
The same pattern:

  • Fixed set of files (now 4 inventory service files)
  • EOF-only changes (blank lines added)
  • Occurs on IDE startup
  • Files were recently modified by Cursor Agent mode

===============================

AFFECTED FILES (CURRENT INSTANCE)

backend/src/services/inventory/inventory-items.service.ts
backend/src/services/inventory/inventory-pdf.service.ts
backend/src/services/inventory/inventory-photos.service.ts
backend/src/services/inventory/inventory-rooms.service.ts

===============================

EXAMPLE DIFF

diff --git a/backend/src/services/inventory/inventory-items.service.ts
b/backend/src/services/inventory/inventory-items.service.ts
index 2ab81c81..5ffa3cbc 100644
— a/backend/src/services/inventory/inventory-items.service.ts
+++ b/backend/src/services/inventory/inventory-items.service.ts
@@ -161,3 +161,4 @@ export async function deleteInventoryItem(
where: { id: itemId },
});
}
+

===============================

SYSTEM INFORMATION

OS: Windows 11 (10.0.26200)
Cursor Version: 2.1.39
VSCode Version: 1.105.1
Shell: PowerShell 7
Git Config: core.autocrlf = false
Repository: Private repo with .gitattributes and .editorconfig configured

===============================

HYPOTHESIS FOR CURSOR TEAM

Based on all tests, the bug appears to be:

  1. PATH-BASED TRACKING: Cursor stores a list of file paths (likely those
    modified by Agent) somewhere persistent

  2. STARTUP NORMALIZATION: During workspace initialization, Cursor applies
    EOF normalization to these tracked paths

  3. STORAGE LOCATION: Not in standard cache directories (History,
    workspaceStorage, global cache) - possibly:

    • Windows Registry
    • Installation directory embedded database
    • Reconstructed from Git history analysis
    • File system metadata

===============================

ANSWERS TO CURSOR TEAM QUESTIONS

Q: Request ID from Agent chat when blank lines were added?
A: CANNOT PROVIDE - The blank lines are NOT added during Agent interactions.
They are added on IDE STARTUP, after Agent sessions have ended. The files
were previously modified by Agent (for actual code changes), but the EOF
modifications happen later when opening Cursor IDE, not during the Agent
session itself.

Q: Exact prompt given to Agent?
A: CANNOT PROVIDE SPECIFIC PROMPT - The EOF changes do not occur during Agent
interactions. The files (inventory service files) were modified by Agent
for legitimate code changes (creating CRUD functions), but the blank line
additions happen separately on IDE startup, not as part of the Agent’s
response to any prompt.

Q: Does it always happen, or only with certain types of requests?
A: IT ALWAYS HAPPENS ON IDE STARTUP - The bug is not tied to specific Agent
requests. Once files have been modified by Agent (for any reason), they
become “sticky” and will show EOF-only changes on EVERY subsequent IDE
startup, regardless of what the Agent was asked to do originally.

Q: Is this happening outside of Agent interactions?
A: YES - THIS IS THE KEY POINT. The EOF modifications happen:

  • OUTSIDE of Agent interactions
  • On IDE startup/initialization
  • Before any files are opened
  • Before any user actions
  • Even when Agent mode is not being used

The pattern is:

  1. Agent modifies files (for legitimate code changes) → Files work fine
  2. User closes Cursor IDE
  3. User reopens Cursor IDE
  4. On startup, Cursor automatically adds/removes blank lines at EOF
  5. Files appear as modified in Git, even though no code was changed

This is a STARTUP BUG, not an Agent interaction bug. Agent modifies files
correctly, but Cursor’s startup process then incorrectly normalizes the EOF
of those files on every launch.

===============================

Last Updated: December 2025
Status: Bug returned after fresh install

2 Likes

I have been getting this behaviour for weeks, possibly months. It’s a huge time-waster and risk, since it fills git diffs with irrelevant entries (and bulk-revert could lose prior changes that are still needed.) Thanks for the detailed analysis. Hope the team act on this quickly.

1 Like

I have been getting this behavior on the same file for over a week now. Every time I use the cursor agent, it adds a blank line at the end of the same file.

same, when i re-open cursor i get the same files with end of line added, i turned this off in my user settings, and its the same files so its a huge pain.

I have the same issue.

Same this [every] morning!!!

This is very annoying :slight_smile: I have this issue too.

Getting exactly this. Super frustrating.

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

When opening or reloading the IDE, there’s always an automatic file change — specifically, a new newline is added at the end of the files.

First reload: 1 new line is added automatically
Second reload: 2 new line is added automatically

and so on

Steps to Reproduce

open cursor or reload window

Expected Behavior

no auto new newline

Screenshots / Screen Recordings

Operating System

MacOS

Current Cursor Version (Menu → About Cursor → Copy)

Version: 2.2.12 (Universal)
VSCode Version: 1.105.1
Commit: 4395cbb45916e730692e72c853b893578fbb0110
Date: 2025-12-11T00:22:45.078Z
Electron: 37.7.0
Chromium: 138.0.7204.251
Node.js: 22.20.0
V8: 13.8.258.32-electron.0
OS: Darwin x64 24.6.0

Does this stop you from using Cursor

No - Cursor works, but with this issue

  1. Deleting prettier config (.prettierrc) and the bug is still there
  2. Vscode doesn’t have this bug
  3. disable all extensions and the bug is still there
  1. This is not AI Related.
  2. It adds that blank line to all files you worked on previous commits.
  3. I have a theory that is happening when you have the same folders or repos on multiple workspaces.

Same problem here.

Even without another workspaces, it continues adding blank lines when the cursor starts.

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

Opening the project or semtimes also after letting the agent implement something the git ui shows that there are changes in the files that were edited in my last session even though i did not change a thing. looking at the changes there are newlines at the end of files or blocks where the last agent made changes.
this is really annoying as it makes it hard to check the real changes the agent made

Steps to Reproduce

Open a recently used project, implement a feature via chat

Screenshots / Screen Recordings

Operating System

MacOS

Current Cursor Version (Menu → About Cursor → Copy)

Version: 2.2.20
VSCode Version: 1.105.1
Commit: b3573281c4775bfc6bba466bf6563d3d498d1070
Date: 2025-12-12T06:29:26.017Z
Electron: 37.7.0
Chromium: 138.0.7204.251
Node.js: 22.20.0
V8: 13.8.258.32-electron.0
OS: Darwin arm64 25.0.0

Does this stop you from using Cursor

Sometimes - I can sometimes use Cursor

I’ve been running into the same issue for weeks. Today I found a workaround that might help you as well.

If you open the affected files in the Source Control tab, you’ll notice that the entire file is marked as changed (highlighted in green). There’s a “Keep (⌘Y)” button available. Click it, then remove the extra line that was introduced. Once you do that, the file disappears from the list of changed files.

After restarting the IDE, the issue no longer occurs for that file.

My suspicion is that this happens when the agent generates changes but they aren’t explicitly accepted.

5 Likes

Happening here as well. Any time I open cursor, files randomly have new lines added. Often randomly between commits to. As if when cursor reads a file, maybe it adds a new line in the process.