Observations of both gamma-ray bursts (GRBs) and active galactic nuclei (AGNs) point to the idea that some relativistic jets are suffocated by their environment before we observe them. In these 'choked' jets, all the jet's kinetic energy is transferred into a hot and narrow cocoon of near-uniform pressure. We consider the evolution of an elongated, axisymmetric cocoon formed by a choked jet as it expands into a cold power-law ambient medium ρ ∝ R −α , in the case where the shock is decelerating (α < 3). The evolution proceeds in three stages, with two breaks in behaviour: the first occurs once the outflow has doubled its initial width, and the second once it has doubled its initial height. Using the Kompaneets approximation, we derive analytical formulae for the shape of the cocoon shock, and obtain approximate expressions for the height and width of the outflow versus time in each of the three dynamical regimes. The asymptotic behaviour is different for flat (α ≤ 2) and steep (2 < α < 3) density profiles. Comparing the analytical model to numerical simulations, we find agreement to within ∼ 15 per cent out to 45 degrees from the axis, but discrepancies of a factor of 2-3 near the equator. The shape of the cocoon shock can be measured directly in AGNs, and is also expected to affect the early light from failed GRB jets. Observational constraints on the shock geometry provide a useful diagnostic of the jet properties, even long after jet activity ceases.