A density-dependent effective potential for the baryon–baryon interaction in the presence of the (hyper)nuclear medium is constructed, based on the leading (irreducible) three-baryon forces derived within SU(3) chiral effective field theory. We evaluate the contributions from three classes: contact terms, one-pion exchange and two-pion exchange. In the strangeness-zero sector we recover the known result for the in-medium nucleon–nucleon interaction. Explicit expressions for the ΛN in-medium potential in (asymmetric) nuclear matter are presented. Our results are suitable for implementation into calculations of (hyper)nuclear matter. In order to estimate the low-energy constants of the leading three-baryon forces we introduce the decuplet baryons as explicit degrees of freedom and construct the relevant terms in the minimal non-relativistic Lagrangian. With these, the constants are estimated through decuplet saturation. Utilizing this approximation we provide numerical results for the effect of the three-body force in symmetric nuclear matter and pure neutron matter on the ΛN interaction. A moderate repulsion that increases with density is found in comparison to the free ΛN interaction.