# Claude Code

URL: https://docs.usestitch.ai/docs/resources/harnesses/claude-code



## Version [#version]

Set `version` explicitly to pin a release, for example `2.1.287`.

The release must be available upstream and work with the harness adapter.

## Model and Effort [#model-and-effort]

Set both `model` and `effort` to non-empty strings. Stitch does not check a model
catalog or supported combinations. Claude Code reports unsupported values so you
can correct the configuration.

Use `effort: default` to let the CLI choose. Other values are passed as `--effort`.
See [Claude Code effort levels](https://code.claude.com/docs/en/model-config#adjust-effort-level).

Custom Microsoft Foundry deployment names are also supported with `azure_foundry_api_key`
or `azure_foundry_auth_token`.

## Authentication [#authentication]

Use exactly one auth method. Store the credential as a
[Stitch secret](/docs/resources/secrets) and reference it with `secretName`.

| Auth method                   | Credential                                                  | Required harness environment                                 |
| ----------------------------- | ----------------------------------------------------------- | ------------------------------------------------------------ |
| `claude_subscription_token`   | Claude subscription token                                   | None                                                         |
| `anthropic_api_key`           | [Anthropic API key](https://console.anthropic.com/)         | None                                                         |
| `aws_bedrock_api_key`         | Amazon Bedrock API key from the AWS console                 | `AWS_REGION` or `AWS_DEFAULT_REGION`                         |
| `gcp_application_credentials` | Google Cloud service account JSON key with Vertex AI access | `ANTHROPIC_VERTEX_PROJECT_ID`; optional `CLOUD_ML_REGION`    |
| `azure_foundry_api_key`       | API key from your Microsoft Foundry resource                | `ANTHROPIC_FOUNDRY_RESOURCE` or `ANTHROPIC_FOUNDRY_BASE_URL` |
| `azure_foundry_auth_token`    | Microsoft Entra bearer token for your Foundry resource      | `ANTHROPIC_FOUNDRY_RESOURCE` or `ANTHROPIC_FOUNDRY_BASE_URL` |

Renew subscription and Entra tokens before they expire.

### Claude subscription authentication [#claude-subscription-authentication]

Import a subscription token with `stitch secrets import claude --name CLAUDE_SUBSCRIPTION`,
then reference it in your Claude harness:

```yaml title="stitch-factory.yaml"
harnesses:
  - key: coding-agent
    name: Claude subscription
    type: claude_code
    model: claude-sonnet-4-6
    effort: default
    version: 2.1.287
    auth:
      - method: claude_subscription_token
        secretName: CLAUDE_SUBSCRIPTION
```

Subscription runs use the pinned official Claude CLI in headless mode inside the sandbox,
with no additional SDK or JavaScript runtime requirement. API-key and cloud-provider
authentication use the same CLI execution path. Use exactly one auth method;
do not combine subscription auth with API keys, router endpoints, or cloud-provider settings.

Subscription-token runs draw from your Claude plan's usage limits, not API credits.
To use separately claimed Max or Team API credits, use `anthropic_api_key` from the linked
Console organization instead. No automatic billing fallback occurs.
