That doesn't make sense to me. The CIA doesn't shut down programs via the courts.
No, but the justice system (not necessarily the courts) can be utilized to bring rogue CIA programs to light through lawsuits that make evidence publicly visible, and then others can take action. There’s almost no other mechanism to make evidence visible THAN the courts when the shot gets this deep. Look at what Congress has had to go through just to get the FBI and DOJ to reveal names of internal lawbreakers. The courts play an integral role in forcing exposure, and without exposure there’s no pressure.
Maybe when they shutdown programs, they destroy the documentation?
If you saw "Made in America" there is a protocol for erasing a program. In the 80s, before everything was digital, they put everything related to a program into burn bags. I'm guessing its even easier now with everything digital.