Solution (source code)

= Solution

Write $\mathcal H=a'/a$, where primes denote <conformal time>. In the passive convention for a <cosmological gauge transformation>, retain terms linear in $h$ or $\xi$ and discard their products. The <linear metric gauge-transformation law> then gives
$$
\Delta h_{\mu\nu}=-\eta_{\mu\alpha}\partial_\nu\xi^\alpha
-\eta_{\nu\alpha}\partial_\mu\xi^\alpha
-2\mathcal H\eta_{\mu\nu}\xi^0.
$$
For a single nonzero <Fourier mode>, suppress the common factor $e^{i\mathbf k\cdot\mathbf x}$. Its derivatives are
$$
\partial_0\xi^0=T',\quad \partial_i\xi^0=ik\widehat k_iT,\quad
\partial_0\xi^i=i\widehat k_iL',\quad
\partial_j\xi^i=-k\widehat k_i\widehat k_jL.
$$
Using $\eta_{00}=-1$ and $\eta_{ij}=\delta_{ij}$ therefore yields
$$
\boxed{\begin{aligned}
\Delta h_{00}&=2(T'+\mathcal HT),\\
\Delta h_{0i}&=i\widehat k_i(kT-L'),\\
\Delta h_{ij}&=2kL\widehat k_i\widehat k_j-2\mathcal HT\delta_{ij}.
\end{aligned}}
$$
The term proportional to $\mathcal HT$ comes from the time dependence of the background <scale factor>; omitting it would transform only the flat reference metric.