During early life, neural codes must develop to appropriately transform sensory inputs into behavioral outputs. Here, we demonstrate a link between the maturity of neural coding in the visual brain and developmental changes in visually guided behavior. In zebrafish larvae, we show that visually driven hunting behavior improves from 4 to 15 days post-fertilization, becoming faster and more accurate. During the same period, population activity in parts of the optic tectum refines, improving decoding and information transmission for particular spatial positions. Remarkably, individual differences in decoding can predict each fish’s hunting success. Together, these results help reveal how the neural codes required for a natural behavior emerge during development.