if i understand correctly, they even have a wrapper around it to make it easier to use: the Claude Agent SDK
the thing that's disallowed is pretending you're the claude binary, logging in through OAuth
in other words, if you use some product thats not Claude Code, and your browser opens asking you to "give Claude Code access to your account", you're in hot water
as for how they detect it: they say they use heuristics and usage patterns. if something falls wildly out of the distribution it's a ban.
my take is that the problem is not the means of detection. that's fine and seems to work well. the problem is that its an instant outright ban. they should give you a couple warning emails, then a timeout, etc.