The most common statistic used to analyse large-scale structure surveys is the correlation function, or power spectrum. Here, we show how ‘slicing’ the correlation function on local density brings sensitivity to interesting non-Gaussian features in the large-scale structure, such as the expansion or contraction of baryon acoustic oscillations (BAOs) according to the local density. The sliced correlation function measures the large-scale flows that smear out the BAO, instead of just correcting them as reconstruction algorithms do. Thus, we expect the sliced correlation function to be useful in constraining the growth factor, and modified gravity theories that involve the local density. Out of the studied cases, we find that the run of the BAO peak location with density is best revealed when slicing on an ∼40 h−1Mpc filtered density. But slicing on an ∼100 h−1 Mpc filtered density may be most useful in distinguishing between underdense and overdense regions, whose BAO peaks are separated by a substantial ∼5 h−1 Mpc at z = 0. We also introduce ‘curtain plots’ showing how local densities drive particle motions towards or away from each other over the course of an N-body simulation.