Skip to content
2 changes: 1 addition & 1 deletion .claude/skills/consult/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ The `-m` / `--model` flag is **always required** except for `consult stats`.

`consult` loads `<workspace>/.env` and sets every key the shell does not already define, **credentials included**. A key exported in the shell wins over `.env`.

- claude: the lane runs your installed `claude` on its own login, which for most people is the subscription. `ANTHROPIC_API_KEY` and `ANTHROPIC_AUTH_TOKEN` are withheld from it, from the shell or `.env`, unless config sets `"consult": { "claudeAuth": "api-key" }` (CI and key-only machines). `CLAUDE_CODE_OAUTH_TOKEN` is a login, so it passes through and beats the keychain login. A missing `claude`, one older than 2.1.141, or a logged-out one fails the lane with the command to run.
- claude: the lane runs your installed `claude` on its own login, which for most people is the subscription. `ANTHROPIC_API_KEY` and `ANTHROPIC_AUTH_TOKEN` are withheld from it, from the shell or `.env`, unless config sets `"consult": { "claudeAuth": "api-key" }` (CI and key-only machines). That is a billing guarantee, not secrecy: the reviewer can still read the workspace `.env` with its Read tool. `CLAUDE_CODE_OAUTH_TOKEN` is a login, so it passes through and beats the keychain login. A missing `claude`, one older than 2.1.141, or a logged-out one fails the lane with the command to run.
- codex: `CODEX_API_KEY` beats the ChatGPT login. `OPENAI_API_KEY` is ignored.

The claude and codex lanes print what they authenticate with, e.g. `[CLAUDE] auth: claude.ai (max) — stored claude login; ignoring ANTHROPIC_API_KEY (from .env) — set consult.claudeAuth to "api-key" to bill the API instead`. If a review fails with a usage-limit or auth error while your own login works, check that line first.
Expand Down
2 changes: 1 addition & 1 deletion .codex/skills/consult/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ The `-m` / `--model` flag is **always required** except for `consult stats`.

`consult` loads `<workspace>/.env` and sets every key the shell does not already define, **credentials included**. A key exported in the shell wins over `.env`.

- claude: the lane runs your installed `claude` on its own login, which for most people is the subscription. `ANTHROPIC_API_KEY` and `ANTHROPIC_AUTH_TOKEN` are withheld from it, from the shell or `.env`, unless config sets `"consult": { "claudeAuth": "api-key" }` (CI and key-only machines). `CLAUDE_CODE_OAUTH_TOKEN` is a login, so it passes through and beats the keychain login. A missing `claude`, one older than 2.1.141, or a logged-out one fails the lane with the command to run.
- claude: the lane runs your installed `claude` on its own login, which for most people is the subscription. `ANTHROPIC_API_KEY` and `ANTHROPIC_AUTH_TOKEN` are withheld from it, from the shell or `.env`, unless config sets `"consult": { "claudeAuth": "api-key" }` (CI and key-only machines). That is a billing guarantee, not secrecy: the reviewer can still read the workspace `.env` with its Read tool. `CLAUDE_CODE_OAUTH_TOKEN` is a login, so it passes through and beats the keychain login. A missing `claude`, one older than 2.1.141, or a logged-out one fails the lane with the command to run.
- codex: `CODEX_API_KEY` beats the ChatGPT login. `OPENAI_API_KEY` is ignored.

The claude and codex lanes print what they authenticate with, e.g. `[CLAUDE] auth: claude.ai (max) — stored claude login; ignoring ANTHROPIC_API_KEY (from .env) — set consult.claudeAuth to "api-key" to bill the API instead`. If a review fails with a usage-limit or auth error while your own login works, check that line first.
Expand Down
2 changes: 1 addition & 1 deletion INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ When a user requests Codev installation, check if the consultation tools are ava
command -v consult >/dev/null && echo "✓ consult CLI available" || echo "✗ consult CLI not found"
```

**Note**: The `consult` CLI is installed with `npm install -g @cluesmith/codev`. Multi-agent consultation requires at least one of: `claude`, `gemini-cli`, or `codex`.
**Note**: The `consult` CLI is installed with `npm install -g @cluesmith/codev`. Multi-agent consultation requires at least one of: `claude`, `gemini-cli`, or `codex`. The `claude` lane runs your installed `claude` CLI, which must be version 2.1.141 or newer (`claude --version`).

### Step 2: Create and Populate the Codev Directory

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ On Linux and WSL, also install `build-essential` and `python3` (node-pty compile
**Windows:** two paths. **Native** (preview): Node.js 22 or 24 (x64 or ARM64), [Git for Windows](https://git-scm.com/download/win) and `jq`, no admin rights or Developer Mode needed. **WSL 2**: follow the Linux instructions inside your distribution. See [DEPENDENCIES.md](codev-skeleton/DEPENDENCIES.md#windows) for setup and limitations, including why native support is a preview (#1911).

**AI CLIs** (install all three for multi-model consultation):
- Claude Code: `npm install -g @anthropic-ai/claude-code`
- Claude Code: `curl -fsSL https://claude.ai/install.sh | bash`, or `npm install -g @anthropic-ai/claude-code`. The `claude` consult lane runs this CLI and needs version 2.1.141 or newer.
- Antigravity CLI (`agy`, the `gemini` consult lane): `curl -fsSL https://antigravity.google/cli/install.sh | bash`, then run `agy` once to sign in (OAuth — replaces the retired Gemini CLI)
- Codex CLI: `npm install -g @openai/codex`

Expand Down
2 changes: 1 addition & 1 deletion codev-skeleton/.claude/skills/consult/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ The `-m` / `--model` flag is **always required** except for `consult stats`.

`consult` loads `<workspace>/.env` and sets every key the shell does not already define, **credentials included**. A key exported in the shell wins over `.env`.

- claude: the lane runs your installed `claude` on its own login, which for most people is the subscription. `ANTHROPIC_API_KEY` and `ANTHROPIC_AUTH_TOKEN` are withheld from it, from the shell or `.env`, unless config sets `"consult": { "claudeAuth": "api-key" }` (CI and key-only machines). `CLAUDE_CODE_OAUTH_TOKEN` is a login, so it passes through and beats the keychain login. A missing `claude`, one older than 2.1.141, or a logged-out one fails the lane with the command to run.
- claude: the lane runs your installed `claude` on its own login, which for most people is the subscription. `ANTHROPIC_API_KEY` and `ANTHROPIC_AUTH_TOKEN` are withheld from it, from the shell or `.env`, unless config sets `"consult": { "claudeAuth": "api-key" }` (CI and key-only machines). That is a billing guarantee, not secrecy: the reviewer can still read the workspace `.env` with its Read tool. `CLAUDE_CODE_OAUTH_TOKEN` is a login, so it passes through and beats the keychain login. A missing `claude`, one older than 2.1.141, or a logged-out one fails the lane with the command to run.
- codex: `CODEX_API_KEY` beats the ChatGPT login. `OPENAI_API_KEY` is ignored.

The claude and codex lanes print what they authenticate with, e.g. `[CLAUDE] auth: claude.ai (max) — stored claude login; ignoring ANTHROPIC_API_KEY (from .env) — set consult.claudeAuth to "api-key" to bill the API instead`. If a review fails with a usage-limit or auth error while your own login works, check that line first.
Expand Down
2 changes: 1 addition & 1 deletion codev-skeleton/.codex/skills/consult/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ The `-m` / `--model` flag is **always required** except for `consult stats`.

`consult` loads `<workspace>/.env` and sets every key the shell does not already define, **credentials included**. A key exported in the shell wins over `.env`.

- claude: the lane runs your installed `claude` on its own login, which for most people is the subscription. `ANTHROPIC_API_KEY` and `ANTHROPIC_AUTH_TOKEN` are withheld from it, from the shell or `.env`, unless config sets `"consult": { "claudeAuth": "api-key" }` (CI and key-only machines). `CLAUDE_CODE_OAUTH_TOKEN` is a login, so it passes through and beats the keychain login. A missing `claude`, one older than 2.1.141, or a logged-out one fails the lane with the command to run.
- claude: the lane runs your installed `claude` on its own login, which for most people is the subscription. `ANTHROPIC_API_KEY` and `ANTHROPIC_AUTH_TOKEN` are withheld from it, from the shell or `.env`, unless config sets `"consult": { "claudeAuth": "api-key" }` (CI and key-only machines). That is a billing guarantee, not secrecy: the reviewer can still read the workspace `.env` with its Read tool. `CLAUDE_CODE_OAUTH_TOKEN` is a login, so it passes through and beats the keychain login. A missing `claude`, one older than 2.1.141, or a logged-out one fails the lane with the command to run.
- codex: `CODEX_API_KEY` beats the ChatGPT login. `OPENAI_API_KEY` is ignored.

The claude and codex lanes print what they authenticate with, e.g. `[CLAUDE] auth: claude.ai (max) — stored claude login; ignoring ANTHROPIC_API_KEY (from .env) — set consult.claudeAuth to "api-key" to bill the API instead`. If a review fails with a usage-limit or auth error while your own login works, check that line first.
Expand Down
35 changes: 28 additions & 7 deletions codev-skeleton/resources/commands/consult.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,21 @@ picks what the lane bills:
- What passes through in `login` mode, what the auth line says, and how the lane fails are in
[Claude auth: subscription vs. metered API](#claude-auth-subscription-vs-metered-api).

### `consult.claudeMaxTurns` and `consult.claudeMaxBudgetUsd`

The claude lane caps each review at 200 turns (`--max-turns`) and $25 (`--max-budget-usd`). On a
subscription login the dollars are notional: the CLI still counts them, so a large review can
reach the budget cap without any real spend. Raise either cap here:

```json
{ "consult": { "claudeMaxTurns": 400, "claudeMaxBudgetUsd": 100 } }
```

- `claudeMaxTurns` must be a positive whole number; `claudeMaxBudgetUsd` a positive number (it may
be fractional). Any other value is an error at config load.
- A review that reaches a cap fails, and the message names the cap and the key to raise:
`The review reached the $25 budget cap. To allow more, raise consult.claudeMaxBudgetUsd in .codev/config.json.`

### `consult.pricing.codex`

Per-1M-token rates for the codex lane. Set this when Codev has no rates for the model you run
Expand Down Expand Up @@ -250,6 +265,7 @@ offending key and the valid alternatives. Nothing falls back to a default on err
| Model ids | **The provider** | When the lane runs |
| `codexPath` | **Codev**: absolute-path syntax, then `<path> --version` | Syntax at config load; a binary that doesn't run, when the codex lane starts |
| `claudeAuth` | **Codev**, against a closed enum (`login`, `api-key`) | Config load, before anything runs |
| `claudeMaxTurns`, `claudeMaxBudgetUsd` | **Codev**: a positive whole number, a positive number | Config load, before anything runs |

Codev checks a model id's *syntax* only (ASCII alphanumerics plus `. _ : / @ + -`, 1–200 characters,
no leading punctuation) — never its existence. **There is no allowlist of model ids anywhere in
Expand Down Expand Up @@ -483,6 +499,9 @@ your Claude subscription, for most people. That is `consult.claudeAuth: "login"`
`claude` child in `login` mode, whether they come from the shell or from `<workspace>/.env`.
Before #1912, an `ANTHROPIC_API_KEY` in `.env` (there for app code, say) billed review traffic
to the metered API unless an OAuth token was also set (#985 covered only that case).
**This is a billing guarantee, not secrecy.** The reviewer runs in the workspace with a Read
tool, so it can still read the workspace `.env`, key included, as the Agent SDK lane before it
could.
- **What passes through:** `CLAUDE_CODE_OAUTH_TOKEN` (a `claude setup-token` subscription token,
which is a login rather than API billing), and explicit provider and routing configuration
(`CLAUDE_CODE_USE_BEDROCK`, `CLAUDE_CODE_USE_VERTEX`, …, `ANTHROPIC_BASE_URL`, proxies).
Expand Down Expand Up @@ -523,33 +542,35 @@ That one config line is the fix.

| Condition | What to do |
|---|---|
| `claude` is not on `PATH` | Install it (`curl -fsSL https://claude.ai/install.sh \| bash`), or set `CODEV_CLAUDE_BIN` |
| `claude` is not on `PATH` | Install it (`curl -fsSL https://claude.ai/install.sh \| bash`, or `npm install -g @anthropic-ai/claude-code` where the native installer cannot run), or set `CODEV_CLAUDE_BIN` |
| `CODEV_CLAUDE_BIN` is not an executable file | Fix the path. Codev does not fall back to `PATH` |
| Older than 2.1.141, or a version it cannot parse | `claude update`, or `npm install -g @anthropic-ai/claude-code@latest` for an npm install |
| `claude auth status` reports no login | `claude auth login` |
| `claude auth status` reports no login | `claude auth login`; in `api-key` mode, check the key, or remove `consult.claudeAuth` |
| `api-key` mode with neither key set | Set one, or remove `consult.claudeAuth` |

It never falls back to another credential or to another `claude`. A run that fails before the
auth status is known prints no auth line; its message is the explanation.

Once the review runs, an error result (a usage limit, an invalid or expired credential) fails the
run with no output file, and the message names the credential in use. A reviewer that fills its
run with no output file, and the message names the credential in use. When the result says the
session is not logged in, the message adds the remedy for the auth mode, as the preflight does. A reviewer that fills its
context window ("Prompt is too long") fails with a message naming the model and #1641; consult
does not retry. A successful result with no review text fails too, since it has no VERDICT. Every
failure after the preflight also names the binary that ran, so an old or unexpected `claude` is
visible:

```
Claude CLI error (error_max_budget_usd). The review reached the $25 budget cap.
Claude CLI error (error_max_budget_usd). The review reached the $25 budget cap. To allow more, raise consult.claudeMaxBudgetUsd in .codev/config.json.

The claude lane ran /Users/you/.local/bin/claude, 2.1.326 (from PATH).
```

**Read-only, isolated, and safe to nest.** The reviewer session has only Read, Glob and Grep: no
edit, shell, web or MCP tools. Consult checks the tool list the session reports when it starts,
and stops the review unless it is exactly those three. If a `claude` release changes the session's
tools, every review stops; pin a known-good `claude` with `CODEV_CLAUDE_BIN` until Codev catches up.
It has a 200-turn cap and a $25 budget cap. It loads none of your
and stops the review unless it is exactly those three (a tool listed twice is fine). If a `claude`
release changes the session's tools, every review stops; pin a known-good `claude` with
`CODEV_CLAUDE_BIN` until Codev catches up. It has a 200-turn cap and a $25 budget cap, both
configurable ([`consult.claudeMaxTurns` and `consult.claudeMaxBudgetUsd`](#consultclaudemaxturns-and-consultclaudemaxbudgetusd)). It loads none of your
settings files, hooks, plugins, MCP servers or CLAUDE.md, and its sessions are not saved, so
reviews do not fill `claude --resume`. Claude Code's session markers (`CLAUDECODE` and related
variables) are removed from the child's environment, so consult works from inside a Claude Code
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
id: bugfix-1941
title: consult-claude-lane-five-follo
protocol: bugfix
phase: fix
plan_phases: []
current_plan_phase: null
gates:
pr:
status: pending
iteration: 1
build_complete: false
history: []
started_at: '2026-11-21T01:36:42.606Z'
updated_at: '2026-11-21T02:19:57.084Z'
pr_history:
- phase: fix
pr_number: 1942
branch: builder/bugfix-1941
created_at: '2026-11-21T02:19:57.083Z'
2 changes: 1 addition & 1 deletion codev/resources/arch.md
Original file line number Diff line number Diff line change
Expand Up @@ -2122,7 +2122,7 @@ consult -m claude spec 42
|-------|-----------|----------------|-------------|
| gemini | `agy` (Antigravity CLI; resolved real bin, not the IDE symlink) | Folded into the prompt (role + query) | OAuth / subscription (no API key) |
| codex | `codex` | Temp file via `-c experimental_instructions_file=` flag | `OPENAI_API_KEY` |
| claude | the installed `claude` CLI (`CODEV_CLAUDE_BIN` pin, else `PATH`; floor 2.1.141, Spec 1912) | Role + claude-lane capability note via `--system-prompt-file` | The CLI's own login (subscription for most). `ANTHROPIC_API_KEY`/`ANTHROPIC_AUTH_TOKEN` are withheld unless `consult.claudeAuth: "api-key"` |
| claude | the installed `claude` CLI (`CODEV_CLAUDE_BIN` pin, else `PATH`; floor 2.1.141, Spec 1912) | Role + claude-lane capability note via `--system-prompt-file` | The CLI's own login (subscription for most). `ANTHROPIC_API_KEY`/`ANTHROPIC_AUTH_TOKEN` are withheld unless `consult.claudeAuth: "api-key"`: a billing guarantee, not secrecy (the reviewer can still Read the workspace `.env`). Caps: `consult.claudeMaxTurns` (200) and `consult.claudeMaxBudgetUsd` ($25) |

**Query building**: Five subcommands (`pr`, `spec`, `plan`, `impl`, `general`) each build a prompt that includes the spec/plan/diff content plus a verdict template (`VERDICT: [APPROVE | REQUEST_CHANGES | COMMENT]`). PR diffs truncated to 50k chars, impl diffs to 80k chars.

Expand Down
Loading
Loading