How Super Turtle invokes Claude Code
Every interaction — whether from Telegram text, voice, or a SubTurtle loop — spawns theclaude binary as a child process:
What Super Turtle does
- Spawns the
claudebinary as a subprocess with standard CLI flags (-p,--output-format stream-json) - Uses whatever authentication the CLI already has (your logged-in session)
- Reads structured JSON events from stdout
- Manages session IDs for conversation continuity
What Super Turtle does NOT do
- Does NOT extract OAuth tokens from your keychain or credential store for use outside the
claudebinary - Does NOT proxy your subscription credentials to other users, services, or API wrappers
- Does NOT use the Anthropic API or Agent SDK with subscription OAuth tokens — it shells out to the CLI directly
- Does NOT circumvent Claude Code’s rate limiting, usage caps, or billing mechanisms
- Does NOT share or pool credentials across multiple users or accounts
The /usage command
The bot’s /usage command reads your local OAuth token to call Anthropic’s own usage-reporting endpoint:
This is the same endpoint that Claude Code’s built-in
/usage slash command calls. It is read-only — it returns your current usage stats and nothing else. The token is never used for model inference, message sending, or any other purpose.Why this matters
In early 2026, several projects were banned or flagged for extracting Claude Code’s OAuth session tokens and using them with custom API wrappers — effectively getting API-level access through a consumer subscription. Anthropic clarified in their updated consumer terms that using OAuth tokens obtained through Claude subscriptions in any other product or tool is not permitted. Super Turtle avoids this entirely by treating theclaude binary as a black box. It passes prompts in, reads responses out, and never touches the authentication layer.
References
- Claude Code CLI usage — official headless flags (
-p,--output-format, etc.) - Anthropic Consumer Terms — the underlying legal document
- Security Model — how Super Turtle handles the
--dangerously-skip-permissionsflag
