Quantitative analysis of animal behaviour in model organisms is becoming an increasingly essential approach for tackling the great challenge of understanding how activity in the brain gives rise to behaviour. Here we used automated image-based tracking to extract behavioural features from an organism of great importance in understanding the evolution of chordates, the free-swimming larval form of the tunicate Ciona intestinalis, which has a compact and fully mapped nervous system composed of only 231 neurons. We analysed hundreds of videos of larvae and we extracted basic geometric and physical descriptors of larval behaviour. Importantly, we used machine learning methods to create an objective ontology of behaviours for C. intestinalis larvae. We identified eleven behavioural modes using agglomerative clustering. Using our pipeline for quantitative behavioural analysis, we demonstrate that C. intestinalis larvae exhibit sensory arousal and thigmotaxis. Notably, the anxiotropic drug modafinil modulates thigmotactic behaviour. Furthermore, we tested the robustness of the larval behavioural repertoire by comparing different rearing conditions, ages and group sizes. This study shows that C. intestinalis larval behaviour can be broken down to a set of stereotyped behaviours that are used to different extents in a context-dependent manner.