That's not really true. As a US Citizen, on basic legal principle, I believe that once Immigration has established you are a US Citizen, they have to let you leave unless they suspect you of a crime.
Customs is sort of a different issue, they can go through your physical and digital belongings and search you.
Customs is sort of a different issue, they can go through your physical and digital belongings and search you.