Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

You can use OpenCode programmatically, thus turning that $200/mo Claude Code account into a very cheap Opus 4.6 API service.

I don't think there's anything really to it past that.



you can also use Claude Code programmatically with the `prompt` parameter in the cli.


And they can ban your account if they think you are doing that. I think someone even commented here on HN they were banned by Anthropic for this.


Why would they have that feature in claude code cli if it goes against the ToS? You can use Claude Code programatically. This is not the issue. The issue is that Anthropic wants to lock you in within their dev ecosystem (like Apple does). Simple as that.


allowed shell pipes doesn't necessarily mean they want loops running them.

One of the economic tuning features of an LLM is to nudge the LLM into reaching conclusions and spending the tokens you want it to spend for the question.

presumably everyone running a form of ralph loop against every single workload is a doomsday situation for LLM providers.


> allowed shell pipes doesn't necessarily mean they want loops running them.

insane that people apologize for this at all. we went from FOSS software being standard to a proprietary cli/tui using proprietary models behind a subscription. how quickly we give our freedom away.


Anthropic itself advertised their own implementation of agentic loop (Ralph plugin). Sure, it worked via their official plugin, but the end result for Anthropic would be the same.

There's nothing in TOS that prevents you from running agentic loops.


I don't know why this is downvoted, see my nephew (?) comment [0] for a longer version, but this is not at all clear IMHO. I'm not sure if a "claude -p" on a cron is allowed or not with my subscription, if I run it on another server is it? Can I parse the output of claude (JSON) and have another "claude -p" instance work on the response? It's only a hop, skip, and a jump over to OpenClaw it seems, which is _not_ allowed. But at what point did we cross the line?

It feels like the only safe thing to do is use Claude Code, which, thankfully, I find tolerable, but unfortunate.

[0] https://news.ycombinator.com/item?id=47446703


is this against their tos or something? what did they expect programmers to do, not automate the automated code-writer?


Or the Python or Typescript Agent SDK libraries: https://platform.claude.com/docs/en/agent-sdk/overview


Or can you? It's my understanding that you cannot use your subscription with the Agent SDK, that's what the docs say:

> Unless previously approved, Anthropic does not allow third party developers to offer claude.ai login or rate limits for their products, including agents built on the Claude Agent SDK. Please use the API key authentication methods described in this document instead.

Though there was that tweet [0] a while back by someone from Anthropic that just muddied the water. It's frustrating because I feel like the line between the Agent SDK and `claude -p` is not that large but one can use the subscription and one can't... or we don't know, the docs seem unambiguous but the tweet confuses things and you can find many people online saying you can, or you can't.

I'd love to play around with the Agent SDK and try out some automations but it seems I can only do that if I'm willing to pay for tokens, even though I could use Claude Code to write the code "for" the Agent SDK, but not "run" the Agent SDK.

Where is the line? Agent SDK is not allowed with subscription, but if I write a harness around passing data to and parsing the JSON response from `claude -p '<Your Prompt>' --output-format json` would that be allowed? If I run it on a cron locally? I literally have no idea and, not wanting my account to be banned, I'm not interested in finding out. I wish they would clarify it.

[0]

Twitter: https://x.com/trq212/status/2024212378402095389

XCancel: https://xcancel.com/trq212/status/2024212378402095389

Text:

> Apologies, this was a docs clean up we rolled out that’s caused some confusion.

> Nothing is changing about how you can use the Agent SDK and MAX subscriptions!

> We want to encourage local development and experimentation with the Agent SDK and claude -p.

> If you’re building a business on top of the Agent SDK, you should use an API key instead. We’ll make sure that’s clearer in our docs.


Yes.

> Unless previously approved, Anthropic does not allow third party developers to offer claude.ai login or rate limits for their products

So you can't offer a product based on the subscription. I replied to a comment proposing to use the CLI with --prompt:

> you can also use Claude Code programmatically with the `prompt` parameter in the cli.

And I just informed that Agent SDK is a much nicer way to do that. For internal use or whatever the ToS allows.


Yea I am this exact boat - it's insane how unclear it is. Why have the -p option at all if they don't want it to be called by other processes?

If they only want people using claude code inside their harness, they could... just remove -p?


> You can use OpenCode programmatically, thus turning that $200/mo Claude Code account into a very cheap Opus 4.6 API service.

Can you explain what you mean by this?


You can easily automate OpenCode - more so than the basic Claude Code or Claude desktop app - in a way that automatically uses the maximum amount of subscription quota every cycle. And in an inefficient way that Anthropic can't cache on their end.

If you know anything about subscription models, you know that ALL of them are built on the fact that most of the users don't use the full capacity available all the time.


Their SDK shows a really basic example that you could build out pretty easily, ironically about Anthropic:

https://opencode.ai/docs/sdk/#structured-output

You can stand up an OpenAI compatible API layer in front of it and just feed the requests back and forth. Adds a little delay, but not much.


Can you show any service that is selling API because they have turned a $200/mo Claude code account into an API service? Give me a break.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: