SenAOReFoc is a closed-loop sensor-based adaptive optics (AO) and remote-focusing control software that works with a deformable mirror (DM) and a Shack-Hartmann wavefront sensor (SHWS). It provides a user-friendly graphic user interface (GUI) with modular widget arrangements and clear labelling to help the user navigate through different software functionalities. Interactive messages are also displayed from the GUI for user guidance.SenAOReFoc consists of five main units: the SHWS initialisation and DM calibration unit, the Zernike aberration input unit, the AO control and data collection unit, the miscellaneous control unit, and the remote focusing unit, as shown in Figure 1. The software can be run in either 'debug mode' to perform functionality tests without connected hardware (DM and SHWS), or 'standard mode' on a well-aligned optical sectioning microscope (confocal, multiphoton, etc.). User controllable system parameters can be freely accessed and modified in a separate configuration file that is loaded upon software initialisation, and parameters that require continuous user input can be modified from the GUI. Parameters calculated when running the software, as well as important result data, are grouped and saved in a separate HDF5 file that can be read with HDFView software. Automated AO performance characterisations can be performed in 'standard mode' to assess the correction ability of the optical system. If the adopted DM is designed with a large stroke, i.e., is capable of large deformations, both the closed-loop AO correction and remote focusing functionalities can be exploited. On the other hand, if the DM exhibits insufficient stroke for remote focusing, by ignoring the remote focusing unit, closed-loop AO correction functionalities will still be fully functional without additional modifications to the software.Closed-loop AO correction can be performed using both the zonal method, which updates DM control voltages in terms of the raw slope values; and the modal method, which updates DM control voltages in terms of orthogonal Zernike polynomials. There are four sub-modes tagged to each of the two methods: 1) standard closed-loop AO correction; 2) closed-loop AO correction with consideration of obscured search blocks; 3) closed-loop AO correction with partial correction excluding defocus; and 4) closed-loop AO correction with both consideration of obscured search blocks and partial correction excluding defocus.Remote focusing can be performed by scanning the focus axially with a pre-determined axial range, step increment and step number, or by manually adjusting a toggle bar on the GUI for random access remote focusing. The former also incorporates options of whether or not to perform closed-loop AO correction at each remote focusing depth.