A logical qubit is a two-dimensional subspace of a higher dimensional system, chosen such that it is possible to detect and correct the occurrence of certain errors . Manipulation of the encoded information generally requires arbitrary and precise control over the entire system [2, 3]. Whether based on multiple physical qubits or larger dimensional modes such as oscillators, the individual elements in realistic devices will always have residual interactions which must be accounted for when designing logical operations. Here we demonstrate a holistic control strategy which exploits accurate knowledge of the Hamiltonian to manipulate a coupled oscillator-transmon system. We use this approach to realize high-fidelity (99%, inferred), decoherence-limited operations on a logical qubit encoded in a superconducting cavity resonator using four-component cat states [4, 5]. Our results show the power of applying numerical techniques  to control linear oscillators and pave the way for utilizing their large Hilbert space as a resource in quantum information processing.