Piwi proteins and their small-RNA partners, piwi-interacting (pi)RNA, form a natural mechanism that prevents the deleterious activity of transposable elements in the germ line of metazoan species. The piRNA pathway relies on extended noncoding genomic regions, dubbed piRNA clusters, to produce long precursor transcripts that are subsequently processed into mature piRNAs. The large size and repetitive nature of piRNA clusters provide significant challenges for their dissection using common genetic tools. Here we describe an effective approach for manipulation of piRNA clusters using a combination of BAC recombineering in E. coli and phiC31-mediated transgenesis in Drosophila. Although the described approach is instrumental for manipulating piRNA clusters, it can also be implemented for other problems in functional genomics.