Cellular barcoding is a significant, recently developed, biotechnology tool that enables the familial identification of progeny of individual cells in vivo. Most existing approaches rely on ex vivo viral transduction of cells with barcodes, followed by adoptive transfer into an animal, which works well for some systems, but precludes barcoding cells in their native environment, such as those inside solid tissues. With a view to overcoming this limitation, we propose a new design for a genetic barcoding construct based on the Cre Lox system that induces randomly created stable barcodes in cells in situ by exploiting inherent sequence distance constraints during site-specific recombination. Leveraging this previously unused feature, we identify the cassette with maximal code diversity. This proves to be orders of magnitude higher than what is attainable with previously considered Cre Lox barcoding approaches and is well suited for its intended applications as it exceeds the number of lymphocytes or hematopoietic progenitor cells in mice. Moreover, it can be built using established technology.