No loophole; it wasn't a trade. The Brewers waived Shaw and would have released him had the Sox not made the claim.
You can claim someone off waivers in August; that is allowed. In the past (up until 2019), if a player cleared waivers, he could be traded. Now, it's either an outright claim or, if the players clears waivers, he can be released or outrighted to the minors. No players or money change hands.