441 pages for caching.
Titles and paths first, then pages whose text carries it. Each row opens that page as this site last read it.
Track cost and usage
Claude Code CLI · in the page
agent-sdk/cost-tracking
…Learn how to track token usage, estimate costs, and configure prompt caching with the Claude Agent SDK. The Claude Agent SDK provides detailed token usage information for each interaction with Claud…
Modifying system prompts
Claude Code CLI · in the page
agent-sdk/modifying-system-prompts
…print(message.content) asyncio.run(main()) ``` #### Improve prompt caching across users and machines By default, two sessions that use the same `claude_code` preset and `append` text still can't s…
Agent SDK reference - Python
Claude Code CLI · in the page
agent-sdk/python
…rompts](/docs/en/agent-sdk/modifying-system-prompts.md#improve-prompt-caching-across-users-and-machines) | | `snapshot` | No | Set to `False` to rebuild the system prompt on every request instead of […
Securely deploying AI agents
Claude Code CLI · in the page
agent-sdk/secure-deployment
…g and modifying HTTPS traffic * [Squid](http://www.squid-cache.org/): caching proxy with access control lists * [LiteLLM](https://github.com/BerriAI/litellm): LLM gateway with credential injection and…
Agent SDK reference - TypeScript
Claude Code CLI · in the page
agent-sdk/typescript
…erver-managed settings](/docs/en/server-managed-settings.md#fetch-and-caching-behavior). Pass them as `options.serverManagedSettings` to include them. * **`defaultMode`**: the snapshot returns `permis…
Orchestrate teams of Claude Code sessions
Claude Code CLI · in the page
agent-teams
…ll outside the main conversation's [cache TTL bucket](/docs/en/prompt-caching.md#which-ttl-each-request-gets), so its cache holds for five minutes by default, including on a Claude subscription. To ke…
Claude Code on Amazon Bedrock
Claude Code CLI · in the page
amazon-bedrock
…erate-ai-development-with-amazon-bedrock-api-keys/). #### Credential caching and resolution timeout Claude Code resolves the AWS default credential provider chain once and keeps the resolved credent…
Claude Code changelog
Claude Code CLI · in the page
changelog
…alias with the `[1m]` suffix, such as `opus[1m]` * Fixed the `prompt-caching-scope` beta header being sent behind custom `ANTHROPIC_BASE_URL` gateways and on Foundry, where it has no effect * Fixed M…
Claude apps gateway for Amazon Bedrock, Claude Platform on AWS, Google Cloud, and Microsoft Foundry
Claude Code CLI · in the page
claude-apps-gateway
…nly at the next launch](/docs/en/server-managed-settings.md#fetch-and-caching-behavior). * **Startup with the gateway unreachable**: signed-in sessions exit at startup with an error after about 10 sec…
Claude apps gateway configuration
Claude Code CLI · in the page
claude-apps-gateway-config
…se. They are served per-user at `GET /managed/settings` with ETag/304 caching. ```yaml theme={null} managed: policies: # Specific groups first. - match: { groups: [eng-contractors] }…
Explore the .claude directory
Claude Code CLI · in the page
claude-directory
…from its source directory rather than from a cache copy. See [plugin caching](/docs/en/plugins/loading#find-plugins-on-disk) for how orphaned versions are cleaned up. | `~/.claude` also holds data C…
Claude Code on Claude Platform on AWS
Claude Code CLI · in the page
claude-platform-on-aws
…iables, see [Model configuration](/docs/en/model-config.md). [Prompt caching](/docs/en/prompt-caching.md) is enabled automatically. To request a 1-hour cache TTL instead of the 5-minute default, set…
Let Claude coordinate ongoing work with Projects
Claude Code CLI · in the page
claude-projects
…s p95 latency for the payments API under 200 ms: profiling, query and caching fixes, and the dependency upgrades that come with them, in the payments-api repository. - Branch from main and open one d…
Configure cloud environments
Claude Code CLI · in the page
cloud-environments
…access levels, environment variables, setup scripts, and environment caching. > [!NOTE] > > Cloud environments apply to [cloud sessions](/docs/en/claude-code-on-the-web.md), which are available on P…
Commands
Claude Code CLI · in the page
commands
…Claude API spend goes and propose savings from options such as prompt caching, trimming unneeded input and output tokens, batch processing, effort, and model choice, one change at a time. Run `build-e…
Explore the context window
Claude Code CLI · in the page
context-window
…est-practices): managing context as your primary constraint * [Prompt caching](/docs/en/prompt-caching): which actions invalidate the cached prefix * [Reduce token usage](/docs/en/costs#reduce-token-u…
Manage costs effectively
Claude Code CLI · in the page
costs
…ssion block, summarizing the session's [prompt cache](/docs/en/prompt-caching.md) use: the request count, the share of input tokens served from cache, cache misses, and whether the cache is warm right…
Data usage
Claude Code CLI · in the page
data-usage
…ation basis by your account team after confirming eligibility * Local caching: Claude Code clients store session transcripts locally in plaintext under `~/.claude/projects/` for 30 days by default to…
Environment variables
Claude Code CLI · in the page
env-vars
…ersion and a prompt fingerprint, from the start of the system prompt. Caching on a direct connection to the Anthropic API is unaffected either way. In some direct-connection setups, Claude Code keeps…
Error reference
Claude Code CLI · in the page
errors
…nversation with no cache hits; see [Switching models](/docs/en/prompt-caching.md#switching-models) * Run `/usage` to see your plan limits and when they reset * Run `/usage-credits` to buy additional u…
Speed up responses with fast mode
Claude Code CLI · in the page
fast-mode
…, see [how fast mode interacts with the prompt cache](/docs/en/prompt-caching.md#turning-on-fast-mode). ### See where fast mode spend appears You see fast mode spend in a different place depending o…
Feature availability
Claude Code CLI · in the page
feature-availability
…de features and work on every provider that offers the model. [Prompt caching](/docs/en/prompt-caching.md) works the same way on most providers; on Amazon Bedrock, support varies by model. ## Related…
Claude Code GitLab CI/CD
Claude Code CLI · in the page
gitlab-ci-cd
…his API call ``` Claude proposes changes, adds code with appropriate caching, and updates the MR. ### Fix bugs quickly In an issue or MR comment: ```text wrap theme={null} @claude fix the TypeErro…
Glossary
Claude Code CLI · in the page
glossary
…ystem prompt is the first layer of the [prompt cache](/docs/en/prompt-caching.md#how-the-cache-is-organized). Your [CLAUDE.md](#claude-md) files and the instructions of your [output style](#output-st…
Claude Code on Google Cloud's Agent Platform
Claude Code CLI · in the page
google-vertex-ai
…. * `CLOUD_ML_REGION`: Claude Code falls back to `us-east5`. [Prompt caching](/docs/en/prompt-caching.md) is enabled automatically. To disable it, set `DISABLE_PROMPT_CACHING=1`. To request a 1-hour…
Hooks reference
Claude Code CLI · in the page
hooks
…e is older than the session's [prompt cache lifetime](/docs/en/prompt-caching.md#cache-lifetime) or a later compaction replaced the cached conversation | | `estimated_cache_write_usd` | Estimated cost…
Interactive mode
Claude Code CLI · in the page
interactive-mode
…ing-your-model): once you confirm the [cache warning](/docs/en/prompt-caching.md#switching-models), if Claude Code shows one, Claude Code applies your change to the next request it makes in that turn…
Claude Code gateway compatibility guide
Claude Code CLI · in the page
llm-gateway-protocol
…k](#system-prompt-attribution-block) and how it interacts with prompt caching * [Feature pass-through](#feature-pass-through): what breaks when headers or body fields are stripped * [Model discovery](…
Control MCP server access for your organization
Claude Code CLI · in the page
managed-mcp
…rrives through server-managed settings, its timing follows [Fetch and caching behavior](/docs/en/server-managed-settings.md#fetch-and-caching-behavior): * On a machine with cached settings, Claude Co…
Deploy managed settings
Claude Code CLI · in the page
managed-settings
…it for the next launch](/docs/en/server-managed-settings.md#fetch-and-caching-behavior), a server-managed change to a setting that [needs approval](/docs/en/server-managed-settings.md#security-approva…
Claude Code on Microsoft Foundry
Claude Code CLI · in the page
microsoft-foundry
…rty-deployments) for the full list of environment variables. [Prompt caching](/docs/en/prompt-caching.md) is enabled automatically. To request a 1-hour cache TTL instead of the 5-minute default, set…
Model configuration
Claude Code CLI · in the page
model-config
…See [when Claude Code asks you to confirm the switch](/docs/en/prompt-caching.md#switching-models) 2. **At startup**: launch with `claude --model <alias|name>` 3. **Environment variable**: set `ANTHRO…
Monitoring
Claude Code CLI · in the page
monitoring-usage
…s with the five-minute and one-hour [cache lifetimes](/docs/en/prompt-caching.md#cache-lifetime) together. * `model`: Model identifier (for example, "claude-sonnet-5") * `query_source`: Category of th…
Output styles
Claude Code CLI · in the page
output-styles
…g with your next message. For what that first message costs in prompt caching, see [Changing output style](/docs/en/prompt-caching.md#changing-output-style). Before v2.1.251, the new style applied onl…
Configure permissions
Claude Code CLI · in the page
permissions
…from its next tool call on; [Denying an entire tool](/docs/en/prompt-caching.md#denying-an-entire-tool) covers what happens to a definition Claude has already seen. A scoped rule like `Bash(rm *)` le…
Plugin commands reference
Claude Code CLI · in the page
plugins/cli-reference
…, and that change would invalidate the [prompt cache](/docs/en/prompt-caching.md#enabling-or-disabling-a-plugin), Claude Code doesn't apply the reload. It prints a line such as `This reload changes MC…
Create a Claude Code plugin
Claude Code CLI · in the page
plugins/create
…mid-conversation would [invalidate the prompt cache](/docs/en/prompt-caching.md#enabling-or-disabling-a-plugin), the change is held instead, and the message tells you to run `/reload-plugins` to appl…
Install and manage plugins
Claude Code CLI · in the page
plugins/install
…ou. If the reload would [invalidate the prompt cache](/docs/en/prompt-caching.md#enabling-or-disabling-a-plugin), it warns and leaves the plugin pending instead. Run `/reload-plugins --force` to activ…
Plugin loading reference
Claude Code CLI · in the page
plugins/loading
…the cache cost and applies when rerun with `--force`](/docs/en/prompt-caching#enabling-or-disabling-a-plugin). ## Name conflicts When enabled plugins from different origins share a manifest name, th…
Use the mods API
Claude Code CLI · in the page
plugins/mods/api
…Claude API serves most of it from the [prompt cache](/docs/en/prompt-caching.md) while the conversation is still cached. Both calls use the session's credentials, so they bill to the user's plan, AP…
React to events with a mod
Claude Code CLI · in the page
plugins/mods/events
…anges between requests [invalidates the prompt cache](/docs/en/prompt-caching.md). In a `skill.prompt` hook, you can also read [which plugin or file the skill came from](/docs/en/plugins/mods/referenc…
Troubleshoot plugins
Claude Code CLI · in the page
plugins/troubleshooting
…use activating it would [invalidate the prompt cache](/docs/en/prompt-caching.md#enabling-or-disabling-a-plugin) or because the activation attempt failed. You don't need to type the command. The pane…
Automate work with scheduled tasks
Claude Code CLI · in the page
routines
…ds. The result is [cached](/docs/en/cloud-environments.md#environment-caching), so the script doesn't re-run on every session A **Default** environment is provided with **Trusted** network access, wh…
Run prompts on a schedule
Claude Code CLI · in the page
scheduled-tasks
…st one would start after a five-minute [prompt cache](/docs/en/prompt-caching.md#which-ttl-each-request-gets) had expired, so each run starts 15 seconds sooner. Find your schedule in the first column…
Verify session identity in self-hosted environments
Claude Code CLI · in the page
self-hosted-environments-identity
…ingle key. The endpoint sets `Cache-Control: public, max-age=300`, so caching the key set and refetching every five minutes is safe. Verify each incoming token against these checks: **1. Check the p…
Configure server-managed settings
Claude Code CLI · in the page
server-managed-settings
…plist or registry policy, be aware that [cached settings](#fetch-and-caching-behavior) persist on client machines until the next successful fetch, and the keys that [apply only at the next launch](#f…
Manage sessions
Claude Code CLI · in the page
sessions
…n you resume a long conversation [after a long break](/docs/en/prompt-caching.md#resuming-a-session) or on a different model. The estimated use comes when you send your first message after **Resume**,…
All settings
Claude Code CLI · in the page
settings-reference
…#promptcachettl) | Choose the [prompt cache lifetime](/docs/en/prompt-caching.md#cache-lifetime) for the main conversation | Model and responses | Any file | | [`promptSuggestionEnabled`](#promptsugge…
Extend Claude with skills
Claude Code CLI · in the page
skills
…Claude API spend goes and propose savings from options such as prompt caching, trimming unneeded input and output tokens, batch processing, effort, and model choice, one change at a time | v2.1.247 or…
Customize your status line
Claude Code CLI · in the page
statusline
…way | | `prompt_cache` | The session's [prompt cache](/docs/en/prompt-caching.md) statistics for the main conversation: hit ratio, misses, and whether the cache is warm. See [prompt cache fields](#pro…