Why does Cursor use `sed` for bulk code edits instead of direct modifications?

I’ve noticed that whenever Cursor needs to apply many similar code changes, it often resorts to using terminal tools like sed instead of editing the files directly.

Is this done to reduce token usage or lighten the backend load? My concern is that changes applied via sed aren’t easily tracked by Cursor, so it seems unable to “remember” those edits.

Does anyone know the rationale behind this workflow?

When it repeatedly tries to call cursor’s built-in tools, such as edit_file or search_replace, which always fail because of the mysterious force, it occasionally chooses to use other tools to edit the code. The mysterious power may be because the code is too long, maybe because you modified the code and it doesn’t want to read again, and so on.

Yes. Occasionally, edit_file cannot be called. In my case, gemini-2.5-pro is more frequently failed for the case than claude-4-sonnet. I just wonder that cursor tries terminal + sed combination, which cannot be trackable by cursor, instead of using edit_file provided by cursor. If it is a kind of bugs, it would be good to fix it.