In this paper, we propose a simple scheme that leverages existing x-ray free-electron laser hardware to produce stable single-spike, subfemtosecond x-ray pulses. By optimizing a high-harmonic radio-frequency linearizer to achieve nonlinear compression of a low-charge (20 pC) electron beam, we obtain a sharp current profile possessing a few-femtosecond full width at half maximum temporal duration. A reverse undulator taper is applied to enable lasing only within the current spike, where longitudinal space charge forces induce an electron beam time-energy chirp. Simulations based on the Linac Coherent Light Source parameters show that stable single-spike x-ray pulses with a duration less than 200 attoseconds can be obtained.