You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Run formatters only on session end instead of after tool call #2535
Now formatters confuse the LLM too much. Running formatting on session end would give most of the benefits without penalizing tool calls success rate in the same message
I mean formatting the file on read operations. this way the LLM will probably use same conventions, there is less risk of big changes after formatting. code outside of the replaced snippet is guaranteed to be formatted
No, I currently use mainly Claude Code and try sometimes Opencode. I use both at the same time, so I have a lot of unformatted files
I have non formatted files for a lot of reasons. I just don't format on save. I think that's the majority of users. Now i disabled all LSP and formatters, that should be the default imo
Activity
github-actions commentedon Sep 10, 2025
This issue might be a duplicate of existing issues. Please check:
Feel free to ignore if none of these address your specific case.
remorses commentedon Sep 11, 2025
Another way to mostly solve this: format files on read tool calls before returning them to the model.
rekram1-node commentedon Sep 11, 2025
@remorses I think that is kinda existing behavior tho no?
LLM reads file
LLM edits file
formatter runs
LLM tries to edit file
LLM must re-read file
...
remorses commentedon Sep 11, 2025
I mean formatting the file on read operations. this way the LLM will probably use same conventions, there is less risk of big changes after formatting. code outside of the replaced snippet is guaranteed to be formatted
thdxr commentedon Sep 11, 2025
im thinking maybe at the end of a message (when agent is done) we go through all edit tool calls and format the file?
if they try to edit again they are told the file is modified so they will reread it
remorses commentedon Sep 12, 2025
That would be much better than now (I would prefer it disabled by default tho)
I want to keep git diff as a way to see what the model changed and it it starts formatting files the diff gets crowded
rekram1-node commentedon Sep 12, 2025
does your editor not format on save? For me the diffs arent ever crowded because a save runs prettier, gofmt, etc
remorses commentedon Sep 12, 2025
No, I currently use mainly Claude Code and try sometimes Opencode. I use both at the same time, so I have a lot of unformatted files
I have non formatted files for a lot of reasons. I just don't format on save. I think that's the majority of users. Now i disabled all LSP and formatters, that should be the default imo
rekram1-node commentedon Dec 28, 2025
[automated] Closing due to 90+ days of inactivity. Feel free to reopen if you still need this!
remorses commentedon Dec 28, 2025
I would like to keep this open but GithHub says I do not have the permission to do it