California Penal Code
(a) In each felony case in which the charges contained in the original accusatory pleading are amended or dismissed, the record shall contain a statement explaining the reason for the amendment or dismissal.
(b) In each felony case in which the prosecuting attorney seeks a dismissal of a charge in the complaint, indictment, or information, he or she shall state the specific reasons for the dismissal in open court, on the record.
(c) When, upon a plea of guilty or nolo contendere to an accusatory pleading charging a felony, whether or not that plea is entered pursuant to Section 1192.5, the prosecuting attorney recommends what punishment the court should impose or how it should exercise any of the powers legally available to it, the prosecuting attorney shall state the specific reasons for the recommendation in open court, on the record. The reasons for the recommendation shall be transcribed and made part of the court file.