Skip to content

Add claude-code provider: run RLE on a Claude subscription#22

Merged
jkbennitt merged 2 commits into
masterfrom
feat/claude-code-provider
Jun 10, 2026
Merged

Add claude-code provider: run RLE on a Claude subscription#22
jkbennitt merged 2 commits into
masterfrom
feat/claude-code-provider

Conversation

@jkbennitt

Copy link
Copy Markdown
Member

Why

Fable 5 is free on Claude subscriptions through June 22, and claude -p / Agent SDK usage is covered by plans (monthly Agent SDK credits after June 15). RLE previously could only bill an API key. This adds a provider that routes deliberations through headless Claude Code using the machine's existing subscription login.

What

  • ClaudeCodeProvider (src/rle/providers/claude_code.py): flattens [SYSTEM, USER] messages into --system-prompt + stdin, invokes claude -p --output-format json, maps the result envelope to CompletionResult with real token usage.
  • Isolation: neutral temp cwd, --tools "", --setting-sources "", --strict-mcp-config — deliberations see nothing but our prompts. CLAUDECODE, ANTHROPIC_API_KEY, ANTHROPIC_AUTH_TOKEN stripped from the child env (the first crashes nested sessions; the others flip billing to the API).
  • Registered as --provider claude-code in run_scenario.py / run_benchmark.py and RLEConfig.
  • --no-think prefill gate extended to cover this provider.

Verified

  • 420 tests pass (14 new), ruff clean, mypy strict clean.
  • Live one-shot through the provider: Fable 5 responded via subscription auth with correct usage accounting.

🤖 Generated with Claude Code

jkbennitt and others added 2 commits June 9, 2026 20:10
New ClaudeCodeProvider routes deliberations through the Claude Code CLI
in headless print mode (claude -p) instead of the Messages API, billing
the user's Claude plan rather than an API key. Fable 5 is free on
subscriptions through June 22, which makes this the cheapest way to run
the benchmark on it.

The subprocess runs from a neutral temp cwd with --tools "",
--setting-sources "" and --strict-mcp-config so no project CLAUDE.md,
settings, tools, or MCP servers leak into deliberations. CLAUDECODE
(nested-session guard) and ANTHROPIC_API_KEY/ANTHROPIC_AUTH_TOKEN
(would flip billing to the API) are stripped from the child env.
Sampling params are accepted and ignored; the CLI does not expose them.

Registered as --provider claude-code in both CLI scripts; the --no-think
prefill gate now also covers this provider (prefills unsupported).

Co-Authored-By: Claude Fable 5 <[email protected]>
@jkbennitt jkbennitt merged commit 295f478 into master Jun 10, 2026
3 checks passed
@jkbennitt jkbennitt deleted the feat/claude-code-provider branch June 10, 2026 00:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant