We use a large dark matter simulation of a Λ cold dark matter (ΛCDM) model to investigate the clustering and environmental dependence of the number of substructures in a halo. Focusing on redshift z = 1, we find that the halo occupation distribution is sensitive at the tens of per cent level to the surrounding density and to a lesser extent to asymmetry of the surrounding density distribution. We compute the autocorrelation function of haloes as a function of occupation, building on the finding of Wechsler et al. and Gao & White that haloes (at fixed mass) with more substructure are more clustered. We compute the relative bias as a function of occupation number at fixed mass, finding a strong relationship. At fixed mass, haloes in the top 5 per cent of occupation can have an autocorrelation function ∼1.5–2 times higher than the mean. We also compute the bias as a function of halo mass, for fixed halo occupation. We find that for group- and cluster-sized haloes, when the number of subhaloes is held fixed, there is a strong anticorrelation between bias and halo mass. Such a relationship represents an additional challenge to the halo model.