What is "gradient energy" in classical field theory? For the simple theory of a single real scalar field $\phi$ in 1+1D, the Lagrange density is $$\mathcal{L}=\frac{1}{2}\partial_\mu\phi\partial^\mu\phi-U(\phi)\tag{1}$$
with Minkowski signature $(+,-)$, and the corresponding Hamiltonian is $$\mathcal{H}=\frac{1}{2}\partial_\mu\phi\partial^\mu\phi+U(\phi)\tag{2}$$so the total energy of the field configuration is $$E=\int dx\,\left(\frac{1}{2}(\partial_t\phi)^2+\frac{1}{2}(\partial_x\phi)^2+U(\phi)\right).\tag{3}$$
Often I will see this energy broken down in the following way:
$$\text{kinetic energy:}\quad\frac{1}{2}(\partial_t\phi)^2\\
\text{gradient energy:}\quad\frac{1}{2}(\partial_x\phi)^2\\
\text{potential energy:}\quad U(\phi)\tag{4}$$
For example, see Sean Carroll's Spacetime and Geometry, P. 40. The total energy is no longer just "kinetic plus potential" but "kinetic plus gradient plus potential". How can one understand the energy associated with the gradient of the field distribution? Is there any analogy to classical (particle) mechanics, where the energy is simply stated to be $$\mathcal{H}=T+U~?\tag{5}$$
Ostensibly this means that a scalar field distribution which is spatially varying but static could have more energy than one which is flat but dynamic. What is the intuition here?
 A: The gradient energy density $\frac{1}{2}(\partial_x\phi)^2$ is strictly speaking part of the potential energy density ${\cal V}=\frac{1}{2}(\partial_x\phi)^2+{\cal U}$. (If one discretizes space, it can be viewed as potential energy of springs between discrete atoms, see e.g. the last chapter of H. Goldstein, Classical Mechanics.) This is why $\frac{1}{2}(\partial_x\phi)^2$ comes with a minus sign in the Lagrangian density (1), and with a plus sign in the energy density (3).
For this reason eq. (2) is incorrect: The gradient energy term has the wrong sign in eq. (2). The Hamiltonian density (2) should be the same as the energy density (3).
This correction also restores the usual relations ${\cal L}={\cal T}-{\cal V}$ and ${\cal H}={\cal T}+{\cal V}$ for scalar fields.
A: The best intuition is from the example of a "loaded string":  a set of $N$ masses that are connected by a massless elastic string.  If we imagine the limit as $N \to \infty$ but with the total length of the string fixed, it can be shown that we obtain the expected vibrational modes of a massive continuous string;  this is (of course) governed by the 1-D wave equation (with $U = 0$.)  So we should be able to identify the classical-mechanics analogue of the gradient energy here.
There are two forms of energy in the loaded string:  the kinetic energy of the masses (which corresponds to the kinetic term in the wave Lagrangian) and the elastic potential energy of the string.  Notably, there is no elastic potential energy if two adjacent masses are displaced by the same amount, since the string is not stretched or compressed in this situation.  In other words, there is an energy associated with having a different displacement at different points along the string.  In the limit of $N \to \infty$ infinitesimally spaced masses, this discrete difference turns into a gradient, with an energy associated with non-zero gradients.
The potential term $U(\phi)$ in the wave Lagrangian, on the other hand, doesn't have a simple analogue in the classical loaded string.  Since $U(\phi)$ depends on the absolute values of $\phi$, rather than the relative values of $\phi$ at "adjacent points", we would need to modify the loaded string to add a potential that depends on the absolute displacement of each mass.  Imagine, for example, a loaded string where each mass is attached via springs to its nearest neighbors, but also to the table; or (inspired by @Javier in the comments) a set of pendulums attached by springs.  The energy from the attachments to the neighbors would yield the analogue of gradient energy, while the energy from the attachment to the table (or the gravitational potential energy) would yield the analogue of field potential energy.
