582 pages for environment.
Titles and paths first, then pages whose text carries it. Each row opens that page as this site last read it.
Give Claude custom tools
Claude Code CLI · in the page
agent-sdk/custom-tools
…v run weather.py > ``` > [tab] Python (pip) > > Activate the virtual environment where you installed the SDK, then run: > > ```bash theme={null} > python weather.py > ``` Claude calls `get_temperatu…
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
…| No | Yes | The working directory changes during a session | Reload environment variables per directory | | `FileChanged` | No | Yes | A watched file is modified, created, or deleted | Reload config…
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
…` option](https://code.claude.com/docs/en/agent-sdk/configuration#set-environment-variables), for example `CLAUDE_CODE_MCP_STARTUP_WAIT_MS: "5000"`. The first turn then waits up to that many milliseco…
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
…differs across users, machines, and checkouts. CLAUDE.md content and environment details such as the working directory, platform, shell, and OS version don't affect the system prompt cache, because C…
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` doesn't constrain this mode, and calls to tools you didn…
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-sd…
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
…`listSessions` and `deleteSession` take no `env` and read the process environment, set `CLAUDE_CONFIG_DIR` and the same name in the host process environment too. Requires Agent SDK v0.3.234 or later.…
Work with sessions
Claude Code CLI · in the page
agent-sdk/sessions
…e/projects/<encoded-cwd>/*.jsonl`. If you set the `CLAUDE_CONFIG_DIR` environment variable, look under `$CLAUDE_CONFIG_DIR/projects/` instead. > > To find your session's directory, replace every non-a…
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
…differently, so upgrade before you rely on them to bound a run. The [environment variable reference](https://code.claude.com/docs/en/env-vars.md) and [turns and budget](https://code.claude.com/docs/e…
Track todos
Claude Code CLI · in the page
agent-sdk/todo-tracking
…xamples on this page do. In TypeScript, `env` replaces the subprocess environment, so spread `...process.env` to keep inherited variables. In Python, `env` is merged on top of the inherited environmen…
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. Set `destructiveHint…
Orchestrate teams of Claude Code sessions
Claude Code CLI · in the page
agent-teams
…your [settings.json](https://code.claude.com/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
…IC_DEFAULT_HAIKU_MODEL`](https://code.claude.com/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](https://code.claude.com/docs/en/remote-control.m…
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…
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
…in a meeting * A deploy process that lives in one person's head * The environment variable your integration tests need There's also information that *is* in the repo but takes a few minutes of diggin…
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
…`CLAUDE_RUNNER_SPAWN_REASON` to the orchestrator's spawn-runner hook environment: why Anthropic sent the request (e.g. `runner_lost`, `resumed`); unset when none was sent * Self-hosted runner: Added…
Push events into a running session with channels
Claude Code CLI · in the page
channels
…s/telegram/.env`. You can also set `TELEGRAM_BOT_TOKEN` in your shell environment before launching Claude Code. > > **4. Restart with channels enabled** > > Exit Claude Code and restart with the chann…
Claude apps gateway for Amazon Bedrock, Claude Platform on AWS, Google Cloud, and Microsoft Foundry
Claude Code CLI · in the page
claude-apps-gateway
…080"] volumes: ["./gateway.yaml:/etc/claude/gateway.yaml:ro"] environment: OIDC_CLIENT_SECRET: ${OIDC_CLIENT_SECRET} GATEWAY_JWT_SECRET: ${GATEWAY_JWT_SECRET} GATEWAY_POSTGRE…
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](https://code.claude.com/docs/en/claude-apps-gatewa…
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](https://code.claude.com/docs/en/claude-apps-gatewa…
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](https://code.claude.com/docs/en/self-hosted-environments) when routed there. The session keeps running after you clos…
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…
CLI reference
Claude Code CLI · in the page
cli-reference
…process that registers this machine or container with a [self-hosted environment](https://code.claude.com/docs/en/self-hosted-environments) and hosts Claude Code cloud sessions on your infrastructure…
Commands
Claude Code CLI · in the page
commands
…ears for every user. Availability depends on your platform, plan, and environment. For example, `/desktop` only shows on macOS and x64 Windows when signed in with a Claude subscription, and `/upgrade`…
Communications kit
Claude Code CLI · in the page
communications-kit
…ce to land | | Install command tested on at least one machine in your environment | Catches proxy or firewall issues before everyone hits them at once | | Security and data-handling link ready ([Data…
Explore the context window
Claude Code CLI · in the page
context-window
…memory#auto-memory' }, { t: 0.06, kind: 'auto', label: 'Environment info', tokens: 280, color: '#6B6964', vis: 'hidden', desc: 'Working directory, platform, shell, OS ver…
Run Claude Code behind a corporate launcher
Claude Code CLI · in the page
corporate-launcher
…, and pass the rest to `exec` as it arrived. * **Pass every inherited environment variable through to `exec`.** Adding variables, such as injected credentials, is fine; dropping inherited ones is not.…
Manage costs effectively
Claude Code CLI · in the page
costs
…your [settings.json](https://code.claude.com/docs/en/settings.md) or environment to enable them. See [enable agent teams](https://code.claude.com/docs/en/agent-teams.md#enable-agent-teams). ## Reduc…
Message your other Claude Code sessions
Claude Code CLI · in the page
cross-session-messaging
…on a [self-hosted runner](https://code.claude.com/docs/en/self-hosted-environments). A session inside WSL 2 and a native Windows session on the same computer can't reach each other either. To require…
Data usage
Claude Code CLI · in the page
data-usage
…stead of locally. Sessions your organization routes to a [self-hosted environment](https://code.claude.com/docs/en/self-hosted-environments) run on infrastructure you control; for what stays on your m…
Debug your configuration
Claude Code CLI · in the page
debug-your-config
…t, then user. Some settings can also be set by command-line flags or [environment variables](https://code.claude.com/docs/en/env-vars.md), which act as another override layer. When a setting doesn't s…
Launch sessions from links
Claude Code CLI · in the page
deep-links
…de running and the prompt pre-filled. > [tab] Linux > > Most desktop environments provide `xdg-open`, which passes the URL to the registered handler: > > ```bash theme={null} > xdg-open "claude-cli:/…