ABSTRACT In time-delay cosmography, three of the key ingredients are (1) determining the velocity dispersion of the lensing galaxy, (2) identifying galaxies and groups along the line of sight with sufficient proximity and mass to be included in the mass model, and (3) estimating the external convergence κext from less massive structures that are not included in the mass model. We present results on all three of these ingredients for two time-delay lensed quad quasar systems, DES J0408–5354 and WGD 2038–4008 . We use the Gemini, Magellan, and VLT telescopes to obtain spectra to both measure the stellar velocity dispersions of the main lensing galaxies and to identify the line-of-sight galaxies in these systems. Next, we identify 10 groups in DES J0408–5354 and two groups in WGD 2038–4008 using a group-finding algorithm. We then identify the most significant galaxy and galaxy-group perturbers using the ‘flexion shift’ criterion. We determine the probability distribution function of the external convergence κext for both of these systems based on our spectroscopy and on the DES-only multiband wide-field observations. Using weighted galaxy counts, calibrated based on the Millennium Simulation, we find that DES J0408–5354 is located in a significantly underdense environment, leading to a tight (width $\sim 3{{\ \rm per\ cent}}$), negative-value κext distribution. On the other hand, WGD 2038–4008 is located in an environment of close to unit density, and its low source redshift results in a much tighter κext of $\sim 1{{\ \rm per\ cent}}$, as long as no external shear constraints are imposed.