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

679 pages for env.

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

Escalate hard decisions with the advisor tool Claude Code CLI · in the page advisor …or stays off. See [Features that need feature-flag fetching](/docs/en/env-vars.md#features-that-need-feature-flag-fetching). ## Turn the advisor off To stop using the advisor, run `/advisor off` or… How the agent loop works Claude Code CLI · in the page agent-sdk/agent-loop …ns`. Can't be used when running as root on Unix. Use only in isolated environments where the agent's actions can't affect systems you care about | CI, containers, or other isolated environments | For… Use Claude Code features in the SDK Claude Code CLI · in the page agent-sdk/claude-code-features …` global config | Always read | Relocate with `CLAUDE_CONFIG_DIR` in `env` | | Auto memory at `~/.claude/projects/<project>/memory/` | Loaded into the system prompt at session start. The agent writes… Configure your agent Claude Code CLI · in the page agent-sdk/configuration …figure Agent SDK sessions: compose the options object, set the model, environment, and limits, and find each feature option's page. An Agent SDK session reads configuration from settings files, envir… Track cost and usage Claude Code CLI · in the page agent-sdk/cost-tracking …ur TTL on cache writes, set the [`ENABLE_PROMPT_CACHING_1H`](/docs/en/env-vars) environment variable. You can export it in your shell or container environment, or pass it through `options.env`. The f… Give Claude custom tools Claude Code CLI · in the page agent-sdk/custom-tools …={null} uv run weather.py ``` **Python (pip)** Activate the virtual environment where you installed the SDK, then run: ```bash theme={null} python weather.py ``` Claude calls `get_temperature` and… Rewind file changes with checkpointing Claude Code CLI · in the page agent-sdk/file-checkpointing …directly you must set the `CLAUDE_CODE_ENABLE_SDK_FILE_CHECKPOINTING` environment variable: ```bash theme={null} CLAUDE_CODE_ENABLE_SDK_FILE_CHECKPOINTING=true claude -p --resume <session-id> --rewin… Intercept and control agent behavior with hooks Claude Code CLI · in the page agent-sdk/hooks …ceives the tool's input (step 4), checks if the file path targets a `.env` file, and returns `permissionDecision: "deny"` to block the operation (step 5): ```python Python theme={null} import asyncio… Hosting the Agent SDK Claude Code CLI · in the page agent-sdk/hosting …runs a one-shot entrypoint that reads the task from the `TASK_PROMPT` environment variable, calls the SDK, and exits. ```typescript TypeScript theme={null} import { query } from "@anthropic-ai/claude… Connect to external tools with MCP Claude Code CLI · in the page agent-sdk/mcp …cached tool list | Yes, until it connects | [`MCP_TIMEOUT`](/docs/en/env-vars), 30 seconds by default; the connection fails at that deadline | | Remote server with a cached tool list, saved by Claude… Migrate to Claude Agent SDK Claude Code CLI · in the page agent-sdk/migration-guide …especially important for CI/CD pipelines, deployed applications, test environments, and multi-tenant systems where local customizations should not leak in. > [!NOTE] > > Python SDK 0.1.59 and earlier… Modifying system prompts Claude Code CLI · in the page agent-sdk/modifying-system-prompts …rter system prompt; set [`CLAUDE_CODE_SIMPLE_SYSTEM_PROMPT`](/docs/en/env-vars#variables) to `0` to select the full prompt on any model. Keep them when your agent is still doing software engineering w… Observability with OpenTelemetry Claude Code CLI · in the page agent-sdk/observability …e CLI exports directly to your collector. Configuration is passed as environment variables. By default, the child process inherits your application's environment, so you can configure telemetry in ei… Configure permissions Claude Code CLI · in the page agent-sdk/permissions …n. Claude has full system access in this mode. Only use in controlled environments where you trust all possible operations. > > `allowed_tools` does not constrain this mode. Every tool is approved, no… Plugins in the SDK Claude Code CLI · in the page agent-sdk/plugins …).catch(console.error); ``` ```python Python theme={null} #!/usr/bin/env python3 """Example demonstrating how to use plugins with the Agent SDK.""" import asyncio from pathlib import Path from clau… Agent SDK reference - Python Claude Code CLI · in the page agent-sdk/python …es, and classes. ## Installation Install the package into a virtual environment. On recent Debian, Ubuntu, and Homebrew Python installs, running `pip install` against system Python fails with `error… Quickstart Claude Code CLI · in the page agent-sdk/quickstart …cs.astral.sh/uv/), a fast Python package manager that handles virtual environments automatically. Then initialize a project and add the SDK: ```bash theme={null} uv init uv add claude-agent-sdk ```… Securely deploying AI agents Claude Code CLI · in the page agent-sdk/secure-deployment …equirements than a company processing customer data in a multi-tenant environment. This guide presents options ranging from Claude Code's built-in security features to hardened production architecture… Persist sessions to external storage Claude Code CLI · in the page agent-sdk/session-storage …project-directory-yourself) beside `CLAUDE_CONFIG_DIR` in a query's [`env` option](/docs/en/agent-sdk/typescript#options), the SDK keys that query's entries, and its `resume` and `continue` lookups, b… Work with sessions Claude Code CLI · in the page agent-sdk/sessions …the call. In Python, set [`CLAUDE_CODE_SKIP_PROMPT_HISTORY`](/docs/en/env-vars) in the `env` option to suppress transcript writes instead. | ### Continue, resume, and fork Continue, resume, and fork… Extend agents with skills Claude Code CLI · in the page agent-sdk/skills …he session, such as `/theme`, returns `/theme isn't available in this environment.` as the result without a model turn. > [!NOTE] > > A command can hit the `maxTurns` / `max_turns` limit like any oth… Streaming Input Claude Code CLI · in the page agent-sdk/streaming-vs-single-mode …s or mid-session control methods * You need to operate in a stateless environment, such as a lambda function ### Limitations > [!WARNING] > > Single message input mode does **not** support: > > * Di… Subagents in the SDK Claude Code CLI · in the page agent-sdk/subagents …r own. Setting [`CLAUDE_AGENT_SDK_DISABLE_BUILTIN_AGENTS=1`](/docs/en/env-vars) removes that default, and such a call fails with [`subagent_type is required`](/docs/en/errors#subagent-type-is-required… Track todos Claude Code CLI · in the page agent-sdk/todo-tracking …uilt-in tools you use * Set `CLAUDE_CODE_ENABLE_TODO_TOOLS=1` in the `env` option, as the examples on this page do. In TypeScript, `env` replaces the subprocess environment, so spread `...process.env`… Scale to many tools with tool search Claude Code CLI · in the page agent-sdk/tool-search …and when tool definitions are deferred with the `ENABLE_TOOL_SEARCH` environment variable, which takes these values: | Value | Behavior | | :- | :- | | (unset) | Tool search is on, with tool definit… Troubleshoot the Agent SDK Claude Code CLI · in the page agent-sdk/troubleshooting …ly on `PATH` resolution, confirm `claude --version` works in the same environment your application runs in. Processes you launch outside your shell, such as from an IDE or a service manager, often run… Agent SDK reference - TypeScript Claude Code CLI · in the page agent-sdk/typescript …Hint` | `boolean` | `false` | If `true`, the tool does not modify its environment | | `destructiveHint` | `boolean` | `true` | If `true`, the tool may perform destructive updates (only meaningful when… Orchestrate teams of Claude Code sessions Claude Code CLI · in the page agent-teams …ENTAL_AGENT_TEAMS=1` in your [settings.json](/docs/en/settings.md) or environment. Without that variable, no team is set up at session start, no team directories are written, and Claude does not spawn… Manage multiple agents with agent view Claude Code CLI · in the page agent-view …instead; set [`ANTHROPIC_DEFAULT_HAIKU_MODEL`](/docs/en/model-config#environment-variables) to choose one. ### Pull request status When a session [opens a pull request](#how-file-edits-are-isolated… Claude Code on Amazon Bedrock Claude Code CLI · in the page amazon-bedrock …ock API key, an access key and secret, or credentials already in your environment. The wizard asks for your region, verifies which Claude models your account can invoke, and lets you pin them. It save… Share session output as artifacts Claude Code CLI · in the page artifacts …rowser from opening**: set `CLAUDE_CODE_ARTIFACT_AUTO_OPEN=0` in your environment * **Remote Control**: if you sent the prompt through [Remote Control](/docs/en/remote-control.md) from claude.ai, Clau… Authentication Claude Code CLI · in the page authentication …the login prompt: * **API key**: you've set the `ANTHROPIC_API_KEY` environment variable and you approve the key when Claude Code asks whether to use it * **Earlier sign-in**: you ran [`claude auth… Auto mode classifier request charges Claude Code CLI · in the page auto-mode-classifier-billing …ERVER` to `0` before you start the session, in your shell or in the [`env` settings key](/docs/en/settings-reference#env): ```bash theme={null} export CLAUDE_CODE_AUTO_MODE_SERVER=0 ``` Classifier r… Configure auto mode Claude Code CLI · in the page auto-mode-config …ifier which repos, buckets, and domains your organization trusts. Set environment context, override the default block and allow rules, and inspect your effective config with the auto-mode CLI subcomma… Best practices for Claude Code Claude Code CLI · in the page best-practices …tterns for getting the most out of Claude Code, from configuring your environment to scaling across parallel sessions. Claude Code is an agentic coding environment. Unlike a chatbot that answers ques… Champion kit Claude Code CLI · in the page champion-kit …at is possible; your posts show them what is actually working in your environment. ### What is worth sharing The most useful posts describe a technique a colleague can reuse tomorrow rather than an… Claude Code changelog Claude Code CLI · in the page changelog …ble while they were still loading * \[Cloud sessions] Fixed the cloud environment editor shuffling environment variables and adding backslashes to values that contain both kinds of quote * \[Cloud ses… Push events into a running session with channels Claude Code CLI · in the page channels …configure <token> ``` This saves it to `~/.claude/channels/telegram/.env`. You can also set `TELEGRAM_BOT_TOKEN` in your shell environment before launching Claude Code. **4. Restart with channels en… Channels reference Claude Code CLI · in the page channels-reference …as a channel event. ```ts title="webhook.ts" theme={null} #!/usr/bin/env bun import { Server } from '@modelcontextprotocol/sdk/server/index.js' import { StdioServerTransport } from '@modelcontextprot… Use Claude Code with Chrome Claude Code CLI · in the page chrome …cks-with-bypasspermissions-mode) and [feature-flag fetching](/docs/en/env-vars.md#features-that-need-feature-flag-fetching) is off, these calls run without a prompt. A `tabs_context_mcp` call also pr… Claude apps gateway for Amazon Bedrock, Claude Platform on AWS, Google Cloud, and Microsoft Foundry Claude Code CLI · in the page claude-apps-gateway …ay-config#store). **3. Write gateway.yaml** Secrets are read via `${ENV_VAR}` expansion so the file itself can live in version control. Use a `public_url` hostname that resolves to a private IP on y… Claude apps gateway configuration Claude Code CLI · in the page claude-apps-gateway-config …f the forms below, and the gateway resolves the value at boot from an environment variable or a file: | Form | Resolves to | Use for | | - | - | - | | `${VAR}` | The environment variable `VAR`. Boot… Claude apps gateway deployment and operations Claude Code CLI · in the page claude-apps-gateway-deploy …, so deploy it the way you deploy any other stateless service in your environment. Keep it inside your network, where your developers can reach it over HTTPS and it can reach your IdP, and treat it li… Deploy Claude apps gateway on AWS Claude Code CLI · in the page claude-apps-gateway-on-aws …it to see how the pieces fit together before adapting it to your own environment. For the platform-agnostic requirements, see the [deployment guide](/docs/en/claude-apps-gateway-deploy.md). This exa… Deploy Claude apps gateway on Google Cloud Claude Code CLI · in the page claude-apps-gateway-on-gcp …it to see how the pieces fit together before adapting it to your own environment. For the platform-agnostic requirements, see the [deployment guide](/docs/en/claude-apps-gateway-deploy.md). This exa… Claude apps gateway spend limits Claude Code CLI · in the page claude-apps-gateway-spend-limits …00` * The `{type: "error", error: {type, message}, request_id}` error envelope * A `request-id` response header on every admin response, success or error; error bodies also carry it as `request_id` E… Use Claude Code in the cloud Claude Code CLI · in the page claude-code-on-the-web …rastructure Anthropic manages, or on your organization's [self-hosted environment](/docs/en/self-hosted-environments) when routed there. The session keeps running after you close your laptop, and you… Explore the .claude directory Claude Code CLI · in the page claude-directory …ourself go in <C>~/.claude.json</C> instead.</>, tips: [<>Use environment variable references for secrets: <C>{'${NOTION_TOKEN}'}</C></>, <>Lives at the project root, not inside <C>.claude/</C… Claude Code on Claude Platform on AWS Claude Code CLI · in the page claude-platform-on-aws …vice, or an API key scoped to the workspace * AWS credentials in your environment, in `~/.aws/credentials`, or from an attached IAM role if you want SigV4 authentication. The AWS CLI is required only… Let Claude coordinate ongoing work with Projects Claude Code CLI · in the page claude-projects …ectors-and-tools-into-threads) on your claude.ai account * A [cloud environment](#choose-an-environment-for-threads) that sets its network access, environment variables, network secrets, and install…
Feedback