Skip to content

consult: run the claude review lane through the installed claude CLI instead of the Agent SDK, on the user's subscription #1912

Closed

Description

@waleedkadous

Problem

Consult's claude review lane runs through @anthropic-ai/claude-agent-sdk (since Spec 0103). Two recurring costs:

Owner direction (2026-11-17): move away from the Agent SDK and go back to the claude command line tool, and for most people it should use the subscription.

Baked Decisions (architect, on the owner's ruling)

  1. The claude lane invokes the user's installed claude CLI in non-interactive print mode. The Agent SDK dependency is removed from packages/codev once nothing else imports it (check persona, dev:local and any other caller first; if another caller needs it, say so before removing).
  2. Subscription by default. The lane uses the CLI's own login. ANTHROPIC_API_KEY / ANTHROPIC_AUTH_TOKEN from the environment or .env must not reach the child process by default, so a stray key cannot silently switch billing to API tokens. API-key billing is available only as an explicit opt-in in .codev/config.json (for CI and key-only environments). The lane logs which auth it is using, as today.
  3. Fail fast, no fallbacks: if claude is missing, too old, or not logged in, the lane fails loudly with what to do. It never falls back to the SDK or to an API key.
  4. Reviewer stays read-only: the same tool allowance as today (Read, Glob, Grep), no edits, no shell. Keep the turn cap and a cost or budget cap if the CLI supports one; if it does not, say so in the spec.
  5. Keep what callers rely on: model selection and the per-lane model override, --output, the VERDICT format, and consultation_metrics rows (duration, tokens, cost, exit code, model id) taken from the CLI's structured output.
  6. Handle the nested-session guard (CLAUDECODE and related env) so the lane works when consult is run from inside a Claude Code session, which is the normal case.
  7. codev doctor, the consult skill and CLAUDE.md/AGENTS.md wording are updated in every tree they ship in.

Open questions for the spec

Testing

Unit tests with a stubbed claude executable for: argument construction, env scrubbing (key present in env and in .env, opt-in on and off), missing or failing CLI, metrics parsing. One live review from a worktree build, on the subscription, with the auth line shown in the PR. No live model calls in the unit suite.

Machine-load rule from the owner: run only the test files you touch while iterating, the full suite once per porch check, and never synthetic load or the local e2e suite.

Activity

  1. added
    area/consult
    on Nov 17, 2026
  2. added 3 commits that reference this issue on Nov 17, 2026
  3. added a commit that references this issue on Nov 17, 2026
  4. added 2 commits that reference this issue on Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/consult

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions