For a class project, Priya Donti, Kathrine Ye, and I developed a Bash autocomplete plugin that heuristically opens speculative connections. You can download it here.

The plugin provides autocompletion for SSH commands based on previous connections. When autocomplete is invoked in an SSH command, we use previous user behavior together with some heuristics to guess which SSH connection is likely to be selected. If this SSH connection supports ControlMaster multiplexing, then a connection is speculatively opened.

Implementation diagram. Implementation diagram.

We empirically determined that this saves between 100-300ms. Just enough to make SSH connections feel a little more seamless.

In creating SSHazam, we analyzed submitted Bash logs to find good heuristics. We ultimately discovered that most recently opened SSH connection is most likely to be opened again. Details are in our slides.