The swarm cognitive behavior of bees readily translates to swarm intelligence with "social cognition," thus giving rise to the rapid promotion of survival skills and resource allocation. This paper presents a novel cognitively inspired artificial bee colony clustering (ABCC) algorithm with a clustering evaluation model to manage the energy consumption in cognitive wireless sensor networks (CWSNs). The ABCC algorithm can optimally align with the dynamics of the sensor nodes and cluster heads in CWSNs. These sensor nodes and cluster heads adapt to topological changes in the network graph over time. One of the major challenges with employing CWSNs is to maximize the lifetime of the networks. The ABCC algorithm is able to reduce and balance the energy consumption of nodes across the networks. Artificial bee colony (ABC) optimization is attractive for this application as the cognitive behaviors of artificial bees match perfectly with the intrinsic dynamics in cognitive wireless sensor networks. Additionally, it employs fewer control parameters compared to other heuristic algorithms, making identification of optimal parameter settings easier. Simulation results illustrate that the ABCC algorithm outperforms particle swarm optimisation (PSO), group search optimization (GSO), low-energy adaptive clustering hierarchy (LEACH), LEACH-centralized (LEACH-C), and hybrid energy-efficient distributed clustering (HEED) for energy management in CWSNs. Our proposed algorithm is increasingly superior to these other approaches as the number of nodes in the network grows.