Accreting millisecond X-ray pulsars are an important subset of low-mass X-ray binaries in which coherent X-ray pulsations can be observed during occasional, bright outbursts (X-ray luminosity $L_Xsim 10^{36}$ erg s$^{-1}$). These pulsations show that matter is being channeled onto the neutron stars magnetic poles. However, such sources spend most of their time in a low-luminosity, quiescent state ($L_Xlesssim 10^{34}$ erg s$^{-1}$), where the nature of the accretion flow onto the neutron star (if any) is not well understood. Here we report that the millisecond pulsar/low-mass X-ray binary transition object PSR J1023+0038 intermittently shows coherent X-ray pulsations at luminosities nearly 100 times fainter than observed in any other accreting millisecond X-ray pulsar. We conclude that in spite of its low luminosity PSR J1023+0038 experiences episodes of channeled accretion, a discovery that challenges existing models for accretion onto magnetized neutron stars.