Many feedback processes can contribute to the regulation and truncation of star formation in galaxies. Knowing the environment of galaxies is important to understand which are the dominant mechanisms. Galaxy clustering tells us the host dark matter halo mass, and their distribution within these halos. We measured the clustering of a morphology selected sample of z<0.1 spiral galaxies, as a function of specific star formation rate (SSFR). We find that the typical dark matter halo mass of spiral galaxies is independent of SSFR. We detect what appears to be the signature of recent or ongoing mergers in the clustering of galaxies with enhanced SSFRs. We extend our analysis to higher redshift, by measuring the clustering of star forming galaxies from 0.2<z<1.0, using Spitzer 24µm imaging. We show that at z<0.8 star formation is truncated in dark matter halos of M≈1012.5Mʘ. The most luminous star forming galaxies at z<0.8 are typically still undergoing star formation in the local universe, in groups and less dense environments. We see an increase in clustering and halo mass at 0.8<z<1.0, where we are observing star forming progenitors of elliptical galaxies, in denser environments.