The main problem for me is that afaik the only agent that works with Claude Max subscription is Claude Code.

I believe opencode also uses Claude Max somehow - https://github.com/sst/opencode

It does indeed! Thanks for the link. Tried it today and it worked great.