Yeah, the reason I didn't mention this is that there is no guarantee that the file won't be written to disk before your handler is called. See this: https://github.com/zedapp/zed/blob/master/app/js/session_manager.js#L68

First the event is triggered (which asynchronously calls your sandbox handler), then immediately the file is written to disk. Chances are high that your sandbox code hasn't run before the file is actually saved.