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
-
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
-
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)
-
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
-
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
-
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)
-
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
-
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
-
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
-
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:
-
PATH-BASED TRACKING: Cursor stores a list of file paths (likely those
modified by Agent) somewhere persistent
-
STARTUP NORMALIZATION: During workspace initialization, Cursor applies
EOF normalization to these tracked paths
-
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:
- Agent modifies files (for legitimate code changes) → Files work fine
- User closes Cursor IDE
- User reopens Cursor IDE
- On startup, Cursor automatically adds/removes blank lines at EOF
- 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