  Cosmic inflation driven by the vacuum energy associated with the $D$-term of
a supersymmetric abelian gauge group and a possible existence of long-range
force mediated by an ultra-light gauge boson $Z^\prime$ are two extreme
examples of models based on extra $U(1)$ symmetries. Large vacuum energy sets
the scale of inflation while the scales of long-range forces induced by anomaly
free extra gauged $U(1)$ symmetries are constrained by neutrino oscillations,
binary pulsar timings and invisible neutrino decay. There exists a difference
of about 40 orders of magnitude between the scales of these two. Also, gauge
couplings associated with the long-range forces are very small compared to the
standard model couplings and the one required for inflation. We propose a
framework based on clockwork mechanism in which these vastly different scales
and associated new physics can coexist without invoking any arbitrarily small
or large parameter in the fundamental theory. A chain of $U(1)$ is introduced
with characteristic nearest-neighbour interactions. A large $D$-term introduced
at one end governs the dynamics of inflation. $Z^\prime$ is localized on the
other end of the chain, and it can be massless or can get naturally suppressed
mass. The standard model fields can be charged under one of the intermediate
$U(1)$ in the chain to give rise to their small effective coupling $g^\prime$
with $Z^\prime$. Constraints on $g^\prime$ and $M_{Z^\prime}$ are discussed in
the context of the long-range forces of type $L_\mu - L_\tau$, $L_e - L_\mu$
and $B-L$. These, along with the inflation observables, are used to constraint
the parameters of the underlying clockwork model.
