SFTP Local mirror to live server

Feature request for product/service

Cursor IDE

Describe the request

I use Natizyskunk SFTP extension for Cursor, its great as I can manage files locally and save to push to live quickly. The files download upon open so I am have a copy of the live file.

However it falls short in a few places1. Cursor edits the local version of the file, it skips the ‘download on open’ setting. Which 99% isn’t an issue as the local is mostly a up to date with server.

However, as it doesn’t open or save the way the user saves, it doesn’t push to live. Manually opening the file downloads the server file, and cursors changes are overwritten.

  1. Thus I added a watcher, that intermittently uploads the files from local regularly, however, cursor seems to be using .py patch files and testing with by png snapshots. Which 99% of the time cursor cleans up. The watcher occasionally is uploading these to live, as they are removed from the local codebase, I have to review the server to delete these. (I use php, py and png files normally, so I can’t write a rule to avoid the patch or testing snapshots.)The watcher isn’t ideal and was introduced to upload the changes the agents make, rather than me saving the file and potentially overwriting the changes in the process. Maybe Cursor devs can implement settings that hook Agent file tools, not editor open/save.

  2. Sync on Agent writeWhen Agent writes a workspace file, fire the same upload path SFTP already uses for Save.Do not require a tab to be open.Do not treat it as an editor Open (so downloadOnOpen does not run and wipe the write).

  3. Optional pull on Agent readWhen Agent first reads a file in a turn, pull from the remote if a project setting says so.That replaces “open the tab to fetch live” for Agent only.

  4. Agent temp file ignoreIgnore files Agent creates for itself: patch.py, apply-patch scripts, PNG/PHP snapshots, and anything under .cursor.Use Cursor’s own file list, not a user glob. You cannot exclude *.py / *.png / *.php because those are real project files. Cursor already knows which paths it created for a patch or a test snapshot.

  5. Project setting, off by defaultExample:

JSON

“cursor.remoteMirror”: {
“enabled”: true,
“pullOnAgentRead”: true,
“pushOnAgentWrite”: true,
“ignoreAgentTempFiles”: true
}

Keep Natizyskunk (or any SFTP extension) for user Save and user Open. Cursor only needs to expose two events extensions can listen for: onAgentDidReadFile and onAgentDidWriteFile, plus a list of temp paths for that turn.

That covers the gap: user Save still pushes live, user Open still downloads live, Agent writes push without opening a tab, and Agent junk never reaches the server.

Hey @Callum1, thanks for the suggestion!

I think ost of this is possible today with Cursor Hooks. Hooks are scripts Cursor runs on agent events, independent of editor tabs, so they fire when the agent itself reads or writes a file rather than on editor Open or Save.

For push on agent write, add an afterFileEdit hook to .cursor/hooks.json in your project. It receives the edited file_path on stdin (newly created files included), so your script can upload just that file over SFTP without a tab being open and without triggering a download-on-open.

For agent reads, a preToolUse hook matched to the Read tool runs before the agent reads a file, so it can fetch the latest copy from the server first.