A method for genetically barcoding Drosophila is developed and used to tag defined cell populations in vivo for single-cell transcriptomics experiments and to enable multiplexed behavioral analysis.