Claude Code¶
The Claude Code harness runs Anthropic’s
Claude Code CLI inside the FLARE Docker
container, billing usage against your Claude subscription via a
long-lived OAuth token.
Choosing a plan¶
Claude Code is included with every paid Claude plan. Compare plans and pick one that covers your expected usage at Choose a Claude plan, then monitor your consumption at Usage.
Authenticating for FLARE¶
Generate a long-lived OAuth token following these instructions:
claude setup-token
Save the printed token to a .env file in your project as:
CLAUDE_CODE_OAUTH_TOKEN=sk-ant-oat01-...
FLARE forwards this token into the Docker container at run time. The token
bills against your Claude plan rather than the API.
Warning
There are plans to migrate the Claude Agent SDK and claude -p non-interactive usage to no longer count towards Claude plan usage limits. This was originally planned for June 15, 2026. It has been delayed to a later date. See this article.
Using the harness¶
from milp_flare.harness import ClaudeCodeHarness
harness = ClaudeCodeHarness(model="claude-opus-5", effort="medium")
Or via the HARNESSES registry (convenient for config-driven
experiment scripts):
from milp_flare import HARNESSES
harness = HARNESSES["claude_code"](model="claude-opus-5", effort="medium")
Cost tracking¶
The Claude Code CLI JSON output stream reports per-run USD directly. This is used to populate cost_usd in HarnessRunResult.