Skip to content

[ENHANCEMENT] Add Claude Subscription (Claude Code) provider #756

Description

@edelauna

Problem

Users with Claude Pro/Max/Team/Enterprise subscriptions have no way to use Zoo Code without an Anthropic API key. The Claude CLI already supports a headless/programmatic mode via @anthropic-ai/claude-agent-sdk that authenticates through the user's local claude login session — the same mechanism Cline uses for its Claude Code provider.

Context

This affects any Zoo Code user who already pays for a Claude subscription and would prefer not to manage a separate API key. The @anthropic-ai/claude-agent-sdk query() function streams typed SDKMessage events and exposes full token usage via SDKResultSuccess, making it straightforward to integrate with Zoo Code's existing ApiStream / ApiStreamUsageChunk pattern.

Billing note: Anthropic paused the Agent SDK credit split (which would have moved claude -p usage to a separate credit pool) on June 15, 2026 — the day it was due to take effect. As of now, Agent SDK usage still draws from the user's normal subscription. The UI should note this may change.

Desired behavior

  • A "Claude Code (Subscription)" provider option in Zoo Code's provider picker
  • No API key field — authentication handled externally via claude login
  • Token usage tracked and displayed (input/output/cache); totalCost: 0 for subscription sessions
  • Optional CLI binary path override for enterprise environments
  • Subscription tier (Pro/Max/Team/Enterprise) surfaced in a usage dashboard

Constraints

  • Do not add any upsell, cloud-sync, or notification surfaces
  • Follow the same patterns as the existing OpenAI Codex subscription provider
  • Each sub-issue ships as its own PR for focused review

Acceptance criteria

Given a user with claude login completed, when they select the Claude Code provider, Zoo Code routes requests through the local CLI with no API key required.

Given a completed request, Zoo Code displays accurate input/output/cache token counts and shows $0.00 cost for subscription sessions.

Given the CLI is not found, Zoo Code shows a clear error with instructions to install and authenticate.

Sub-issues

Story point estimate: Epic

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions