IntroductionGlobal change events (e.g., worsening drought) are increasing environmental stress in a variety of terrestrial and aquatic habitats. The degree to which communities in soils and sediments are driven by temporal environmental changes across multiple habitat types from the same region is not clear.MethodsWe used nematodes, a common bioindicator of soil and sediment health, to determine how community diversity and composition are altered by rising alkalinity across lakes, shorelines, and prairies in the western Nebraska Sandhills. We sampled these three habitats from five lake basins spanning an alkalinity gradient (pH 7–11) across three years (2019, 2020, 2021). During our sampling, the Sandhills experienced a range of drought intensities, with 2019 being a wet year, followed by severe drought in 2020, and abnormally dry/moderate drought in 2021. To determine if diversity and composition of nematodes responded to increased alkalinity and drought-induced stress we used different modelling approaches, including Random Forest and pairwise comparisons.Results and discussionOverall, nematode diversity in lakes was most affected by increasing alkalinity over time, whereas in shorelines and prairies diversity was most reliant on bacterial diversity and potential nematode-nematode interactions. In comparison to shorelines and prairies, community composition in lakes was the least variable and consistently driven by pH and lake water levels. In contrast, compositions in the shorelines and prairies were more variable and explained at varying degrees by pH, year, lake basin, and climate-associated variables. In addition, relative abundance and compositional nature of select copious taxa were highly unpredictable, indicating potential instability in these habitats. Future research is necessary to address the ecologic stability of the Sandhills and determine where conservation efforts are most needed.