Chemokines have a central role in regulating processes essential to the immune function of T cells, such as their migration within lymphoid tissues and targeting of pathogens in sites of inflammation. Here we track T cells using multi-photon microscopy to demonstrate that the chemokine CXCL10 enhances the ability of CD8+ T cells to control the pathogen Toxoplasma gondii in the brains of chronically infected mice. This chemokine boosts T-cell function in two different ways: it maintains the effector T-cell population in the brain and speeds up the average migration speed without changing the nature of the walk statistics. Notably, these statistics are not Brownian; rather, CD8+ T-cell motility in the brain is well described by a generalized Lévy walk. According to our model, this unexpected feature enables T cells to find rare targets with more than an order of magnitude more efficiency than Brownian random walkers. Thus, CD8+ T-cell behaviour is similar to Lévy strategies reported in organisms ranging from mussels to marine predators and monkeys, and CXCL10 aids T cells in shortening the average time taken to find rare targets.