The Mu2e experiment is designed to search for the charged-lepton-flavor-violating process, 𝜇− to a 𝑒−, with unprecedented sensitivity. The single 105-MeV electron that results from this process can be mimicked by electrons produced by cosmic-ray muons traversing the detector. An active veto detector surrounding the apparatus is used to detect incoming cosmic-ray muons. To reduce the backgrounds to the required level it must have an efficiency of about 99.99\% as well as excellent hermeticity. The detector consists of four layers of scintillator counters, each with two embedded wavelength-shifting fibers, whose light is detected by silicon photomultipliers. An upgrade of the experiment, Mu2e-II, that will provide an order of magnitude more sensitivity is under design. The cosmic-ray veto detector is being redesigned to handle the higher rates. This redesign is also being used for a proposed high-resolution search for hidden chambers in the Great Pyramid of Khufu. The design and expected performance of the detector will be described.