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
Starting June 15, 2026, Claude Agent SDK and claude -p usage no
longer count towards Claude plan usage limits. They will instead charge
a separate Agent SDK monthly credit. See
this article.
Using the harness¶
from milp_flare.harness import ClaudeCodeHarness
harness = ClaudeCodeHarness(model="claude-opus-4-7", 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-4-7", 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.