trading_agent.doctor.checks.claude_code_backend_check
¶
Checks that Claude Code is installed and can use the Max subscription.
The subscription is used through a token from claude setup-token. An ANTHROPIC_API_KEY in the environment would make Claude Code bill the API instead, so its presence is a failure.
Typical usage example:
result = ClaudeCodeBackendCheck('claude', secrets).run()
ClaudeCodeBackendCheck
¶
Bases: DoctorCheck
Checks one backend of kind "claude_code".
Creates the check.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
backend_name
|
str
|
The backend's name in trading_agent.toml. |
required |
secrets
|
Secrets
|
The secrets read from the environment and .env. |
required |
Source code in src/trading_agent/doctor/checks/claude_code_backend_check.py
run
¶
Checks the CLI, the absence of an API key, and the subscription token.
Returns:
| Type | Description |
|---|---|
CheckResult
|
OK when everything is ready, a warning when only the token is missing, failed otherwise. |