Scattering in the skull limits spatial resolution in optical neuroimaging experiments in mice, so it is necessary to excise a portion of the skull. Such craniotomy procedures have traditionally been done manually, but automating the process provides greater control of the cutting path and depth. A computer numerical controlled (CNC) milling machine can perform craniotomies of arbitrary shape and position with high precision. Automating the procedure improves repeatability and consistency, poses fewer risks for damaging the brain, and makes the procedure easier to learn. We have developed an automated craniotomy procedure which utilizes a CNC machine to obtain a curvature profile of the skull with an impedance-sensitive probing circuit and to interpolate a cut path along this profile to remove a portion of a mouse’s skull. This procedure does not damage the underlying brain tissue and can be performed in under two hours.