We study the geometric properties of certain Codazzi tensors for their own
sake, and for their appearance in the recent theory of Cotton gravity. We prove
that a perfect-fluid tensor is Codazzi if and only if the velocity field is
shear and vorticity-free (i.e. the spacetime is doubly-twisted). A trace
condition restricts it to a warped spacetime, as proven by Merton and
Derdzinski. We also give necessary and sufficient conditions for a spacetime to
host a current-flow Codazzi tensor. In particular, we study their static and
spherically symmetric cases. We apply these results to the recent Cotton
gravity by Harada. The equations have the freedom of choosing a Codazzi tensor,
that constrains the spacetime where the theory is staged. The tensor, chosen in
forms significative for physics, implies the form of the Ricci tensor, and the
two specify the energy-momentum tensor, which is the source in Cotton gravity
for the chosen metric. Finally, we present the general energy-momentum tensor
for Cotton gravity in De Sitter spacetimes.