As noted, the IRS levy has priority over your fee. (Because they say so, not because there is a law or regulation that says so.)
Most other third party claims are driven by state law and my experience is they frequently have unique answers. For example, in one state that I deal with if the claim is an attachment supported by a court order it would be "contempt" for you to take your fee first.
Generic answers are no good here. Research your question based on the type of claim you receive.
_________________________
In this world you must be oh so smart or oh so pleasant. Well, for years I was smart. I recommend pleasant.