You have to clear your bags through customs at the 1st point of arrival to the US.
If you're transferring, there is usually a system where you pick up the bag , run it through customs and get rid of it almost immediately onto a conveyor belt on the other side
The main point is that your bags have to clear US customs at the 1st point of arrival, provided your final destination is also USA. If youre transferring in the US but your final destination is outside USA, then there is no need