Skip to content

Preflight rejects the Claude Code subscription path: --no-deploy run fails with "ANTHROPIC_API_KEY MISSING" despite "Brain ok — riding your Claude Code login" #16

Description

@ciprianmelian

The outer environment check (bin/explainmyrepo.mjs:166) and the brain client (src/claude.mjs) both support running the brain stations on a logged-in Claude Code install with no API key — callClaude() auto-selects claude -p when no key is set, and the help text advertises this. But the orchestrator's credential preflight never learned about that path:

// src/orchestrator.mjs:160
if (brainIds.some((id) => ids.has(id)) && !has(['ANTHROPIC_API_KEY', 'CLAUDE_API_KEY'])) {

Repro: on a machine with a logged-in Claude Code CLI and no ANTHROPIC_API_KEY:

npx explainmyrepo https://github.com/PrimeIntellect-ai/prime-agent --no-deploy

→ the first preflight prints ✓ Brain ok — no API key, riding your Claude Code login, then the station preflight aborts with MISSING ANTHROPIC_API_KEY … nothing was built.

Fix (verified locally against 0.5.0 — build proceeds through the stations on the CLI brain):

-import { resolveModel } from './claude.mjs';
+import { resolveModel, claudeCliAvailable } from './claude.mjs';
...
-  if (brainIds.some((id) => ids.has(id)) && !has(['ANTHROPIC_API_KEY', 'CLAUDE_API_KEY'])) {
+  if (brainIds.some((id) => ids.has(id)) && !has(['ANTHROPIC_API_KEY', 'CLAUDE_API_KEY']) && !claudeCliAvailable()) {

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions