  Quantum error correction is expected to be essential in large-scale quantum
technologies. However, the substantial overhead of qubits it requires is
thought to greatly limit its utility in smaller, near-term devices. Here we
introduce a new family of special-purpose quantum error-correcting codes that
offer an exponential reduction in overhead compared to the usual repetition
code. They are tailored for a common and important source of decoherence in
current experiments, whereby a register of qubits is subject to phase noise
through coupling to a common fluctuator, such as a resonator or a spin defect.
The smallest instance encodes one logical qubit into two physical qubits, and
corrects decoherence to leading-order using a constant number of one- and
two-qubit operations. More generally, while the repetition code on $n$ qubits
corrects errors to order $t^{O(n)}$, with $t$ the time between recoveries, our
codes correct to order $t^{O(2^n)}$. Moreover, they are robust to model
imperfections in small- and intermediate-scale devices, where they already
provide substantial gains in error suppression. As a result, these
hardware-efficient codes open a potential avenue for useful quantum error
correction in near-term, pre-fault tolerant devices.
