Follow Discord
Sweep 22 Oct 2026 · 04:32Z Build v2.1.308 527 read Stable v2.1.308 Latest v2.1.308 Next v2.1.308 Feeds RSS JSON llms.txt llms-full.txt Unofficial
HomeDocsSearch
Search the documentation

368 pages for /code.

Titles and paths first, then pages whose text carries it. Each row opens that page as this site last read it.

home Claude Developer Platform · in the page home …e" href="https://platform.claude.com/docs/en/agents-and-tools/tool-use/code-execution-tool"> Code execution </HomeJourneyLink> <HomeJourneyLink icon="database" href="h… access-transparency Claude Developer Platform · in the page manage-claude/access-transparency …ude.com/docs/en/manage-claude/cmek) * [Claude Code data usage](https://code.claude.com/docs/en/data-usage) * [Trust Center](https://trust.anthropic.com/resources) admin-api Claude Developer Platform · in the page manage-claude/admin-api …s "id: #{organization.id}" puts "name: #{organization.name}" ``` </CodeGroup> An `org:admin` token grants access to the whole organization, regardless of the workspace the underlying profile or [… api-and-data-retention Claude Developer Platform · in the page manage-claude/api-and-data-retention …ablement by Anthropic. See the [Claude Code ZDR documentation](https://code.claude.com/docs/en/zero-data-retention), which applies to Claude Enterprise organizations only. * **Claude for Excel:** Not… authentication Claude Developer Platform · in the page manage-claude/authentication …EY set in the environment: anthropic = Anthropic::Client.new ``` </CodeGroup> ### Select a workspace API keys that are created for a specific workspace only work in that workspace, and API reque… First request Claude Developer Platform · in the page manage-claude/claude-code-analytics-api …ime monitoring, consider using the [OpenTelemetry integration](https://code.claude.com/docs/en/monitoring-usage). ### How are users identified in the data? Users are identified through the `actor` f… cmek Claude Developer Platform · in the page manage-claude/cmek …terms for using them. * Claude Code cannot [publish artifacts](https://code.claude.com/docs/en/artifacts#availability). However, artifacts made in chat or Cowork can be shared within your organization… cmek-aws-kms Claude Developer Platform · in the page manage-claude/cmek-aws-kms …ay_name: #{external_key.display_name}" ``` </CodeGroup> The `id` field of the response contains the external key ID. Copy it for the next two steps:… cmek-azure-key-vault Claude Developer Platform · in the page manage-claude/cmek-azure-key-vault …ay_name: #{external_key.display_name}" ``` </CodeGroup> The `id` field of the response contains the external key ID. Copy it for the next two steps:… cmek-google-cloud-kms Claude Developer Platform · in the page manage-claude/cmek-google-cloud-kms …ay_name: #{external_key.display_name}" ``` </CodeGroup> The `id` field of the response contains the external key ID. Copy it for the next two steps:… compliance-api Claude Developer Platform · in the page manage-claude/compliance-api …work-activity-with-opentelemetry) and [Claude Code monitoring](https://code.claude.com/docs/en/monitoring-usage) stream per-event telemetry, including token, cost, and host metadata, to a collector yo… WARNING: This operation PERMANENTLY deletes the chat, all of its messages, Claude Developer Platform · in the page manage-claude/compliance-content-data …ode artifacts](https://platform.claude.com/docs/en/api/compliance/apps/code/artifacts/list), with `artifact_type` set to `claude_docs`. A document's `versions` list is empty and its `published_version… compliance-faq Claude Developer Platform · in the page manage-claude/compliance-faq …Cloud, or Microsoft Foundry), and [Claude Code cloud sessions](https://code.claude.com/docs/en/claude-code-on-the-web), which run on cloud infrastructure instead of the user's machine, are not capture… before_id is the first_id from a previous response Claude Developer Platform · in the page manage-claude/compliance-integration-patterns …or Microsoft Foundry), or run in a [Claude Code cloud session](https://code.claude.com/docs/en/claude-code-on-the-web), which runs on cloud infrastructure instead of the user's machine. * Local sessio… compliance-sessions Claude Developer Platform · in the page manage-claude/compliance-sessions …le Cloud, or Microsoft Foundry. * [Claude Code cloud sessions](https://code.claude.com/docs/en/claude-code-on-the-web) (including Claude Code routines that run in the cloud), which run on cloud infras… data-residency Claude Developer Platform · in the page manage-claude/data-residency …ly ran puts "Inference geo: #{response.usage.inference_geo}" ``` </CodeGroup> ### Response The response `usage` object includes an `inference_geo` field indicating where inference ran: ```text… inference-hooks Claude Developer Platform · in the page manage-claude/inference-hooks …to the input field. `/clear` starts over. See [Checkpointing](https://code.claude.com/docs/en/checkpointing). * **Cowork.** The user edits the denied message if it is their latest one. The edit resen… inference-hooks-endpoint Claude Developer Platform · in the page manage-claude/inference-hooks-endpoint …response.body = '{"action": "allow"}' end server.start ``` </CodeGroup> <Note> These servers accept every request, including unsigned ones. Add [signature verification](https://platform.c… opentelemetry Claude Developer Platform · in the page manage-claude/opentelemetry …e Code, the Agent SDK, or Cowork, see [Claude Code monitoring](https://code.claude.com/docs/en/monitoring-usage), [Agent SDK observability](https://code.claude.com/docs/en/agent-sdk/observability), or… api Claude Developer Platform · in the page manage-claude/opentelemetry/api …only}, workspaces: {type: :all} ) puts destination.id ``` </CodeGroup> A create request takes the Console's settings except **Provider**, so enter your observability platform's endpoint UR… sdk Claude Developer Platform · in the page manage-claude/opentelemetry/sdk …<version>3.1.0</version> </dependency> ``` </CodeGroup> If your application doesn't use the OpenTelemetry SDK yet, install it with a console exporter, which you use in t… organization-webhooks Claude Developer Platform · in the page manage-claude/organization-webhooks …ts "#{endpoint.id}: #{endpoint.url} (#{endpoint.state})" end ``` </CodeGroup> With no endpoints, the API returns an empty list: ```text wrap { "data": [], "has_more": false } ``` A list ret… plugins-api Claude Developer Platform · in the page manage-claude/plugins-api …each do |plugin| puts "#{plugin.id}: #{plugin.name}" end ``` </CodeGroup> ```text { "data": [ { "type": "plugin", "id": "plugin_01Hq3vX8kZcN2mB7pR4tY9wL", "name": "sal… rate-limits-api Claude Developer Platform · in the page manage-claude/rate-limits-api …it| puts " #{limit.type}: #{limit.value}" end end ``` </CodeGroup> ## Organization rate limits The `/v1/organizations/rate_limits` endpoint returns the rate limits applied at the orga… spend-limits-api Claude Developer Platform · in the page manage-claude/spend-limits-api …ective_limit.period_to_date_spend} of #{amount}" end end ``` </CodeGroup> ## Key concepts ### The spend limit hierarchy An **effective spend limit** applies to each member's spend, resolved… user-management Claude Developer Platform · in the page manage-claude/user-management …ser| puts "#{user.id}: #{user.email} (#{user.role})" end ``` </CodeGroup> ```text wrap { "data": [ { "type": "user", "id": "user_01AbCdEfGhIjKlMnOpQrSt", "email": "jan… user-profiles Claude Developer Platform · in the page manage-claude/user-profiles …ence_id: "cust-8f2a1c", country: "US" } ) puts profile.id ``` </CodeGroup> The response is the new profile: ```text wrap { "type": "user_profile", "id": "uprof_011CZkZCu8hGbp5mYRQgUmz9",… user-profiles-verification-portal Claude Developer Platform · in the page manage-claude/user-profiles-verification-portal …action: { type: :enroll_end_user } ) puts action_url.url ``` </CodeGroup> The response contains the link and the time it stops working: ```text wrap { "type": "user_profile_action_url",… wif-admin-api Claude Developer Platform · in the page manage-claude/wif-admin-api …puts "#{service_account.id}: #{service_account.name}" end ``` </CodeGroup> Admin API keys are not accepted on these endpoints; the Admin API page's `x-api-key` examples do not apply here. ##… aws Claude Developer Platform · in the page manage-claude/wif-providers/aws …S"}] ) puts message.content.find { it.type == :text }.text ``` </CodeGroup> ### Verify the setup From inside the workload, exchange an STS-issued token directly and inspect the response: ```b… Create the app registration that represents the Claude API audience. Claude Developer Platform · in the page manage-claude/wif-providers/azure …e"}] ) puts message.content.find { it.type == :text }.text ``` </CodeGroup> ### Verify the setup From your Azure resource, run the cURL exchange shown in [Acquire and use the token](https://pl… gcp Claude Developer Platform · in the page manage-claude/wif-providers/gcp …n"}] ) puts message.content.find { it.type == :text }.text ``` </CodeGroup> Google identity tokens expire after roughly 1 hour. Except in Java (see the comment in that example), the SDK calls t… github-actions Claude Developer Platform · in the page manage-claude/wif-providers/github-actions …e"}] ) puts message.content.find { it.type == :text }.text ``` </CodeGroup> Each GitHub-issued identity token expires roughly 5 minutes after issuance. The token-request endpoint (`ACTIONS_ID_T… kubernetes Claude Developer Platform · in the page manage-claude/wif-providers/kubernetes …e"}] ) puts message.content.find { it.type == :text }.text ``` </CodeGroup> ## Verify the setup A successful exchange returns an `access_token` beginning with `sk-ant-oat01-` and an `expires_i… okta Claude Developer Platform · in the page manage-claude/wif-providers/okta …e"}] ) puts message.content.find { it.type == :text }.text ``` </CodeGroup> Except in Java (see the comment in that example), the SDK example passes your Okta token fetch to `identity_token_pro… Replace NODE_UID with the node's UID: Claude Developer Platform · in the page manage-claude/wif-providers/spiffe …puts message.content.find { it.type == :text }.text ``` </CodeGroup> </Tab> <Tab title="Token provider through the SPIFFE Workload API"> Except in Java, workloads that link a SPI… workload-identity-federation Claude Developer Platform · in the page manage-claude/workload-identity-federation …"}] ) puts message.content.find { it.type == :text }.text ``` </CodeGroup> The token-exchange response follows [RFC 6749 §5.1](https://www.rfc-editor.org/rfc/rfc6749#section-5.1). See [Token e… workspaces Claude Developer Platform · in the page manage-claude/workspaces …a member of your organization first signs in to [Claude Code](https://code.claude.com/docs/en/overview) with their Claude Console account, Anthropic automatically creates a **Claude Code** workspace… agent-setup Claude Developer Platform · in the page managed-agents/agent-setup …t `ant apply` updates this agent instead of creating a second one. </CodeGroupItem> ```python Python agent = client.beta.agents.create( name="Coding Assistant", model="claude-opus-5… budgets Claude Developer Platform · in the page managed-agents/budgets …n.id} #{session.budget.max_list_cost.amount}" # sesn_01... 125 ``` </CodeGroup> The `budget` (csharp, go: `Budget`) object has two fields: * `type` (csharp, go: `Type`) is always `"limit"`. * `max… DCF Model Rubric Claude Developer Platform · in the page managed-agents/define-outcomes ….new("/tmp/rubric.md")) puts "Uploaded rubric: #{rubric.id}" ``` </CodeGroup> ## Create a session with an outcome The following examples create a [session](https://platform.claude.com/docs/en/ma… dreams Claude Developer Platform · in the page managed-agents/dreams …nore one-off debugging notes." ) puts dream.id # drm_01... ``` </CodeGroup> Dreaming inputs include the pre-existing memory store and an array of sessions. The selected model runs the dreaming… environments Claude Developer Platform · in the page managed-agents/environments …updates this environment instead of attempting to create it again. </CodeGroupItem> ```python Python environment = client.beta.environments.create( name="python-dev", config={… event-deltas Claude Developer Platform · in the page managed-agents/event-deltas …latform.claude.com/docs/en/cli-sdks-libraries/overview) to run it. </CodeGroupItem> <CodeGroupItem language="CLI"> This workflow needs more logic than a single shell command. Use the [Claude… events-and-streaming Claude Developer Platform · in the page managed-agents/events-and-streaming …break else # ignore other event types end end ``` </CodeGroup> The session reports errors through the `session.error` event. See [Event types](https://platform.claude.com/docs/en/m… files Claude Developer Platform · in the page managed-agents/files ….upload(file: Pathname(csv_path)) puts "File ID: #{file.id}" ``` </CodeGroup> ## Mounting files in a session Mount uploaded files into the sandbox by adding them to the `resources` (csharp, go:… github Claude Developer Platform · in the page managed-agents/github …code review assistant with access to GitHub. ``` </File> </CodeGroupItem> ```python Python agent = client.beta.agents.create( name="Code Reviewer", model="claude-opus-5-5"… mcp-connector Claude Developer Platform · in the page managed-agents/mcp-connector …mcp_server_name: github --- ``` </File> </CodeGroupItem> ```python Python agent = client.beta.agents.create( name="GitHub Assistant", model="claude-opus-5… memory Claude Developer Platform · in the page managed-agents/memory …n: Per-user preferences and project context. ``` </File> </CodeGroupItem> ```python Python store = client.beta.memory_stores.create( name="User Preferences", description="… migration Claude Developer Platform · in the page managed-agents/migration …h-claude/working-with-messages) or from the [Claude Agent SDK](https://code.claude.com/docs/en/agent-sdk/overview). ## From a Messages API agent loop If you built an agent by calling `client.message…
Feedback