X-linked agammaglobulinemia (XLA) is a monogenic primary immune deficiency characterized by very low levels of immunoglobulins and greatly increased risks for recurrent and severe infections. Patients with XLA have a loss-of-function mutation in the Bruton's tyrosine kinase (BTK) gene and fail to produce mature B lymphocytes. Gene editing in the hematopoietic stem cells of XLA patients to correct or replace the defective gene should restore B cell development and the humoral immune response. We used the clustered regularly interspaced short palindromic repeats (CRISPR)-Cas9 platform to precisely target integration of a corrective, codon-optimized BTK complementary DNA (cDNA) cassette into its endogenous locus. This process is driven by homologous recombination and should place the transgenic BTK under transcriptional control of its endogenous regulatory elements. Each integrated copy of this cDNA in BTK-deficient K562 cells produced only 11% as much BTK protein as the wild-type gene. The donor cDNA was modified to include the terminal intron of the BTK gene. Successful integration of the intron-containing BTK donor led to a nearly twofold increase in BTK expression per cell over the base donor. However, this donor variant was too large to package into an adeno-associated viral vector for delivery into primary cells. Donors containing truncated variants of the terminal intron also produced elevated expression, although to a lesser degree than the full intron. Addition of the Woodchuck hepatitis virus posttranscriptional regulatory element led to a large boost in BTK transgene expression. Combining these modifications led to a BTK donor template that generated nearly physiological levels of BTK expression in cell lines. These reagents were then optimized to maximize integration rates into human hematopoietic stem and progenitor cells, which have reached potentially therapeutic levels in vitro. The novel donor modifications support effective gene therapy for XLA and will likely assist in the development of other gene editing-based therapies for genetic disorders.