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 ($approx 0.2$ solar masses) and low kinetic energy ($approx 2 times 10^{50}$ ergs). Early photometry and spectroscopy reveal evidence of shock cooling of an extended He-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.