Support Claude Code non-interactive mode as a provider
Author: DanielFerreiraJorgeCreated Jun 4, 2025Updated Jul 24, 2025
Like opencode, claude code has a non-interactive mode with the "-p" flag. For people that has a Claude MAX subscription, the usage of the opus and sonnet through claude code is virtually limitless (not really, but it is very hard to reach the limit when on the 20x). The MAX subscription does not consume any API credits when using claude code. It would be a nice feature to use "claude -p" as a provider instead of having to configure a anthropic api key, this way people, like me that uses claude code and opus, and want to switch to opencode, can do it without spending extra API credits.
Thanks
Source: opencode-ai/opencode