-
I was thinking similar - both on the Pi (I think dmesg might show wifi connections going uo and down, and wpa_supplicant has logging) and the phone (more difficult - you may need to root it and use something like acatlog).
I've always found hotspot tethering to be pretty nonpersistent - there may be a develooer mode setting that helps.
Didn't rhb mention juicessh? I'm guessing there's a keepalive config settling somewhere for that too.
It might even be an idea to jsut have a wrapper script that opens a connection before of the real work starts.
Assuming it's an intermittent connection issue, I'd probably build some automatic retry around the steps that involve external connections, with plenty of logging