DOCK8 mutations result in an inherited combined immunodeficiency characterized by increased susceptibility to skin and other infections. Here we show that when DOCK8-deficient T and NK cells migrate through confined spaces, they develop cell shape and nuclear deformation abnormalities that do not impair chemotaxis but contribute to a distinct form of catastrophic cell death we term cytothripsis. Such defects arise during lymphocyte migration in collagen-dense tissues, when DOCK8, through CDC42 and PAK, is unavailable to coordinate cytoskeletal structures. Cytothripsis of DOCK8-deficient cells prevents the generation of long-lived skin tissue-resident memory CD8 T cells, which in turn impairs control of herpesvirus skin infections. Our results establish that DOCK8-regulated shape integrity of lymphocytes prevents cytothripsis and promotes antiviral immunity in the skin.