One of the most challenging preprocessing steps in Raman spectroscopy is the removal of cosmic spikes that interfere with genuine Raman modes. Software packages offer built-in methods for their detection and removal, but these are not entirely effective and/or well-documented. In this work, we propose a new algorithm called ARCHER for cosmic spike correction, specifically designed for Hyperspectral Raman Imaging, that combines different steps and factorizations for effective and automatic cosmic spike detection. ARCHER can also detect saturated pixels, which must be necessarily removed after addressing any further multivariate analysis. The algorithm was optimized using D-optimal design to set its internal parameters. The validation was double-checked by application on different artificial images, facing several degrees of complexity to identify potential weaknesses. Finally, the algorithm was tested against real hyperspectral images in the presence of saturated and noisy pixels.