OSX ssh server disconnects after 15 minutes
You should be able to force the client to send keepalive messages if there is no activity by setting TCPKeepAlive yes (should be default) in ssh_config.

If it will not help, you can try to set

ServerAliveCountMax 5
ServerAliveInterval 600 # seconds = 10 minutes