One proposed advantage of communal roosting in birds is a reduction in the costs of thermoregulation. As thermoregulatory benefits are directly linked to the distance between roosting birds, we examined whether temperature is related to inter‐bird spacing in roosting chimney swifts Chaetura pelagica. To test the hypothesis that huddling is used to reduce the costs of thermoregulation, we predicted that swifts would cluster more at colder temperatures. We mounted an all‐weather camera atop a 61 m tall industrial masonry chimney, one of the largest swift roosts in the study region. We deployed temperature loggers inside the chimney and obtained ambient air temperature from a nearby weather station. From 16 May–24 July 2013, we captured hourly images of the positions of roosting swifts at night. We used image analysis software to mark the angular positions of all roosting swifts, and calculated mean angles of orientation (preferred direction) inside the roost and the circular variance (i.e. the concentration of swifts around the mean angle). We used a Gamma regression to relate temperature inside and outside the roost to the clustering of swifts around the mean angle for 3 time periods (pre‐nesting, nesting, and post‐nesting). Converse to our prediction, swifts were closer together when ambient air temperatures were warmer in all periods (pre‐nesting (p < 0.001, n = 168), nesting (p < 0.001, n = 224), and post‐nesting (p < 0.001, n = 135)). Our findings suggest that swifts do not increase clustering intensity in response to colder temperatures, but instead they increase clustering intensity in response to the warmest ambient temperatures. This likely a metabolic response to reduced prey availability at higher temperatures and/or an attempt to reduce evaporative water loss. We suggest clustering may be used by chimney swifts as an energy saving mechanism during periods of lowered food availability.