Mutually beneficial agreements might fail if the parties fear contractual opportunism. Litigation is supposed to be a remedy, but gives scope for another kind of opportunistic behavior which we call litigational opportunism: Even knowing that the opponent has fulfilled his obligations, a party might bring suit. We introduce a new concept, called judicial detection skill, and show that positive judicial detection skill is a prerequisite if the court system is to deter opportunistic suits and simultaneously induce bilateral contractual compliance. The traditional literature on litigation either assumes judges with zero detection skill, or simply neglects that opportunistic suits might be successful. We prove that those models are unable to provide an answer to the question of how to prevent both types of opportunism simultaneously.