  We consider a hybrid system of matter and light as a sensing device and
quantify the role of cooperative effects. The latter generically enhance the
precision with which modifications of the effective light-matter coupling
constant can be measured. In particular, considering a fundamental model of $N$
qubits coupled to a single electromagnetic mode, we show that the ultimate
bound for the precision shows double-Heisenberg scaling:
$\Delta\theta\propto1/(Nn)$, with $N$ and $n$ being the number of qubits and
photons, respectively. Moreover, even using classical states and measuring only
one subsystem, a Heisenberg-times-shot-noise scaling, i.e. $1/(N\sqrt{n})$ or
$1/(n\sqrt{N})$, is reached. As an application, we show that a Bose-Einstein
condensate trapped in a double-well potential within an optical cavity can
detect the gravitational acceleration $g$ with the relative precision of
$\Delta g/g\simeq10^{-9}\text{Hz}^{-1/2}$. The analytical approach presented in
this study takes into account the leakage of photons through the cavity
mirrors, and allows to determine the sensitivity when $g$ is inferred via
measurements on atoms or photons.
