By definition, it is exactly a law. It's known as business law. The ToS is a business contract which you must agree to if you wish to use the service. Violating terms of service is literally a breach of contract.
How can you breach a contract if you are not a party to a contract? OpenCode is not using any Anthropic services, they are just publishing some source code that seems (obligatory IANAL) to be protected speech under the First Amendment [0], if this legal argument is happening in American jurisdiction.
Interesting point. I've been looking into a similar issue recently, and for example LinkedIn won a lawsuit against the analytics company hiQ because they violated their ToS for scraping their website. And I think they also never technically had a direct contract they'd breach.
Yeah good point. I think if the scraping code is written specifically for a site / system that prohibits scraping through it's ToS, the company has an edge for a lawsuit. It's a bit of a gray area I think. It depends how much of a threat you form to the company you're scraping, and how big the company is.