We investigate MeV-level attosecond electron bunches from ultrashort-pulse laser-solid interactions through similarities between experimental and simulated electron energy spectra. We show measurements of the bunch duration and temporal structure from particle-in-cell simulations. The experimental observation of such bunches favors specular reflection direction when focusing the laser pulse onto a subwavelength boundary of thick overdense plasmas at grazing incidence. Particle-in-cell simulation further reveals that the attosecond duration is a result of ultra-thin ($$\sim $$
∼
tenth of a micron) gaps of zero electromagnetic energy density in the modulated reflected radiation, while the bunching (locally peaked electron concentration) comes from the highly-directional electron angular distribution acquired by the electrons in a grazing incidence setup. To isolate a single electron bunch, we perform simulations using 1-cycle laser pulses and analyze the effect of carrier-envelop phase with particle tracking. The duration of the electron bunch can be further decreased by increasing the laser intensity and the focal spot size, while its direction can be changed by tuning the preplasma density gradient.