Photoinjection of charge carriers profoundly changes the properties of a solid. This manipulation enables ultrafast measurements, such as electric-field sampling1,2, advanced recently to petahertz frequencies3–7, and the real-time study of many-body physics8–13. Nonlinear photoexcitation by a few-cycle laser pulse can be confined to its strongest half-cycle14–16. Describing the associated subcycle optical response, vital for attosecond-scale optoelectronics, is elusive when studied with traditional pump-probe metrology as the dynamics distort any probing field on the timescale of the carrier, rather than that of the envelope. Here we apply field-resolved optical metrology to these dynamics and report the direct observation of the evolving optical properties of silicon and silica during the first few femtoseconds following a near-1-fs carrier injection. We observe that the Drude–Lorentz response forms within several femtoseconds—a time interval much shorter than the inverse plasma frequency. This is in contrast to previous measurements in the terahertz domain8,9and central to the quest to speed up electron-based signal processing.