Compact neutron star binary systems are produced from binary massive stars through stellar evolution involving up to two supernova explosions. The final stages in the formation of these systems have not been directly observed. We report the discovery of iPTF 14gqr (SN 2014ft), a type Ic supernova with a fast-evolving light curve indicating an extremely low ejecta mass (≈0.2 solar masses) and low kinetic energy (≈2 × 1050 ergs). Early photometry and spectroscopy reveal evidence of shock cooling of an extended helium-rich envelope, likely ejected in an intense pre-explosion mass-loss episode of the progenitor. Taken together, we interpret iPTF 14gqr as evidence for ultra-stripped supernovae that form neutron stars in compact binary systems.