I strongly suggest that [codechef ide][1] save the code automatically in local storage or so, like [hackerrank][2].
I think it does not break the security feature of current ide.
It is annoying to lost all codes from time to time only because an accident push on backspace while not realizing the focus is outside the editor.
[1]: https://www.codechef.com/ide
[2]: https://www.hackerrank.com/