  The moduli space of Anosov representations of a surface group in a semisimple
group, which is an open set in the character variety, admits many more natural
functions than the regular functions. We will study in particular length
functions and, correlation functions. Our main result is a formula that
computes the Poisson bracket of those functions using some combinatorial
devices called {\em ghost polygons} and {\em ghost bracket} encoded in a formal
algebra called {\em ghost algebra} related in some cases to the swapping
algebra introduced by the second author. As a consequence of our main theorem,
we show that the set of those functions -- length and correlation -- is stable
under the Poisson bracket. We give two applications: firstly in the presence of
positivity we prove the convexity of length functions, generalising a result of
Kerckhoff in Teichm\"uller space, secondly we exhibit subalgebras of commuting
functions. An important tool is the study of {\em uniformly hyperbolic bundles}
which is a generalisation of Anosov representations beyond periodicity.
