When the motion of a motile cell is observed closely, it appears erratic, and yet the combination of nonequilibrium forces and surfaces can produce striking examples of organization in microbial systems. While most of our current understanding is based on bulk systems or idealized geometries, it remains elusive how and at which length scale self-organization emerges in complex geometries. Here, using experiments and analytical and numerical calculations, we study the motion of motile cells under controlled microfluidic conditions and demonstrate that probability flux loops organize active motion, even at the level of a single cell exploring an isolated compartment of nontrivial geometry. By accounting for the interplay of activity and interfacial forces, we find that the boundary’s curvature determines the nonequilibrium probability fluxes of the motion. We theoretically predict a universal relation between fluxes and global geometric properties that is directly confirmed by experiments. Our findings open the possibility to decipher the most probable trajectories of motile cells and may enable the design of geometries guiding their time-averaged motion