This stud introduces a pioneering investigation into the geometric optimization of building surroundings to elevate thermal comfort efficiency and foster sustainable development within the construction industry. Employing the ENVI-met simulation tool and a novel crow search optimization algorithm, the research rigorously quantifies occupants' dissatisfaction utilizing the predicted percentage dissatisfied model, meticulously considering various environmental parameters. The simulations are based on the weather data of Nanjing, China, and the numerical results were validated against the observed data. The results reveal a remarkable 7% reduction in energy consumption and a corresponding 7.2% decrease in CO2 emissions compared to baseline configurations, underscoring the substantial impact of the proposed crow search algorithm. Notably, the study identifies an optimal configuration, characterized by a 30% vegetation cover, west–east orientation, and a three-story building, highlighting the algorithm's effectiveness in identifying configurations that concurrently enhance thermal comfort and mitigate energy consumption. These findings highlight the critical influence of geometric factors on thermal performance and underscore the significance of integrating innovative methodologies to address contemporary challenges in sustainable building design. By offering novel insights and practical solutions, this research contributes to advancing sustainable practices in architecture and urban planning, ultimately promoting occupant well-being and fostering energy-efficient construction practices.