Cursor reformats code formatted by hook after accepting changes

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

I made a hook that runs a formatter with the event afterFileEdit and it runs after Cursor changes something in a file. I made this hook since Cursor was not respecting my Biome config because I’m not opening my project folder directly but the parent folder instead.

I started to chat with Cursor and it worked great. The hook was formatting everything as it should. Then I clicked Accept All when I finished chatting and boom, Cursor formatted everything again with the wrong config.

I don’t mind that Cursor reformated again. The problem is that the afterFileEdit hook does not run after the Accept All formatter.

Steps to Reproduce

1 - Make hook that formats code with afterFileEdit
2 - Chat with Cursor
3 - Accept changes
4 - See that Cursor runs its own formatter that breaks for hook’s format

Expected Behavior

I expect the afterFileEdit to run at the very end of every other edition so its effects are not overwritten

Operating System

MacOS

Current Cursor Version (Menu → About Cursor → Copy)

Version: 2.3.41
VSCode Version: 1.105.1
Commit: 2ca326e0d1ce10956aea33d54c0e2d8c13c58a30
Date: 2026-01-16T19:14:00.150Z
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.2.0

Does this stop you from using Cursor

No - Cursor works, but with this issue

Hey @pprg1996!

You’re right that afterFileEdit doesn’t apply on accepting all (it’s an interesting idea for a hook though! Something like afterAccept). It only runs when agents edit files. I’ve passed that along to the team working on hooks!

Are you only working in this one folder? In that case, it might make sense to directly point Cursor (via .vscode/settings.json) to your configuration and forgo the hook entirely.

{
   "biome.configPath": "./your-project/biome.json"
 }

I ended up making a multiroot workspace so now Cursor respects the project’s config (and all the other sibling projects too). Sadly by having a multiroot workspace I don’t have a root where to have hooks, rules, skills, etc

1 Like

This topic was automatically closed 22 days after the last reply. New replies are no longer allowed.