Team Ai
Datasetpublic

ratanon/claude-code

claude-code Dataset Description This dataset contains crawled documentation formatted for LLM training and RAG systems. Dataset Statistics Total Pages: 29 Total Words: 27764 Total Chunks: 29 Source URL: https://docs.anthropic.com/en/docs/claude-code/ Crawled Date: 2025-06-24T09:05:29.246208 Directory Structure llm_ready/ - Plain text files optimized for LLM training jsonl/ - JSONL format for fine-tuning chunks/ - Chunked content… See the full description on the dataset page: https://huggingface.co/datasets/ratanon/claude-code.

sourceHugging Faceupdated 1y agoView on Hugging Face
1likes2.9kdownloads
chunks_index.json226 linesDownload Raw Back to root
1[2  {3    "chunk_id": 1,4    "text": "Anthropic home page English Search... Search... Navigation Deployment Claude Code on Amazon Bedrock Welcome Developer Guide API Guide Claude Code Model Context Protocol (MCP) Resources Release Notes Documentation Developer Discord Support Getting started Overview Set up Quickstart Memory management Common workflows Build with Claude Add Claude Code to your IDE Model Context Protocol (MCP) GitHub Actions Claude Code SDK Troubleshooting Deployment Overview Amazon Bedrock Google Vertex AI Corporate proxy LLM gateway Development containers Administration Identity and Access Management Security Monitoring Costs Reference CLI reference Interactive mode Slash commands Settings Resources Data usage Legal and compliance  Prerequisites Before configuring Claude Code with Bedrock, ensure you have: An AWS account with Bedrock access enabled Access to desired Claude models (e.g., Claude Sonnet 4) in Bedrock AWS CLI installed and configured (optional - only needed if you dont have another mechanism for getting credentials) Appropriate IAM permissions  Setup  1. Enable model access First, ensure you have access to the required Claude models in your AWS account: Navigate to the Amazon Bedrock console Go to Model access in the left navigation Request access to desired Claude models (e.g., Claude Sonnet 4) Wait for approval (usually instant for most regions)  2. Configure AWS credentials Claude Code uses the default AWS SDK credential chain. Set up your credentials using one of these methods: Claude Code does not currently support dynamic credential management (such as automatically calling aws sts assume-role ). You will need to run aws configure , aws sso login , or set the AWS_ environment variables yourself. Option A: AWS CLI configuration aws configure Option B: Environment variables (access key) export AWS_ACCESS_KEY_ID = your-access-key-id export AWS_SECRET_ACCESS_KEY = your-secret-access-key export AWS_SESSION_TOKEN = your-session-token Option C: Environment variables (SSO profile) aws sso login --profile = < your-profile-name > export AWS_PROFILE = your-profile-name  3. Configure Claude Code Set the following environment variables to enable Bedrock: export CLAUDE_CODE_USE_BEDROCK = 1 export AWS_REGION = us-east-1 AWS_REGION is a required environment variable. Claude Code does not read from the .aws config file for this setting.  4. Model configuration Claude Code uses these default models for Bedrock: Model type Default value Primary model us.anthropic.claude-3-7-sonnet-20250219-v1:0 Small/fast model us.anthropic.claude-3-5-haiku-20241022-v1:0 To customize models, use one of these methods: export ANTHROPIC_MODEL = 'us.anthropic.claude-opus-4-20250514-v1:0' export ANTHROPIC_SMALL_FAST_MODEL = 'us.anthropic.claude-3-5-haiku-20241022-v1:0' export ANTHROPIC_MODEL = 'arn:aws:bedrock:us-east-2:your-account-id:application-inference-profile/your-model-id'  IAM configuration Create an IAM policy with the required permissions for Claude Code. For details, see Bedrock IAM documentation . We recommend creating a dedicated AWS account for Claude Code to simplify cost tracking and access control.  Troubleshooting If you encounter region issues: Check model availability: aws bedrock list-inference-profiles --region your-region Switch to a supported region: export AWS_REGION=us-east-1 Consider using inference profiles for cross-region access If you receive an error on-demand throughput isnt supported: Specify the model as an inference profile ID  Additional resources Bedrock documentation Bedrock pricing Bedrock inference profiles Claude Code on Amazon Bedrock: Quick Setup Guide Was this page helpful? Yes No Overview Google Vertex AI On this page Prerequisites Setup 1. Enable model access 2. Configure AWS credentials 3. Configure Claude Code 4. Model configuration IAM configuration Troubleshooting Additional resources",5    "title": "Claude Code on Amazon Bedrock - Anthropic",6    "url": "https://docs.anthropic.com/en/docs/claude-code/amazon-bedrock",7    "word_count": 510,8    "char_count": 38649  },10  {11    "chunk_id": 1,12    "text": "Anthropic home page English Search... Search... Navigation Resources Legal and compliance Welcome Developer Guide API Guide Claude Code Model Context Protocol (MCP) Resources Release Notes Documentation Developer Discord Support Getting started Overview Set up Quickstart Memory management Common workflows Build with Claude Add Claude Code to your IDE Model Context Protocol (MCP) GitHub Actions Claude Code SDK Troubleshooting Deployment Overview Amazon Bedrock Google Vertex AI Corporate proxy LLM gateway Development containers Administration Identity and Access Management Security Monitoring Costs Reference CLI reference Interactive mode Slash commands Settings Resources Data usage Legal and compliance  Legal agreements  License Claude Code is provided under Anthropics Commercial Terms of Service .  Commercial agreements Whether youre using Anthropics API directly (1P) or accessing it through AWS Bedrock or Google Vertex (3P), your existing commercial agreement will apply to Claude Code usage, unless weve mutually agreed otherwise.  Compliance  Healthcare compliance (BAA) If a customer has a Business Associate Agreement (BAA) with us, and wants to use Claude Code, the BAA will automatically extend to cover Claude Code if the customer has executed a BAA and has Zero Data Retention (ZDR) activated. The BAA will be applicable to that customers API traffic flowing through Claude Code.  Security and trust  Trust and safety You can find more information in the Anthropic Trust Center and Transparency Hub .  Security vulnerability reporting Anthropic manages our security program through HackerOne. Use this form to report vulnerabilities .  Anthropic PBC. All rights reserved. Use is subject to Anthropics Commercial Terms of Service . Was this page helpful? Yes No Data usage On this page Legal agreements License Commercial agreements Compliance Healthcare compliance (BAA) Security and trust Trust and safety Security vulnerability reporting",13    "title": "Legal and compliance - Anthropic",14    "url": "https://docs.anthropic.com/en/docs/claude-code/legal-and-compliance",15    "word_count": 280,16    "char_count": 196217  },18  {19    "chunk_id": 1,20    "text": "Anthropic home page English Search... Search... Navigation Getting started Common workflows Welcome Developer Guide API Guide Claude Code Model Context Protocol (MCP) Resources Release Notes Documentation Developer Discord Support Getting started Overview Set up Quickstart Memory management Common workflows Build with Claude Add Claude Code to your IDE Model Context Protocol (MCP) GitHub Actions Claude Code SDK Troubleshooting Deployment Overview Amazon Bedrock Google Vertex AI Corporate proxy LLM gateway Development containers Administration Identity and Access Management Security Monitoring Costs Reference CLI reference Interactive mode Slash commands Settings Resources Data usage Legal and compliance Each task in this document includes clear instructions, example commands, and best practices to help you get the most from Claude Code.  Understand new codebases  Get a quick codebase overview Suppose youve just joined a new project and need to understand its structure quickly. 1 Navigate to the project root directory cd /path/to/project 2 Start Claude Code claude 3 Ask for a high-level overview > give me an overview of this codebase 4 Dive deeper into specific components > explain the main architecture patterns used here > what are the key data models? > how is authentication handled? Tips: Start with broad questions, then narrow down to specific areas Ask about coding conventions and patterns used in the project Request a glossary of project-specific terms  Find relevant code Suppose you need to locate code related to a specific feature or functionality. 1 Ask Claude to find relevant files > find the files that handle user authentication 2 Get context on how components interact > how do these authentication files work together? 3 Understand the execution flow > trace the login process from front-end to database Tips: Be specific about what youre looking for Use domain language from the project  Fix bugs efficiently Suppose youve encountered an error message and need to find and fix its source. 1 Share the error with Claude > I'm seeing an error when I run npm test 2 Ask for fix recommendations > suggest a few ways to fix the @ts-ignore in user.ts 3 Apply the fix > update user.ts to add the null check you suggested Tips: Tell Claude the command to reproduce the issue and get a stack trace Mention any steps to reproduce the error Let Claude know if the error is intermittent or consistent  Refactor code Suppose you need to update old code to use modern patterns and practices. 1 Identify legacy code for refactoring > find deprecated API usage in our codebase 2 Get refactoring recommendations > suggest how to refactor utils.js to use modern JavaScript features 3 Apply the changes safely > refactor utils.js to use ES2024 features while maintaining the same behavior 4 Verify the refactoring > run tests for the refactored code Tips: Ask Claude to explain the benefits of the modern approach Request that changes maintain backward compatibility when needed Do refactoring in small, testable increments  Work with tests Suppose you need to add tests for uncovered code. 1 Identify untested code > find functions in NotificationsService.swift that are not covered by tests 2 Generate test scaffolding > add tests for the notification service 3 Add meaningful test cases > add test cases for edge conditions in the notification service 4 Run and verify tests > run the new tests and fix any failures Tips: Ask for tests that cover edge cases and error conditions Request both unit and integration tests when appropriate Have Claude explain the testing strategy  Create pull requests Suppose you need to create a well-documented pull request for your changes. 1 Summarize your changes > summarize the changes I've made to the authentication module 2 Generate a PR with Claude > create a pr 3 Review and refine > enhance the PR description with more context about the security improvements 4 Add testing details > add information about how these changes were tested Tips: Ask Claude directly to make a PR for you Review Claudes generated PR before submitting Ask Claude to highlight potential risks or considerations  Handle documentation Suppose you need to add or update documentation for your code. 1 Identify undocumented code > find functions without proper JSDoc comments in the auth module 2 Generate documentation > add JSDoc comments to the undocumented functions in auth.js 3 Review and enhance > improve the generated documentation with more context and examples 4 Verify documentation > check if the documentation follows our project standards Tips: Specify the documentation style you want (JSDoc, docstrings, etc.) Ask for examples in the documentation Request documentation for public APIs, interfaces, and complex logic  Work with images Suppose you need to work with images in your codebase, and you want Claudes help analyzing image content. 1 Add an image to the conversation You can use any of these methods: Drag and drop an image into the Claude Code window Copy an image and paste it into the CLI with ctrl+v (Do not use cmd+v) Provide an image path to Claude. E.g., Analyze this image: /path/to/your/image.png 2 Ask Claude to analyze the image > What does this image show? > Describe the UI elements in this screenshot > Are there any problematic elements in this diagram? 3 Use images for context > Here's a screenshot of the error. What's causing it? > This is our current database schema. How should we modify it for the new feature? 4 Get code suggestions from visual content > Generate CSS to match this design mockup > What HTML structure would recreate this component? Tips: Use images when text descriptions would be unclear or cumbersome Include screenshots of errors, UI designs, or diagrams for better context You can work with multiple images in a conversation Image analysis works with diagrams, screenshots, mockups, and more  Reference files and directories Use @ to quickly include files or directories without waiting for Claude to read them. 1 Reference a single file > Explain the logic in @src/utils/auth.js This includes the full content of the file in the conversation. 2 Reference a directory > What's the structure of @src/components? This provides a directory listing with file information. 3 Reference MCP resources > Show me the data from @github:repos/owner/repo/issues This fetches data from connected MCP servers using the format @server:resource. See MCP resources for details. Tips: File paths can be relative or absolute @ file references add CLAUDE.md in the files directory and parent directories to context Directory references show file listings, not contents You can reference multiple files in a single message (e.g., @file1.js and @file2.js)  Use extended thinking Suppose youre working on complex architectural decisions, challenging bugs, or planning multi-step implementations that require deep reasoning. 1 Provide context and ask Claude to think > I need to implement a new authentication system using OAuth2 for our API. Think deeply about the best approach for implementing this in our codebase. Claude will gather relevant information from your codebase and use extended thinking, which will be visible in the interface. 2 Refine the thinking with follow-up prompts > think about potential security vulnerabilities in this approach > think harder about edge cases we should handle Tips to get the most value out of extended thinking: Extended thinking is most valuable for complex tasks such as: Planning complex architectural changes Debugging intricate issues Creating implementation plans for new features Understanding complex codebases Evaluating tradeoffs between different approaches The way you prompt for thinking results in varying levels of thinking depth: think triggers basic extended thinking intensifying phrases such as think more, think a lot, think harder, or think longer triggers deeper thinking For more extended thinking prompting tips, see Extended thinking tips . Claude will display its thinking process as italic gray text above the response.  Resume previous conversations Suppose youve been working on a task with Claude Code and need to continue where you left off in a later session. Claude Code provides two options for resuming previous conversations: --continue to automatically continue the most recent conversation --resume to display a conversation picker 1 Continue the most recent conversation claude --continue This immediately resumes your most recent conversation without any prompts. 2 Continue in non-interactive mode claude --continue --print \"Continue with my task\" Use --print with --continue to resume the most recent conversation in non-interactive mode, perfect for scripts or automation. 3 Show conversation picker claude --resume This displays an interactive conversation selector showing: Conversation start time Initial prompt or conversation summary Message count Use arrow keys to navigate and press Enter to select a conversation. Tips: Conversation history is stored locally on your machine Use --continue for quick access to your most recent conversation Use --resume when you need to select a specific past conversation When resuming, youll see the entire conversation history before continuing The resumed conversation starts with the same model and configuration as the original How it works: Conversation Storage : All conversations are automatically saved locally with their full message history Message Deserialization : When resuming, the entire message history is restored to maintain context Tool State : Tool usage and results from the previous conversation are preserved Context Restoration : The conversation resumes with all previous context intact Examples: claude --continue claude --continue --print \"Show me our progress\" claude --resume claude --continue --print \"Run the tests again\"  Run parallel Claude Code sessions with Git worktrees Suppose you need to work on multiple tasks simultaneously with complete code isolation between Claude Code instances. 1 Understand Git worktrees Git worktrees allow you to check out multiple branches from the same repository into separate directories. Each worktree has its own working directory with isolated files, while sharing the same Git history. Learn more in the official Git worktree documentation . 2 Create a new worktree git worktree add .. /project-feature-a -b feature-a git worktree add .. /project-bugfix bugfix-123 This creates a new directory with a separate working copy of your repository. 3 Run Claude Code in each worktree cd .. /project-feature-a claude 4 Run Claude in another worktree cd .. /project-bugfix claude 5 Manage your worktrees git worktree list git worktree remove .. /project-feature-a Tips: Each worktree has its own independent file state, making it perfect for parallel Claude Code sessions Changes made in one worktree wont affect others, preventing Claude instances from interfering with each other All worktrees share the same Git history and remote connections For long-running tasks, you can have Claude working in one worktree while you continue development in another Use descriptive directory names to easily identify which task each worktree is for Remember to initialize your development environment in each new worktree according to your projects setup. Depending on your stack, this might include: JavaScript projects: Running dependency installation ( npm install , yarn ) Python projects: Setting up virtual environments or installing with package managers Other languages: Following your projects standard setup process  Use Claude as a unix-style utility  Add Claude to your verification process Suppose you want to use Claude Code as a linter or code reviewer. Add Claude to your build script: { ... \"scripts\" : { ... \"lint:claude\" : \"claude -p 'you are a linter. please look at the changes vs. main and report any issues related to typos. report the filename and line number on one line, and a description of the issue on the second line. do not return any other text.'\" } } Tips: Use Claude for automated code review in your CI/CD pipeline Customize the prompt to check for specific issues relevant to your project Consider creating multiple scripts for different types of verification  Pipe in, pipe out Suppose you want to pipe data into Claude, and get back data in a structured format. Pipe data through Claude: cat build-error.txt | claude -p 'concisely explain the root cause of this build error' > output.txt Tips: Use pipes to integrate Claude into existing shell scripts Combine with other Unix tools for powerful workflows Consider using output-format for structured output  Control output format Suppose you need Claudes output in a specific format, especially when integrating Claude Code into scripts or other tools. 1 Use text format (default) cat data.txt | claude -p 'summarize this data' --output-format text > summary.txt This outputs just Claudes plain text response (default behavior). 2 Use JSON format cat code.py | claude -p 'analyze this code for bugs' --output-format json > analysis.json This outputs a JSON array of messages with metadata including cost and duration. 3 Use streaming JSON format cat log.txt | claude -p 'parse this log file for errors' --output-format stream-json This outputs a series of JSON objects in real-time as Claude processes the request. Each message is a valid JSON object, but the entire output is not valid JSON if concatenated. Tips: Use --output-format text for simple integrations where you just need Claudes response Use --output-format json when you need the full conversation log Use --output-format stream-json for real-time output of each conversation turn  Create custom slash commands Claude Code supports custom slash commands that you can create to quickly execute specific prompts or tasks. For more details, see the Slash commands reference page.  Create project-specific commands Suppose you want to create reusable slash commands for your project that all team members can use. 1 Create a commands directory in your project mkdir -p .claude/commands 2 Create a Markdown file for each command echo \"Analyze the performance of this code and suggest three specific optimizations:\" > .claude/commands/optimize.md 3 Use your custom command in Claude Code > /project:optimize Tips: Command names are derived from the filename (e.g., optimize.md becomes /project:optimize ) You can organize commands in subdirectories (e.g., .claude/commands/frontend/component.md becomes /project:frontend:component ) Project commands are available to everyone who clones the repository The Markdown file content becomes the prompt sent to Claude when the command is invoked  Add command arguments with $ARGUMENTS Suppose you want to create flexible slash commands that can accept additional input from users. 1 Create a command file with the $ARGUMENTS placeholder echo \"Find and fix issue Understand the issue described in the ticket 2 . Locate the relevant code in our codebase 3 . Implement a solution that addresses the root cause 4 . Add appropriate tests 5 . Prepare a concise PR description\" > .claude/commands/fix-issue.md 2 Use the command with an issue number In your Claude session, use the command with arguments. > /project:fix-issue 123 This will replace $ARGUMENTS with 123 in the prompt. Tips: The $ARGUMENTS placeholder is replaced with any text that follows the command You can position $ARGUMENTS anywhere in your command template Other useful applications: generating test cases for specific functions, creating documentation for components, reviewing code in particular files, or translating content to specified languages  Create personal slash commands Suppose you want to create personal slash commands that work across all your projects. 1 Create a commands directory in your home folder mkdir -p ~/.claude/commands 2 Create a Markdown file for each command echo \"Review this code for security vulnerabilities, focusing on:\" > ~/.claude/commands/security-review.md 3 Use your personal custom command > /user:security-review Tips: Personal commands are prefixed with /user: instead of /project: Personal commands are only available to you and not shared with your team Personal commands work across all your projects You can use these for consistent workflows across different codebases  Next steps Claude Code reference implementation Clone our development container reference implementation. Was this page helpful? Yes No Memory management Add Claude Code to your IDE On this page Understand new codebases Get a quick codebase overview Find relevant code Fix bugs efficiently Refactor code Work with tests Create pull requests Handle documentation Work with images Reference files and directories Use extended thinking Resume previous conversations Run parallel Claude Code sessions with Git worktrees Use Claude as a unix-style utility Add Claude to your verification process Pipe in, pipe out Control output format Create custom slash commands Create project-specific commands Add command arguments with $ARGUMENTS Create personal slash commands Next steps",21    "title": "Common workflows - Anthropic",22    "url": "https://docs.anthropic.com/en/docs/claude-code/common-workflows",23    "word_count": 2640,24    "char_count": 1712025  },26  {27    "chunk_id": 1,28    "text": "Anthropic home page English Search... Search... Navigation Administration Monitoring Welcome Developer Guide API Guide Claude Code Model Context Protocol (MCP) Resources Release Notes Documentation Developer Discord Support Getting started Overview Set up Quickstart Memory management Common workflows Build with Claude Add Claude Code to your IDE Model Context Protocol (MCP) GitHub Actions Claude Code SDK Troubleshooting Deployment Overview Amazon Bedrock Google Vertex AI Corporate proxy LLM gateway Development containers Administration Identity and Access Management Security Monitoring Costs Reference CLI reference Interactive mode Slash commands Settings Resources Data usage Legal and compliance Claude Code supports OpenTelemetry (OTel) metrics and events for monitoring and observability. All metrics are time series data exported via OpenTelemetrys standard metrics protocol, and events are exported via OpenTelemetrys logs/events protocol. It is the users responsibility to ensure their metrics and logs backends are properly configured and that the aggregation granularity meets their monitoring requirements. OpenTelemetry support is currently in beta and details are subject to change.  Quick Start Configure OpenTelemetry using environment variables: export CLAUDE_CODE_ENABLE_TELEMETRY = 1 export OTEL_METRICS_EXPORTER = otlp export OTEL_LOGS_EXPORTER = otlp export OTEL_EXPORTER_OTLP_PROTOCOL = grpc export OTEL_EXPORTER_OTLP_ENDPOINT = http://localhost:4317 export OTEL_EXPORTER_OTLP_HEADERS = \"Authorization=Bearer your-token\" export OTEL_METRIC_EXPORT_INTERVAL = 10000 export OTEL_LOGS_EXPORT_INTERVAL = 5000 claude The default export intervals are 60 seconds for metrics and 5 seconds for logs. During setup, you may want to use shorter intervals for debugging purposes. Remember to reset these for production use. For full configuration options, see the OpenTelemetry specification .  Administrator Configuration Administrators can configure OpenTelemetry settings for all users through the managed settings file. This allows for centralized control of telemetry settings across an organization. See the settings precedence for more information about how settings are applied. The managed settings file is located at: macOS: /Library/Application Support/ClaudeCode/managed-settings.json Linux: /etc/claude-code/managed-settings.json Example managed settings configuration: { \"env\" : { \"CLAUDE_CODE_ENABLE_TELEMETRY\" : \"1\" , \"OTEL_METRICS_EXPORTER\" : \"otlp\" , \"OTEL_LOGS_EXPORTER\" : \"otlp\" , \"OTEL_EXPORTER_OTLP_PROTOCOL\" : \"grpc\" , \"OTEL_EXPORTER_OTLP_ENDPOINT\" : \"http://collector.company.com:4317\" , \"OTEL_EXPORTER_OTLP_HEADERS\" : \"Authorization=Bearer company-token\" } } Managed settings can be distributed via MDM (Mobile Device Management) or other device management solutions. Environment variables defined in the managed settings file have high precedence and cannot be overridden by users.  Configuration Details  Common Configuration Variables Environment Variable Description Example Values CLAUDE_CODE_ENABLE_TELEMETRY Enables telemetry collection (required) 1 OTEL_METRICS_EXPORTER Metrics exporter type(s) (comma-separated) console , otlp , prometheus OTEL_LOGS_EXPORTER Logs/events exporter type(s) (comma-separated) console , otlp OTEL_EXPORTER_OTLP_PROTOCOL Protocol for OTLP exporter (all signals) grpc , http/json , http/protobuf OTEL_EXPORTER_OTLP_ENDPOINT OTLP collector endpoint (all signals) http://localhost:4317 OTEL_EXPORTER_OTLP_METRICS_PROTOCOL Protocol for metrics (overrides general) grpc , http/json , http/protobuf OTEL_EXPORTER_OTLP_METRICS_ENDPOINT OTLP metrics endpoint (overrides general) http://localhost:4318/v1/metrics OTEL_EXPORTER_OTLP_LOGS_PROTOCOL Protocol for logs (overrides general) grpc , http/json , http/protobuf OTEL_EXPORTER_OTLP_LOGS_ENDPOINT OTLP logs endpoint (overrides general) http://localhost:4318/v1/logs OTEL_EXPORTER_OTLP_HEADERS Authentication headers for OTLP Authorization=Bearer token OTEL_EXPORTER_OTLP_METRICS_CLIENT_KEY Client key for mTLS authentication Path to client key file OTEL_EXPORTER_OTLP_METRICS_CLIENT_CERTIFICATE Client certificate for mTLS authentication Path to client cert file OTEL_METRIC_EXPORT_INTERVAL Export interval in milliseconds (default: 60000) 5000 , 60000 OTEL_LOGS_EXPORT_INTERVAL Logs export interval in milliseconds (default: 5000) 1000 , 10000 OTEL_LOG_USER_PROMPTS Enable logging of user prompt content (default: disabled) 1 to enable  Metrics Cardinality Control The following environment variables control which attributes are included in metrics to manage cardinality: Environment Variable Description Default Value Example to Disable OTEL_METRICS_INCLUDE_SESSION_ID Include session.id attribute in metrics true false OTEL_METRICS_INCLUDE_VERSION Include app.version attribute in metrics false true OTEL_METRICS_INCLUDE_ACCOUNT_UUID Include user.account_uuid attribute in metrics true false These variables help control the cardinality of metrics, which affects storage requirements and query performance in your metrics backend. Lower cardinality generally means better performance and lower storage costs but less granular data for analysis.  Multi-Team Organization Support Organizations with multiple teams or departments can add custom attributes to distinguish between different groups using the OTEL_RESOURCE_ATTRIBUTES environment variable: export OTEL_RESOURCE_ATTRIBUTES = \"department=engineering,team.id=platform,cost_center=eng-123\" These custom attributes will be included in all metrics and events, allowing you to: Filter metrics by team or department Track costs per cost center Create team-specific dashboards Set up alerts for specific teams  Example Configurations export CLAUDE_CODE_ENABLE_TELEMETRY = 1 export OTEL_METRICS_EXPORTER = console export OTEL_METRIC_EXPORT_INTERVAL = 1000 export CLAUDE_CODE_ENABLE_TELEMETRY = 1 export OTEL_METRICS_EXPORTER = otlp export OTEL_EXPORTER_OTLP_PROTOCOL = grpc export OTEL_EXPORTER_OTLP_ENDPOINT = http://localhost:4317 export CLAUDE_CODE_ENABLE_TELEMETRY = 1 export OTEL_METRICS_EXPORTER = prometheus export CLAUDE_CODE_ENABLE_TELEMETRY = 1 export OTEL_METRICS_EXPORTER = console,otlp export OTEL_EXPORTER_OTLP_PROTOCOL = http/json export CLAUDE_CODE_ENABLE_TELEMETRY = 1 export OTEL_METRICS_EXPORTER = otlp export OTEL_LOGS_EXPORTER = otlp export OTEL_EXPORTER_OTLP_METRICS_PROTOCOL = http/protobuf export OTEL_EXPORTER_OTLP_METRICS_ENDPOINT = http://metrics.company.com:4318 export OTEL_EXPORTER_OTLP_LOGS_PROTOCOL = grpc export OTEL_EXPORTER_OTLP_LOGS_ENDPOINT = http://logs.company.com:4317 export CLAUDE_CODE_ENABLE_TELEMETRY = 1 export OTEL_METRICS_EXPORTER = otlp export OTEL_EXPORTER_OTLP_PROTOCOL = grpc export OTEL_EXPORTER_OTLP_ENDPOINT = http://localhost:4317 export CLAUDE_CODE_ENABLE_TELEMETRY = 1 export OTEL_LOGS_EXPORTER = otlp export OTEL_EXPORTER_OTLP_PROTOCOL = grpc export OTEL_EXPORTER_OTLP_ENDPOINT = http://localhost:4317  Available Metrics and Events  Standard Attributes All metrics and events share these standard attributes: Attribute Description Controlled By session.id Unique session identifier OTEL_METRICS_INCLUDE_SESSION_ID (default: true) app.version Current Claude Code version OTEL_METRICS_INCLUDE_VERSION (default: false) organization.id Organization UUID (when authenticated) Always included when available user.account_uuid Account UUID (when authenticated) OTEL_METRICS_INCLUDE_ACCOUNT_UUID (default: true) terminal.type Terminal type (e.g., iTerm.app , vscode , cursor , tmux ) Always included when detected  Metrics Claude Code exports the following metrics: Metric Name Description Unit claude_code.session.count Count of CLI sessions started count claude_code.lines_of_code.count Count of lines of code modified count claude_code.pull_request.count Number of pull requests created count claude_code.commit.count Number of git commits created count claude_code.cost.usage Cost of the Claude Code session USD claude_code.token.usage Number of tokens used tokens claude_code.code_edit_tool.decision Count of code editing tool permission decisions count  Metric Details  Session Counter Incremented at the start of each session. Attributes : All standard attributes  Lines of Code Counter Incremented when code is added or removed. Attributes : All standard attributes type : ( \"added\" , \"removed\" )  Pull Request Counter Incremented when creating pull requests via Claude Code. Attributes : All standard attributes  Commit Counter Incremented when creating git commits via Claude Code. Attributes : All standard attributes  Cost Counter Incremented after each API request. Attributes : All standard attributes model : Model identifier (e.g., claude-3-5-sonnet-20241022)  Token Counter Incremented after each API request. Attributes : All standard attributes type : ( \"input\" , \"output\" , \"cacheRead\" , \"cacheCreation\" ) model : Model identifier (e.g., claude-3-5-sonnet-20241022)  Code Edit Tool Decision Counter Incremented when user accepts or rejects Edit, MultiEdit, Write, or NotebookEdit tool usage. Attributes : All standard attributes tool : Tool name ( \"Edit\" , \"MultiEdit\" , \"Write\" , \"NotebookEdit\" ) decision : User decision ( \"accept\" , \"reject\" ) language : Programming language of the edited file (e.g., \"TypeScript\" , \"Python\" , \"JavaScript\" , \"Markdown\" ). Returns \"unknown\" for unrecognized file extensions.  Events Claude Code exports the following events via OpenTelemetry logs/events (when OTEL_LOGS_EXPORTER is configured):  User Prompt Event Logged when a user submits a prompt. Event Name : claude_code.user_prompt Attributes : All standard attributes event.name : \"user_prompt\" event.timestamp : ISO 8601 timestamp prompt_length : Length of the prompt prompt : Prompt content (redacted by default, enable with OTEL_LOG_USER_PROMPTS=1 )  Tool Result Event Logged when a tool completes execution. Event Name : claude_code.tool_result Attributes : All standard attributes event.name : \"tool_result\" event.timestamp : ISO 8601 timestamp name : Name of the tool success : \"true\" or \"false\" duration_ms : Execution time in milliseconds error : Error message (if failed)  API Request Event Logged for each API request to Claude. Event Name : claude_code.api_request Attributes : All standard attributes event.name : \"api_request\" event.timestamp : ISO 8601 timestamp model : Model used (e.g., claude-3-5-sonnet-20241022) cost_usd : Estimated cost in USD duration_ms : Request duration in milliseconds input_tokens : Number of input tokens output_tokens : Number of output tokens cache_read_tokens : Number of tokens read from cache cache_creation_tokens : Number of tokens used for cache creation  API Error Event Logged when an API request to Claude fails. Event Name : claude_code.api_error Attributes : All standard attributes event.name : \"api_error\" event.timestamp : ISO 8601 timestamp model : Model used (e.g., claude-3-5-sonnet-20241022) error : Error message status_code : HTTP status code (if applicable) duration_ms : Request duration in milliseconds attempt : Attempt number (for retried requests)  Tool Decision Event Logged when a tool permission decision is made (accept/reject). Event Name : claude_code.tool_decision Attributes : All standard attributes event.name : \"tool_decision\" event.timestamp : ISO 8601 timestamp tool_name : Name of the tool (e.g., Read, Edit, MultiEdit, Write, NotebookEdit, etc.) decision : Either \"accept\" or \"reject\" source : Decision source - \"config\" , \"user_permanent\" , \"user_temporary\" , \"user_abort\" , or \"user_reject\"  Interpreting Metrics and Events Data The metrics exported by Claude Code provide valuable insights into usage patterns and productivity. Here are some common visualizations and analyses you can create:  Usage Monitoring Metric Analysis Opportunity claude_code.token.usage Break down by type (input/output), user, team, or model claude_code.session.count Track adoption and engagement over time claude_code.lines_of_code.count Measure productivity by tracking code additions/removals claude_code.commit.count & claude_code.pull_request.count Understand impact on development workflows  Cost Monitoring The claude_code.cost.usage metric helps with: Tracking usage trends across teams or individuals Identifying high-usage sessions for optimization Cost metrics are approximations. For official billing data, refer to your API provider (Anthropic Console, AWS Bedrock, or Google Cloud Vertex).  Alerting and Segmentation Common alerts to consider: Cost spikes Unusual token consumption High session volume from specific users All metrics can be segmented by user.account_uuid , organization.id , session.id , model , and app.version .  Event Analysis The event data provides detailed insights into Claude Code interactions: Tool Usage Patterns : Analyze tool result events to identify: Most frequently used tools Tool success rates Average tool execution times Error patterns by tool type Performance Monitoring : Track API request durations and tool execution times to identify performance bottlenecks.  Backend Considerations Your choice of metrics and logs backends will determine the types of analyses you can perform:  For Metrics: Time series databases (e.g., Prometheus) : Rate calculations, aggregated metrics Columnar stores (e.g., ClickHouse) : Complex queries, unique user analysis Full-featured observability platforms (e.g., Honeycomb, Datadog) : Advanced querying, visualization, alerting  For Events/Logs: Log aggregation systems (e.g., Elasticsearch, Loki) : Full-text search, log analysis Columnar stores (e.g., ClickHouse) : Structured event analysis Full-featured observability platforms (e.g., Honeycomb, Datadog) : Correlation between metrics and events For organizations requiring Daily/Weekly/Monthly Active User (DAU/WAU/MAU) metrics, consider backends that support efficient unique value queries.  Service Information All metrics are exported with: Service Name: claude-code Service Version: Current Claude Code version Meter Name: com.anthropic.claude_code  Security/Privacy Considerations Telemetry is opt-in and requires explicit configuration Sensitive information like API keys or file contents are never included in metrics or events User prompt content is redacted by default - only prompt length is recorded. To enable user prompt logging, set OTEL_LOG_USER_PROMPTS=1 Was this page helpful? Yes No Security Costs On this page Quick Start Administrator Configuration Configuration Details Common Configuration Variables Metrics Cardinality Control Multi-Team Organization Support Example Configurations Available Metrics and Events Standard Attributes Metrics Metric Details Session Counter Lines of Code Counter Pull Request Counter Commit Counter Cost Counter Token Counter Code Edit Tool Decision Counter Events User Prompt Event Tool Result Event API Request Event API Error Event Tool Decision Event Interpreting Metrics and Events Data Usage Monitoring Cost Monitoring Alerting and Segmentation Event Analysis Backend Considerations For Metrics: For Events/Logs: Service Information Security/Privacy Considerations",29    "title": "Monitoring - Anthropic",30    "url": "https://docs.anthropic.com/en/docs/claude-code/monitoring-usage",31    "word_count": 1834,32    "char_count": 1507033  },34  {35    "chunk_id": 1,36    "text": "Anthropic home page English Search... Search... Navigation Build with Claude Troubleshooting Welcome Developer Guide API Guide Claude Code Model Context Protocol (MCP) Resources Release Notes Documentation Developer Discord Support Getting started Overview Set up Quickstart Memory management Common workflows Build with Claude Add Claude Code to your IDE Model Context Protocol (MCP) GitHub Actions Claude Code SDK Troubleshooting Deployment Overview Amazon Bedrock Google Vertex AI Corporate proxy LLM gateway Development containers Administration Identity and Access Management Security Monitoring Costs Reference CLI reference Interactive mode Slash commands Settings Resources Data usage Legal and compliance  Common installation issues  Linux permission issues When installing Claude Code with npm, you may encounter permission errors if your npm global prefix is not user writable (eg. /usr , or /usr/local ).  Recommended solution: Create a user-writable npm prefix The safest approach is to configure npm to use a directory within your home folder: npm list -g --depth = 0 > ~/npm-global-packages.txt mkdir -p ~/.npm-global npm config set prefix ~/.npm-global echo 'export PATH=~/.npm-global/bin:$PATH' >> ~/.bashrc source ~/.bashrc npm install -g @anthropic-ai/claude-code This solution is recommended because it: Avoids modifying system directory permissions Creates a clean, dedicated location for your global npm packages Follows security best practices  System Recovery: If you have run commands that change ownership and permissions of system files or similar If youve already run a command that changed system directory permissions (such as sudo chown -R $USER:$(id -gn) /usr && sudo chmod -R u+w /usr ) and your system is now broken (for example, if you see sudo: /usr/bin/sudo must be owned by uid 0 and have the setuid bit set ), youll need to perform recovery steps. Ubuntu/Debian Recovery Method: While rebooting, hold SHIFT to access the GRUB menu Select Advanced options for Ubuntu/Debian Choose the recovery mode option Select Drop to root shell prompt Remount the filesystem as writable: mount -o remount,rw / Fix permissions: chown -R root:root /usr chmod -R 755 /usr chown -R YOUR_USERNAME:YOUR_USERNAME /usr/local chmod u+s /usr/bin/sudo chmod 4755 /usr/bin/sudo chmod u+s /usr/bin/su chmod u+s /usr/bin/passwd chmod u+s /usr/bin/newgrp chmod u+s /usr/bin/gpasswd chmod u+s /usr/bin/chsh chmod u+s /usr/bin/chfn chown root:root /usr/libexec/sudo/sudoers.so chmod 4755 /usr/libexec/sudo/sudoers.so chown root:root /etc/sudo.conf chmod 644 /etc/sudo.conf Reinstall affected packages (optional but recommended): dpkg --get-selections > /tmp/installed_packages.txt awk '{print $1}' /tmp/installed_packages.txt | xargs -r apt-get install --reinstall -y Reboot: reboot Alternative Live USB Recovery Method: If the recovery mode doesnt work, you can use a live USB: Boot from a live USB (Ubuntu, Debian, or any Linux distribution) Find your system partition: lsblk Mount your system partition: sudo mount /dev/sdXY /mnt If you have a separate boot partition, mount it too: sudo mount /dev/sdXZ /mnt/boot Chroot into your system: sudo chroot /mnt sudo arch-chroot /mnt Follow steps 6-8 from the Ubuntu/Debian recovery method above After restoring your system, follow the recommended solution above to set up a user-writable npm prefix.  Auto-updater issues If Claude Code cant update automatically, it may be due to permission issues with your npm global prefix directory. Follow the recommended solution above to fix this. If you prefer to disable the auto-updater instead, you can use: If you prefer to disable the auto-updater instead , you can set the DISABLE_AUTOUPDATER environment variable to 1  Permissions and authentication  Repeated permission prompts If you find yourself repeatedly approving the same commands, you can allow specific tools to run without approval using the /permissions command. See Permissions docs .  Authentication issues If youre experiencing authentication problems: Run /logout to sign out completely Close Claude Code Restart with claude and complete the authentication process again If problems persist, try: rm -rf ~/.config/claude-code/auth.json claude This removes your stored authentication information and forces a clean login.  Performance and stability  High CPU or memory usage Claude Code is designed to work with most development environments, but may consume significant resources when processing large codebases. If youre experiencing performance issues: Use /compact regularly to reduce context size Close and restart Claude Code between major tasks Consider adding large build directories to your .gitignore file  Command hangs or freezes If Claude Code seems unresponsive: Press Ctrl+C to attempt to cancel the current operation If unresponsive, you may need to close the terminal and restart  ESC key not working in JetBrains (IntelliJ, PyCharm, etc.) terminals If youre using Claude Code in JetBrains terminals and the ESC key doesnt interrupt the agent as expected, this is likely due to a keybinding clash with JetBrains default shortcuts. To fix this issue: Go to Settings  Tools  Terminal Click the Configure terminal keybindings hyperlink next to Override IDE Shortcuts Within the terminal keybindings, scroll down to Switch focus to Editor and delete that shortcut This will allow the ESC key to properly function for canceling Claude Code operations instead of being captured by PyCharms Switch focus to Editor action.  Getting more help If youre experiencing issues not covered here: Use the /bug command within Claude Code to report problems directly to Anthropic Check the GitHub repository for known issues Run /doctor to check the health of your Claude Code installation Was this page helpful? Yes No Claude Code SDK Overview On this page Common installation issues Linux permission issues Recommended solution: Create a user-writable npm prefix System Recovery: If you have run commands that change ownership and permissions of system files or similar Auto-updater issues Permissions and authentication Repeated permission prompts Authentication issues Performance and stability High CPU or memory usage Command hangs or freezes ESC key not working in JetBrains (IntelliJ, PyCharm, etc.) terminals Getting more help",37    "title": "Troubleshooting - Anthropic",38    "url": "https://docs.anthropic.com/en/docs/claude-code/troubleshooting",39    "word_count": 912,40    "char_count": 630341  },42  {43    "chunk_id": 1,44    "text": "Anthropic home page English Search... Search... Navigation Reference CLI reference Welcome Developer Guide API Guide Claude Code Model Context Protocol (MCP) Resources Release Notes Documentation Developer Discord Support Getting started Overview Set up Quickstart Memory management Common workflows Build with Claude Add Claude Code to your IDE Model Context Protocol (MCP) GitHub Actions Claude Code SDK Troubleshooting Deployment Overview Amazon Bedrock Google Vertex AI Corporate proxy LLM gateway Development containers Administration Identity and Access Management Security Monitoring Costs Reference CLI reference Interactive mode Slash commands Settings Resources Data usage Legal and compliance  CLI commands Command Description Example claude Start interactive REPL claude claude \"query\" Start REPL with initial prompt claude \"explain this project\" claude -p \"query\" Query via SDK, then exit claude -p \"explain this function\" cat file | claude -p \"query\" Process piped content cat logs.txt | claude -p \"explain\" claude -c Continue most recent conversation claude -c claude -c -p \"query\" Continue via SDK claude -c -p \"Check for type errors\" claude -r \"<session-id>\" \"query\" Resume session by ID claude -r \"abc123\" \"Finish this PR\" claude update Update to latest version claude update claude mcp Configure Model Context Protocol (MCP) servers See the Claude Code MCP documentation .  CLI flags Customize Claude Codes behavior with these command-line flags: Flag Description Example --add-dir Add additional working directories for Claude to access (validates each path exists as a directory) claude --add-dir ../apps ../lib --allowedTools A list of tools that should be allowed without prompting the user for permission, in addition to settings.json files \"Bash(git log:*)\" \"Bash(git diff:*)\" \"Write\" --disallowedTools A list of tools that should be disallowed without prompting the user for permission, in addition to settings.json files \"Bash(git log:*)\" \"Bash(git diff:*)\" \"Write\" --print , -p Print response without interactive mode (see SDK documentation for programmatic usage details) claude -p \"query\" --output-format Specify output format for print mode (options: text , json , stream-json ) claude -p \"query\" --output-format json --input-format Specify input format for print mode (options: text , stream-json ) claude -p --output-format json --input-format stream-json --verbose Enable verbose logging, shows full turn-by-turn output (helpful for debugging in both print and interactive modes) claude --verbose --max-turns Limit the number of agentic turns in non-interactive mode claude -p --max-turns 3 \"query\" --model Sets the model for the current session with an alias for the latest model ( sonnet or opus ) or a models full name claude --model claude-sonnet-4-20250514 --permission-prompt-tool Specify an MCP tool to handle permission prompts in non-interactive mode claude -p --permission-prompt-tool mcp_auth_tool \"query\" --resume Resume a specific session by ID, or by choosing in interactive mode claude --resume abc123 \"query\" --continue Load the most recent conversation in the current directory claude --continue --dangerously-skip-permissions Skip permission prompts (use with caution) claude --dangerously-skip-permissions The --output-format json flag is particularly useful for scripting and automation, allowing you to parse Claudes responses programmatically. For detailed information about print mode ( -p ) including output formats, streaming, verbose logging, and programmatic usage, see the SDK documentation .  See also Interactive mode - Shortcuts, input modes, and interactive features Slash commands - Interactive session commands Quickstart guide - Getting started with Claude Code Common workflows - Advanced workflows and patterns Settings - Configuration options SDK documentation - Programmatic usage and integrations Was this page helpful? Yes No Costs Interactive mode On this page CLI commands CLI flags See also",45    "title": "CLI reference - Anthropic",46    "url": "https://docs.anthropic.com/en/docs/claude-code/cli-reference",47    "word_count": 557,48    "char_count": 396849  },50  {51    "chunk_id": 1,52    "text": "Anthropic home page English Search... Search... Navigation Deployment Enterprise deployment overview Welcome Developer Guide API Guide Claude Code Model Context Protocol (MCP) Resources Release Notes Documentation Developer Discord Support Getting started Overview Set up Quickstart Memory management Common workflows Build with Claude Add Claude Code to your IDE Model Context Protocol (MCP) GitHub Actions Claude Code SDK Troubleshooting Deployment Overview Amazon Bedrock Google Vertex AI Corporate proxy LLM gateway Development containers Administration Identity and Access Management Security Monitoring Costs Reference CLI reference Interactive mode Slash commands Settings Resources Data usage Legal and compliance This page provides an overview of available deployment options and helps you choose the right configuration for your organization.  Provider comparison Feature Anthropic Amazon Bedrock Google Vertex AI Regions Supported countries Multiple AWS regions Multiple GCP regions Prompt caching Enabled by default Enabled by default Contact Google for enablement Authentication API key AWS credentials (IAM) GCP credentials (OAuth/Service Account) Cost tracking Dashboard AWS Cost Explorer GCP Billing Enterprise features Teams, usage monitoring IAM policies, CloudTrail IAM roles, Cloud Audit Logs  Cloud providers Amazon Bedrock Use Claude models through AWS infrastructure with IAM-based authentication and AWS-native monitoring Google Vertex AI Access Claude models via Google Cloud Platform with enterprise-grade security and compliance  Corporate infrastructure Corporate Proxy Configure Claude Code to work with your organizations proxy servers and SSL/TLS requirements LLM Gateway Deploy centralized model access with usage tracking, budgeting, and audit logging  Configuration overview Claude Code supports flexible configuration options that allow you to combine different providers and infrastructure: Understand the difference between: Corporate proxy : An HTTP/HTTPS proxy for routing traffic (set via HTTPS_PROXY or HTTP_PROXY ) LLM Gateway : A service that handles authentication and provides provider-compatible endpoints (set via ANTHROPIC_BASE_URL , ANTHROPIC_BEDROCK_BASE_URL , or ANTHROPIC_VERTEX_BASE_URL ) Both configurations can be used in tandem.  Using Bedrock with corporate proxy Route Bedrock traffic through a corporate HTTP/HTTPS proxy: export CLAUDE_CODE_USE_BEDROCK = 1 export AWS_REGION = us-east-1 export HTTPS_PROXY = 'https://proxy.example.com:8080'  Using Bedrock with LLM Gateway Use a gateway service that provides Bedrock-compatible endpoints: export CLAUDE_CODE_USE_BEDROCK = 1 export ANTHROPIC_BEDROCK_BASE_URL = 'https://your-llm-gateway.com/bedrock' export CLAUDE_CODE_SKIP_BEDROCK_AUTH = 1  Using Vertex AI with corporate proxy Route Vertex AI traffic through a corporate HTTP/HTTPS proxy: export CLAUDE_CODE_USE_VERTEX = 1 export CLOUD_ML_REGION = us-east5 export ANTHROPIC_VERTEX_PROJECT_ID = your-project-id export HTTPS_PROXY = 'https://proxy.example.com:8080'  Using Vertex AI with LLM Gateway Combine Google Vertex AI models with an LLM gateway for centralized management: export CLAUDE_CODE_USE_VERTEX = 1 export ANTHROPIC_VERTEX_BASE_URL = 'https://your-llm-gateway.com/vertex' export CLAUDE_CODE_SKIP_VERTEX_AUTH = 1  Authentication configuration Claude Code uses the ANTHROPIC_AUTH_TOKEN for both Authorization and Proxy-Authorization headers when needed. The SKIP_AUTH flags ( CLAUDE_CODE_SKIP_BEDROCK_AUTH , CLAUDE_CODE_SKIP_VERTEX_AUTH ) are used in LLM gateway scenarios where the gateway handles provider authentication.  Choosing the right deployment configuration Consider these factors when selecting your deployment approach:  Direct provider access Best for organizations that: Want the simplest setup Have existing AWS or GCP infrastructure Need provider-native monitoring and compliance  Corporate proxy Best for organizations that: Have existing corporate proxy requirements Need traffic monitoring and compliance Must route all traffic through specific network paths  LLM Gateway Best for organizations that: Need usage tracking across teams Want to dynamically switch between models Require custom rate limiting or budgets Need centralized authentication management  Debugging When debugging your deployment: Use the claude /status slash command . This command provides observability into any applied authentication, proxy, and URL settings. Set environment variable export ANTHROPIC_LOG=debug to log requests.  Best practices for organizations We strongly recommend investing in documentation so that Claude Code understands your codebase. Many organizations make a CLAUDE.md file (which we also refer to as memory) in the root of the repository that contains the system architecture, how to run tests and other common commands, and best practices for contributing to the codebase. This file is typically checked into source control so that all users can benefit from it. Learn more . If you have a custom development environment, we find that creating a one click way to install Claude Code is key to growing adoption across an organization. Encourage new users to try Claude Code for codebase Q&A, or on smaller bug fixes or feature requests. Ask Claude Code to make a plan. Check Claudes suggestions and give feedback if its off-track. Over time, as users understand this new paradigm better, then theyll be more effective at letting Claude Code run more agentically. Security teams can configure managed permissions for what Claude Code is and is not allowed to do, which cannot be overwritten by local configuration. Learn more . MCP is a great way to give Claude Code more information, such as connecting to ticket management systems or error logs. We recommend that one central team configures MCP servers and checks a .mcp.json configuration into the codebase so that all users benefit. Learn more . At Anthropic, we trust Claude Code to power development across every Anthropic codebase. We hope you enjoy using Claude Code as much as we do!  Next steps Set up Amazon Bedrock for AWS-native deployment Configure Google Vertex AI for GCP deployment Implement Corporate Proxy for network requirements Deploy LLM Gateway for enterprise management Settings for configuration options and environment variables Was this page helpful? Yes No Troubleshooting Amazon Bedrock On this page Provider comparison Cloud providers Corporate infrastructure Configuration overview Using Bedrock with corporate proxy Using Bedrock with LLM Gateway Using Vertex AI with corporate proxy Using Vertex AI with LLM Gateway Authentication configuration Choosing the right deployment configuration Direct provider access Corporate proxy LLM Gateway Debugging Best practices for organizations Next steps",53    "title": "Enterprise deployment overview - Anthropic",54    "url": "https://docs.anthropic.com/en/docs/claude-code/third-party-integrations",55    "word_count": 916,56    "char_count": 677057  },58  {59    "chunk_id": 1,60    "text": "Anthropic home page English Search... Search... Navigation Getting started Claude Code overview Welcome Developer Guide API Guide Claude Code Model Context Protocol (MCP) Resources Release Notes Documentation Developer Discord Support Getting started Overview Set up Quickstart Memory management Common workflows Build with Claude Add Claude Code to your IDE Model Context Protocol (MCP) GitHub Actions Claude Code SDK Troubleshooting Deployment Overview Amazon Bedrock Google Vertex AI Corporate proxy LLM gateway Development containers Administration Identity and Access Management Security Monitoring Costs Reference CLI reference Interactive mode Slash commands Settings Resources Data usage Legal and compliance By integrating directly with your development environment, Claude Code streamlines your workflow without requiring additional servers or complex setup.  Basic usage To install Claude Code, use NPM: npm install -g @anthropic-ai/claude-code For more detailed installation instructions, see Set up Claude Code . To run Claude Code, simply call the claude CLI: claude You can then prompt Claude directly from the interactive Claude Code REPL session. For more usage instructions, see Quickstart .  Why Claude Code?  Accelerate development Use Claude Code to accelerate development with the following key capabilities: Editing files and fixing bugs across your codebase Answering questions about your codes architecture and logic Executing and fixing tests, linting, and other commands Searching through git history, resolving merge conflicts, and creating commits and PRs Browsing documentation and resources from the internet using web search  Security and privacy by design Your codes security is paramount. Claude Codes architecture ensures: Direct API connection : Your queries go straight to Anthropics API without intermediate servers Works where you work : Operates directly in your terminal Understands context : Maintains awareness of your entire project structure Takes action : Performs real operations like editing files and creating commits  Enterprise integration Claude Code seamlessly integrates with enterprise AI platforms. You can connect to Amazon Bedrock or Google Vertex AI for secure, compliant deployments that meet your organizations requirements.  Next steps Setup Install and authenticate Claude Code Quickstart See Claude Code in action with practical examples Commands Learn about CLI commands and controls Configuration Customize Claude Code for your workflow  Additional resources Common workflows Step-by-step guides for common workflows Troubleshooting Solutions for common issues with Claude Code Bedrock & Vertex integrations Configure Claude Code with Amazon Bedrock or Google Vertex AI Reference implementation Clone our development container reference implementation. Was this page helpful? Yes No Set up On this page Basic usage Why Claude Code? Accelerate development Security and privacy by design Enterprise integration Next steps Additional resources",61    "title": "Claude Code overview - Anthropic",62    "url": "https://docs.anthropic.com/en/docs/claude-code/overview",63    "word_count": 416,64    "char_count": 300665  },66  {67    "chunk_id": 1,68    "text": "Anthropic home page English Search... Search... Navigation Getting started Quickstart Welcome Developer Guide API Guide Claude Code Model Context Protocol (MCP) Resources Release Notes Documentation Developer Discord Support Getting started Overview Set up Quickstart Memory management Common workflows Build with Claude Add Claude Code to your IDE Model Context Protocol (MCP) GitHub Actions Claude Code SDK Troubleshooting Deployment Overview Amazon Bedrock Google Vertex AI Corporate proxy LLM gateway Development containers Administration Identity and Access Management Security Monitoring Costs Reference CLI reference Interactive mode Slash commands Settings Resources Data usage Legal and compliance This quickstart guide will have you using AI-powered coding assistance in just a few minutes. By the end, youll understand how to use Claude Code for common development tasks.  Before you begin Make sure you have: Installed Claude Code A terminal or command prompt open A code project to work with (or use our sample project )  Step 1: Start your first session Open your terminal in any project directory and start Claude Code: cd /path/to/your/project claude Youll see the Claude Code prompt inside a new interactive session:  Welcome to Claude Code! ... > Try \"create a util logging.py that...\"  Step 2: Ask your first question Lets start with understanding your codebase. Try one of these commands: > what does this project do? Claude will analyze your files and provide a summary. You can also ask more specific questions: > what technologies does this project use? > where is the main entry point? > explain the folder structure Claude Code reads your files as needed - you dont have to manually add context.  Step 3: Make your first code change Now lets make Claude Code do some actual coding. Try a simple task: > add a hello world function to the main file Claude Code will: Find the appropriate file Show you the proposed changes Ask for your approval Make the edit Claude Code always asks for permission before modifying files. You can approve individual changes or enable Accept all mode for a session.  Step 4: Use Git with Claude Code Claude Code makes Git operations conversational: > what files have I changed? > commit my changes with a descriptive message You can also prompt for more complex Git operations: > create a new branch called feature/quickstart > show me the last 5 commits > help me resolve merge conflicts  Step 5: Fix a bug or add a feature Claude is proficient at debugging and feature implementation. Describe what you want in natural language: > add input validation to the user registration form Or fix existing issues: > there's a bug where users can submit empty forms - fix it Claude Code will: Locate the relevant code Understand the context Implement a solution Run tests if available  Step 6: Test out other common workflows There are a number of ways to work with Claude: Refactor code > refactor the authentication module to use async/await instead of callbacks Write tests > write unit tests for the calculator functions Update documentation > update the README with installation instructions Code review > review my changes and suggest improvements Remember : Claude Code is your AI pair programmer. Talk to it like you would a helpful colleague - describe what you want to achieve, and it will help you get there.  Essential commands Here are the most important commands for daily use: Command What it does Example claude Start interactive mode claude claude \"task\" Run a one-time task claude \"fix the build error\" claude -p \"query\" Run one-off query, then exit claude -p \"explain this function\" claude -c Continue most recent conversation claude -c claude -r Resume a previous conversation claude -r claude commit Create a Git commit claude commit /clear Clear conversation history > /clear /help Show available commands > /help exit or Ctrl+C Exit Claude Code > exit  Pro tips for beginners Be specific with your requests Instead of: fix the bug Try: fix the login bug where users see a blank screen after entering wrong credentials Use step-by-step instructions Break complex tasks into steps: > 1. create a new API endpoint for user profiles > 2. add validation for required fields > 3. write tests for the endpoint Let Claude explore first Before making changes, let Claude understand your code: > analyze the database schema > how does error handling work in this app? Save time with shortcuts Use Tab for command completion Press  for command history Type / to see all slash commands  Whats next? Now that youve learned the basics, explore more advanced features: CLI reference Master all commands and options Configuration Customize Claude Code for your workflow Common workflows Learn advanced techniques  Getting help In Claude Code : Type /help or ask how do I Documentation : Youre here! Browse other guides Community : Join our Discord for tips and support Was this page helpful? Yes No Set up Memory management On this page Before you begin Step 1: Start your first session Step 2: Ask your first question Step 3: Make your first code change Step 4: Use Git with Claude Code Step 5: Fix a bug or add a feature Step 6: Test out other common workflows Essential commands Pro tips for beginners Whats next? Getting help",69    "title": "Quickstart - Anthropic",70    "url": "https://docs.anthropic.com/en/docs/claude-code/quickstart",71    "word_count": 873,72    "char_count": 528473  },74  {75    "chunk_id": 1,76    "text": "Anthropic home page English Search... Search... Navigation Build with Claude Claude Code SDK Welcome Developer Guide API Guide Claude Code Model Context Protocol (MCP) Resources Release Notes Documentation Developer Discord Support Getting started Overview Set up Quickstart Memory management Common workflows Build with Claude Add Claude Code to your IDE Model Context Protocol (MCP) GitHub Actions Claude Code SDK Troubleshooting Deployment Overview Amazon Bedrock Google Vertex AI Corporate proxy LLM gateway Development containers Administration Identity and Access Management Security Monitoring Costs Reference CLI reference Interactive mode Slash commands Settings Resources Data usage Legal and compliance The Claude Code SDK enables running Claude Code as a subprocess, providing a way to build AI-powered coding assistants and tools that leverage Claudes capabilities. The SDK is available for command line, TypeScript, and Python usage.  Authentication To use the Claude Code SDK, we recommend creating a dedicated API key: Create an Anthropic API key in the Anthropic Console Then, set the ANTHROPIC_API_KEY environment variable. We recommend storing this key securely (eg. using a Github secret )  Basic SDK usage The Claude Code SDK allows you to use Claude Code in non-interactive mode from your applications.  Command line Here are a few basic examples for the command line SDK: $ claude -p \"Write a function to calculate Fibonacci numbers\" $ echo \"Explain this code\" | claude -p $ claude -p \"Generate a hello world function\" --output-format json $ claude -p \"Build a React component\" --output-format stream-json  TypeScript The TypeScript SDK is included in the main @anthropic-ai/claude-code package on NPM: import { query , type SDKMessage } from \"@anthropic-ai/claude-code\" ; const messages : SDKMessage [ ] = [ ] ; for await ( const message of query ( { prompt : \"Write a haiku about foo.py\" , abortController : new AbortController ( ) , options : { maxTurns : 3 , } , } ) ) { messages . push ( message ) ; } console . log ( messages ) ; The TypeScript SDK accepts all arguments supported by the command line SDK, as well as: Argument Description Default abortController Abort controller new AbortController() cwd Current working directory process.cwd() executable Which JavaScript runtime to use node when running with Node.js, bun when running with Bun executableArgs Arguments to pass to the executable [] pathToClaudeCodeExecutable Path to the Claude Code executable Executable that ships with @anthropic-ai/claude-code  Python The Python SDK is available as claude-code-sdk on PyPI: pip install claude-code-sdk Prerequisites: Python 3.10+ Node.js Claude Code CLI: npm install -g @anthropic-ai/claude-code Basic usage: import anyio from claude_code_sdk import query , ClaudeCodeOptions , Message async def main ( ) : messages : list [ Message ] = [ ] async for message in query ( prompt = \"Write a haiku about foo.py\" , options = ClaudeCodeOptions ( max_turns = 3 ) ) : messages . append ( message ) print ( messages ) anyio . run ( main ) The Python SDK accepts all arguments supported by the command line SDK through the ClaudeCodeOptions class: from claude_code_sdk import query , ClaudeCodeOptions from pathlib import Path options = ClaudeCodeOptions ( max_turns = 3 , system_prompt = \"You are a helpful assistant\" , cwd = Path ( \"/path/to/project\" ) , allowed_tools = [ \"Read\" , \"Write\" , \"Bash\" ] , permission_mode = \"acceptEdits\" ) async for message in query ( prompt = \"Hello\" , options = options ) : print ( message )  Advanced usage The documentation below uses the command line SDK as an example, but can also be used with the TypeScript and Python SDKs.  Multi-turn conversations For multi-turn conversations, you can resume conversations or continue from the most recent session: $ claude --continue $ claude --continue \"Now refactor this for better performance\" $ claude --resume 550e8400-e29b-41d4-a716-446655440000 $ claude -p --resume 550e8400-e29b-41d4-a716-446655440000 \"Update the tests\" $ claude -p --continue \"Add error handling\"  Custom system prompts You can provide custom system prompts to guide Claudes behavior: $ claude -p \"Build a REST API\" --system-prompt \"You are a senior backend engineer. Focus on security, performance, and maintainability.\" $ claude -p \"Create a database schema\" --system-prompt \"You are a database architect. Use PostgreSQL best practices and include proper indexing.\" You can also append instructions to the default system prompt: $ claude -p \"Build a REST API\" --append-system-prompt \"After writing code, be sure to code review yourself.\"  MCP Configuration The Model Context Protocol (MCP) allows you to extend Claude Code with additional tools and resources from external servers. Using the --mcp-config flag, you can load MCP servers that provide specialized capabilities like database access, API integrations, or custom tooling. Create a JSON configuration file with your MCP servers: { \"mcpServers\" : { \"filesystem\" : { \"command\" : \"npx\" , \"args\" : [ \"-y\" , \"@modelcontextprotocol/server-filesystem\" , \"/path/to/allowed/files\" ] } , \"github\" : { \"command\" : \"npx\" , \"args\" : [ \"-y\" , \"@modelcontextprotocol/server-github\" ] , \"env\" : { \"GITHUB_TOKEN\" : \"your-github-token\" } } } } Then use it with Claude Code: $ claude -p \"List all files in the project\" --mcp-config mcp-servers.json $ claude -p \"Search for TODO comments\"  --mcp-config mcp-servers.json  --allowedTools \"mcp__filesystem__read_file,mcp__filesystem__list_directory\" $ claude -p \"Deploy the application\"  --mcp-config mcp-servers.json  --allowedTools \"mcp__permissions__approve\"  --permission-prompt-tool mcp__permissions__approve When using MCP tools, you must explicitly allow them using the --allowedTools flag. MCP tool names follow the pattern mcp__<serverName>__<toolName> where: serverName is the key from your MCP configuration file toolName is the specific tool provided by that server This security measure ensures that MCP tools are only used when explicitly permitted. If you specify just the server name (i.e., mcp__<serverName> ), all tools from that server will be allowed. Glob patterns (e.g., mcp__go* ) are not supported.  Custom permission prompt tool Optionally, use --permission-prompt-tool to pass in an MCP tool that we will use to check whether or not the user grants the model permissions to invoke a given tool. When the model invokes a tool the following happens: We first check permission settings: all settings.json files , as well as --allowedTools and --disallowedTools passed into the SDK; if one of these allows or denies the tool call, we proceed with the tool call Otherwise, we invoke the MCP tool you provided in --permission-prompt-tool The --permission-prompt-tool MCP tool is passed the tool name and input, and must return a JSON-stringified payload with the result. The payload must be one of: { \"behavior\" : \"allow\" , \"updatedInput\" : { ... } , } { \"behavior\" : \"deny\" , \"message\" : \"...\" } For example, a TypeScript MCP permission prompt tool implementation might look like this: const server = new McpServer ( { name : \"Test permission prompt MCP Server\" , version : \"0.0.1\" , } ) ; server . tool ( \"approval_prompt\" , 'Simulate a permission check - approve if the input contains \"allow\", otherwise deny' , { tool_name : z . string ( ) . describe ( \"The tool requesting permission\" ) , input : z . object ( { } ) . passthrough ( ) . describe ( \"The input for the tool\" ) , } , async ( { tool_name , input } ) => { return { content : [ { type : \"text\" , text : JSON . stringify ( JSON . stringify ( input ) . includes ( \"allow\" ) ? { behavior : \"allow\" , updatedInput : input , } : { behavior : \"deny\" , message : \"Permission denied by test approval_prompt tool\" , } ) , } , ] , } ; } ) ; To use this tool, add your MCP server (eg. with --mcp-config ), then invoke the SDK like so: claude -p \"...\"  --permission-prompt-tool mcp__test-server__approval_prompt  --mcp-config my-config.json Usage notes: Use updatedInput to tell the model that the permission prompt mutated its input; otherwise, set updatedInput to the original input, as in the example above. For example, if the tool shows a file edit diff to the user and lets them edit the diff manually, the permission prompt tool should return that updated edit. The payload must be JSON-stringified  Available CLI options The SDK leverages all the CLI options available in Claude Code. Here are the key ones for SDK usage: Flag Description Example --print , -p Run in non-interactive mode claude -p \"query\" --output-format Specify output format ( text , json , stream-json ) claude -p --output-format json --resume , -r Resume a conversation by session ID claude --resume abc123 --continue , -c Continue the most recent conversation claude --continue --verbose Enable verbose logging claude --verbose --max-turns Limit agentic turns in non-interactive mode claude --max-turns 3 --system-prompt Override system prompt (only with --print ) claude --system-prompt \"Custom instruction\" --append-system-prompt Append to system prompt (only with --print ) claude --append-system-prompt \"Custom instruction\" --allowedTools Space-separated list of allowed tools, or string of comma-separated list of allowed tools claude --allowedTools mcp__slack mcp__filesystem claude --allowedTools \"Bash(npm install),mcp__filesystem\" --disallowedTools Space-separated list of denied tools, or string of comma-separated list of denied tools claude --disallowedTools mcp__splunk mcp__github claude --disallowedTools \"Bash(git commit),mcp__github\" --mcp-config Load MCP servers from a JSON file claude --mcp-config servers.json --permission-prompt-tool MCP tool for handling permission prompts (only with --print ) claude --permission-prompt-tool mcp__auth__prompt For a complete list of CLI options and features, see the CLI reference documentation.  Output formats The SDK supports multiple output formats:  Text output (default) Returns just the response text: $ claude -p \"Explain file src/components/Header.tsx\"  JSON output Returns structured data including metadata: $ claude -p \"How does the data layer work?\" --output-format json Response format: { \"type\" : \"result\" , \"subtype\" : \"success\" , \"total_cost_usd\" : 0.003 , \"is_error\" : false , \"duration_ms\" : 1234 , \"duration_api_ms\" : 800 , \"num_turns\" : 6 , \"result\" : \"The response text here...\" , \"session_id\" : \"abc123\" }  Streaming JSON output Streams each message as it is received: $ claude -p \"Build an application\" --output-format stream-json Each conversation begins with an initial init system message, followed by a list of user and assistant messages, followed by a final result system message with stats. Each message is emitted as a separate JSON object.  Message schema Messages returned from the JSON API are strictly typed according to the following schema: type SDKMessage = | { type : \"assistant\" ; message : Message ; session_id : string ; } | { type : \"user\" ; message : MessageParam ; session_id : string ; } | { type : \"result\" ; subtype : \"success\" ; duration_ms : float ; duration_api_ms : float ; is_error : boolean ; num_turns : int ; result : string ; session_id : string ; total_cost_usd : float ; } | { type : \"result\" ; subtype : \"error_max_turns\" | \"error_during_execution\" ; duration_ms : float ; duration_api_ms : float ; is_error : boolean ; num_turns : int ; session_id : string ; total_cost_usd : float ; } | { type : \"system\" ; subtype : \"init\" ; apiKeySource : string ; cwd : string ; session_id : string ; tools : string [ ] ; mcp_servers : { name : string ; status : string ; } [ ] ; model : string ; permissionMode : \"default\" | \"acceptEdits\" | \"bypassPermissions\" | \"plan\" ; } ; We will soon publish these types in a JSONSchema-compatible format. We use semantic versioning for the main Claude Code package to communicate breaking changes to this format. Message and MessageParam types are available in Anthropic SDKs. For example, see the Anthropic TypeScript and Python SDKs.  Input formats The SDK supports multiple input formats:  Text input (default) Input text can be provided as an argument: $ claude -p \"Explain this code\" Or input text can be piped via stdin: $ echo \"Explain this code\" | claude -p  Streaming JSON input A stream of messages provided via stdin where each message represents a user turn. This allows multiple turns of a conversation without re-launching the claude binary and allows providing guidance to the model while it is processing a request. Each message is a JSON User message object, following the same format as the output message schema. Messages are formatted using the jsonl format where each line of input is a complete JSON object. Streaming JSON input requires -p and --output-format stream-json . Currently this is limited to text-only user messages. $ echo '{\"type\":\"user\",\"message\":{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"Explain this code\"}]}}' | claude -p --output-format = stream-json --input-format = stream-json --verbose  Examples  Simple script integration #!/bin/bash run_claude ( ) { local prompt = \" $1 \" local output_format = \" ${2 :- text} \" if claude -p \" $prompt \" --output-format \" $output_format \" ; then echo \"Success!\" else echo \"Error: Claude failed with exit code $? \" > &2 return 1 fi } run_claude \"Write a Python function to read CSV files\" run_claude \"Optimize this database query\" \"json\"  Processing files with Claude $ cat mycode.py | claude -p \"Review this code for bugs\" $ for file in *.js ; do echo \"Processing $file ...\" claude -p \"Add JSDoc comments to this file:\" < \" $file \" > \" ${file} .documented\" done $ grep -l \"TODO\" *.py | while read file ; do claude -p \"Fix all TODO items in this file\" < \" $file \" done  Session management $ claude -p \"Initialize a new project\" --output-format json | jq -r '.session_id' > session.txt $ claude -p --resume \" $( cat session.txt ) \" \"Add unit tests\"  Best practices Use JSON output format for programmatic parsing of responses: result = $( claude -p \"Generate code\" --output-format json ) code = $( echo \" $result \" | jq -r '.result' ) cost = $( echo \" $result \" | jq -r '.cost_usd' ) Handle errors gracefully - check exit codes and stderr: if ! claude -p \" $prompt \" 2 > error.log ; then echo \"Error occurred:\" > &2 cat error.log > &2 exit 1 fi Use session management for maintaining context in multi-turn conversations Consider timeouts for long-running operations: timeout 300 claude -p \" $complex_prompt \" || echo \"Timed out after 5 minutes\" Respect rate limits when making multiple requests by adding delays between calls  Real-world applications The Claude Code SDK enables powerful integrations with your development workflow. One notable example is the Claude Code GitHub Actions , which uses the SDK to provide automated code review, PR creation, and issue triage capabilities directly in your GitHub workflow.  Related resources CLI usage and controls - Complete CLI documentation GitHub Actions integration - Automate your GitHub workflow with Claude Common workflows - Step-by-step guides for common use cases Was this page helpful? Yes No GitHub Actions Troubleshooting On this page Authentication Basic SDK usage Command line TypeScript Python Advanced usage Multi-turn conversations Custom system prompts MCP Configuration Custom permission prompt tool Available CLI options Output formats Text output (default) JSON output Streaming JSON output Message schema Input formats Text input (default) Streaming JSON input Examples Simple script integration Processing files with Claude Session management Best practices Real-world applications Related resources",77    "title": "Claude Code SDK - Anthropic",78    "url": "https://docs.anthropic.com/en/docs/claude-code/sdk",79    "word_count": 2461,80    "char_count": 1562381  },82  {83    "chunk_id": 1,84    "text": "Anthropic home page English Search... Search... Navigation Administration Manage costs effectively Welcome Developer Guide API Guide Claude Code Model Context Protocol (MCP) Resources Release Notes Documentation Developer Discord Support Getting started Overview Set up Quickstart Memory management Common workflows Build with Claude Add Claude Code to your IDE Model Context Protocol (MCP) GitHub Actions Claude Code SDK Troubleshooting Deployment Overview Amazon Bedrock Google Vertex AI Corporate proxy LLM gateway Development containers Administration Identity and Access Management Security Monitoring Costs Reference CLI reference Interactive mode Slash commands Settings Resources Data usage Legal and compliance Claude Code consumes tokens for each interaction. The average cost is $6 per developer per day, with daily costs remaining below $12 for 90% of users. For team usage, Claude Code charges by API token consumption. On average, Claude Code costs ~$50-60/developer per month with Sonnet 4 though there is large variance depending on how many instances users are running and whether theyre using it in automation.  Track your costs Use /cost to see current session usage Anthropic Console users : Check historical usage in the Anthropic Console (requires Admin or Billing role) Set workspace spend limits for the Claude Code workspace (requires Admin role) Pro and Max plan users : Usage is included in your subscription  Managing costs for teams When using Anthropic API, you can limit the total Claude Code workspace spend. To configure, follow these instructions . Admins can view cost and usage reporting by following these instructions . On Bedrock and Vertex, Claude Code does not send metrics from your cloud. In order to get cost metrics, several large enterprises reported using LiteLLM , which is an open-source tool that helps companies track spend by key . This project is unaffiliated with Anthropic and we have not audited its security.  Reduce token usage Compact conversations: Claude uses auto-compact by default when context exceeds 95% capacity Toggle auto-compact: Run /config and navigate to Auto-compact enabled Use /compact manually when context gets large Add custom instructions: /compact Focus on code samples and API usage Customize compaction by adding to CLAUDE.md: # Summary instructions When you are using compact, please focus on test output and code changes Write specific queries: Avoid vague requests that trigger unnecessary scanning Break down complex tasks: Split large tasks into focused interactions Clear history between tasks: Use /clear to reset context Costs can vary significantly based on: Size of codebase being analyzed Complexity of queries Number of files being searched or modified Length of conversation history Frequency of compacting conversations Background processes (haiku generation, conversation summarization)  Background token usage Claude Code uses tokens for some background functionality even when idle: Haiku generation : Small creative messages that appear while you type (approximately 1 cent per day) Conversation summarization : Background jobs that summarize previous conversations for the claude --resume feature Command processing : Some commands like /cost may generate requests to check status These background processes consume a small amount of tokens (typically under $0.04 per session) even without active interaction. For team deployments, we recommend starting with a small pilot group to establish usage patterns before wider rollout. Was this page helpful? Yes No Monitoring CLI reference On this page Track your costs Managing costs for teams Reduce token usage Background token usage",85    "title": "Manage costs effectively - Anthropic",86    "url": "https://docs.anthropic.com/en/docs/claude-code/costs",87    "word_count": 543,88    "char_count": 368289  },90  {91    "chunk_id": 1,92    "text": "Anthropic home page English Search... Search... Navigation Deployment Claude Code on Google Vertex AI Welcome Developer Guide API Guide Claude Code Model Context Protocol (MCP) Resources Release Notes Documentation Developer Discord Support Getting started Overview Set up Quickstart Memory management Common workflows Build with Claude Add Claude Code to your IDE Model Context Protocol (MCP) GitHub Actions Claude Code SDK Troubleshooting Deployment Overview Amazon Bedrock Google Vertex AI Corporate proxy LLM gateway Development containers Administration Identity and Access Management Security Monitoring Costs Reference CLI reference Interactive mode Slash commands Settings Resources Data usage Legal and compliance  Prerequisites Before configuring Claude Code with Vertex AI, ensure you have: A Google Cloud Platform (GCP) account with billing enabled A GCP project with Vertex AI API enabled Access to desired Claude models (e.g., Claude Sonnet 4) Google Cloud SDK ( gcloud ) installed and configured Quota allocated in desired GCP region Vertex AI may not support the Claude Code default models on non- us-east5 regions. Ensure you are using us-east5 and have quota allocated, or switch to supported models.  Setup  1. Enable Vertex AI API Enable the Vertex AI API in your GCP project: gcloud config set project YOUR-PROJECT-ID gcloud services enable aiplatform.googleapis.com  2. Request model access Request access to Claude models in Vertex AI: Navigate to the Vertex AI Model Garden Search for Claude models Request access to desired Claude models (e.g., Claude Sonnet 4) Wait for approval (may take 24-48 hours)  3. Configure GCP credentials Claude Code uses standard Google Cloud authentication. For more information, see Google Cloud authentication documentation .  4. Configure Claude Code Set the following environment variables: export CLAUDE_CODE_USE_VERTEX = 1 export CLOUD_ML_REGION = us-east5 export ANTHROPIC_VERTEX_PROJECT_ID = YOUR-PROJECT-ID export DISABLE_PROMPT_CACHING = 1 For heightened rate limits and prompt caching enablement, contact Google Cloud support. Once enabled, remove the DISABLE_PROMPT_CACHING setting.  5. Model configuration Claude Code uses these default models for Vertex AI: Model type Default value Primary model claude-sonnet-4@20250514 Small/fast model claude-3-5-haiku@20241022 To customize models: export ANTHROPIC_MODEL = 'claude-opus-4@20250514' export ANTHROPIC_SMALL_FAST_MODEL = 'claude-3-5-haiku@20241022'  IAM configuration Grant the required IAM roles for Claude Code. For details, see Vertex IAM documentation . We recommend creating a dedicated GCP project for Claude Code to simplify cost tracking and access control.  Troubleshooting If you encounter quota issues: Check current quotas or request quota increase through Cloud Console If you encounter model not found 404 errors: Verify you have access to the specified region Confirm model is Enabled in Model Garden If you encounter 429 errors: Ensure the primary model and small/fast model are supported in your selected region  Additional resources Vertex AI documentation Vertex AI pricing Vertex AI quotas and limits Was this page helpful? Yes No Amazon Bedrock Corporate proxy On this page Prerequisites Setup 1. Enable Vertex AI API 2. Request model access 3. Configure GCP credentials 4. Configure Claude Code 5. Model configuration IAM configuration Troubleshooting Additional resources",93    "title": "Claude Code on Google Vertex AI - Anthropic",94    "url": "https://docs.anthropic.com/en/docs/claude-code/google-vertex-ai",95    "word_count": 480,96    "char_count": 341497  },98  {99    "chunk_id": 1,100    "text": "Anthropic home page English Search... Search... Navigation Getting started Manage Claude's memory Welcome Developer Guide API Guide Claude Code Model Context Protocol (MCP) Resources Release Notes Documentation Developer Discord Support Getting started Overview Set up Quickstart Memory management Common workflows Build with Claude Add Claude Code to your IDE Model Context Protocol (MCP) GitHub Actions Claude Code SDK Troubleshooting Deployment Overview Amazon Bedrock Google Vertex AI Corporate proxy LLM gateway Development containers Administration Identity and Access Management Security Monitoring Costs Reference CLI reference Interactive mode Slash commands Settings Resources Data usage Legal and compliance Claude Code can remember your preferences across sessions, like style guidelines and common commands in your workflow.  Determine memory type Claude Code offers three memory locations, each serving a different purpose: Memory Type Location Purpose Use Case Examples Project memory ./CLAUDE.md Team-shared instructions for the project Project architecture, coding standards, common workflows User memory ~/.claude/CLAUDE.md Personal preferences for all projects Code styling preferences, personal tooling shortcuts Project memory (local) ./CLAUDE.local.md Personal project-specific preferences (Deprecated, see below) Your sandbox URLs, preferred test data All memory files are automatically loaded into Claude Codes context when launched.  CLAUDE.md imports CLAUDE.md files can import additional files using @path/to/import syntax. The following example imports 3 files: See @README for project overview and @package.json for available npm commands for this project. # Additional Instructions - git workflow @docs/git-instructions.md Both relative and absolute paths are allowed. In particular, importing files in users home dir is a convenient way for your team members to provide individual instructions that are not checked into the repository. Previously CLAUDE.local.md served a similar purpose, but is now deprecated in favor of imports since they work better across multiple git worktrees. # Individual Preferences - @~/.claude/my-project-instructions.md To avoid potential collisions, imports are not evaluated inside markdown code spans and code blocks. This code span will not be treated as an import: `@anthropic-ai/claude-code` Imported files can recursively import additional files, with a max-depth of 5 hops. You can see what memory files are loaded by running /memory command.  How Claude looks up memories Claude Code reads memories recursively: starting in the cwd, Claude Code recurses up to (but not including) the root directory / and reads any CLAUDE.md or CLAUDE.local.md files it finds. This is especially convenient when working in large repositories where you run Claude Code in foo/bar/ , and have memories in both foo/CLAUDE.md and foo/bar/CLAUDE.md . Claude will also discover CLAUDE.md nested in subtrees under your current working directory. Instead of loading them at launch, they are only included when Claude reads files in those subtrees.  Quickly add memories with the # shortcut The fastest way to add a memory is to start your input with the # character: # Always use descriptive variable names Youll be prompted to select which memory file to store this in.  Directly edit memories with /memory Use the /memory slash command during a session to open any memory file in your system editor for more extensive additions or organization.  Set up project memory Suppose you want to set up a CLAUDE.md file to store important project information, conventions, and frequently used commands. Bootstrap a CLAUDE.md for your codebase with the following command: > /init Tips: Include frequently used commands (build, test, lint) to avoid repeated searches Document code style preferences and naming conventions Add important architectural patterns specific to your project CLAUDE.md memories can be used for both instructions shared with your team and for your individual preferences.  Memory best practices Be specific : Use 2-space indentation is better than Format code properly. Use structure to organize : Format each individual memory as a bullet point and group related memories under descriptive markdown headings. Review periodically : Update memories as your project evolves to ensure Claude is always using the most up to date information and context. Was this page helpful? Yes No Quickstart Common workflows On this page Determine memory type CLAUDE.md imports How Claude looks up memories Quickly add memories with the # shortcut Directly edit memories with /memory Set up project memory Memory best practices",101    "title": "Manage Claude's memory - Anthropic",102    "url": "https://docs.anthropic.com/en/docs/claude-code/memory",103    "word_count": 677,104    "char_count": 4671105  },106  {107    "chunk_id": 1,108    "text": "Anthropic home page English Search... Search... Navigation Administration Security Welcome Developer Guide API Guide Claude Code Model Context Protocol (MCP) Resources Release Notes Documentation Developer Discord Support Getting started Overview Set up Quickstart Memory management Common workflows Build with Claude Add Claude Code to your IDE Model Context Protocol (MCP) GitHub Actions Claude Code SDK Troubleshooting Deployment Overview Amazon Bedrock Google Vertex AI Corporate proxy LLM gateway Development containers Administration Identity and Access Management Security Monitoring Costs Reference CLI reference Interactive mode Slash commands Settings Resources Data usage Legal and compliance  How we approach security  Security foundation Your codes security is paramount. Claude Code is built with security at its core, developed according to Anthropics comprehensive security program. Learn more and access resources (SOC 2 Type 2 report, ISO 27001 certificate, etc.) at Anthropic Trust Center .  Permission-based architecture Claude Code uses strict read-only permissions by default. When additional actions are needed (editing files, running tests, executing commands), Claude Code requests explicit permission. Users control whether to approve actions once or allow them automatically. We designed Claude Code to be transparent and secure. For example, we require approval for git commands before executing them, giving you direct control. This approach enables users and organizations to configure permissions directly. For detailed permission configuration, see Identity and Access Management .  Built-in protections To mitigate risks in agentic systems: Folder access restriction : Claude Code can only access the folder where it was started and its subfoldersit cannot go upstream to parent directories. This creates a clear security boundary, ensuring Claude Code only operates within the intended project scope Prompt fatigue mitigation : Support for allowlisting frequently used safe commands per-user, per-codebase, or per-organization Accept Edits mode : Batch accept multiple edits while maintaining permission prompts for commands with side effects  User responsibility Claude Code only has the permissions you grant it. Youre responsible for reviewing proposed code and commands for safety before approval.  Protect against prompt injection Prompt injection is a technique where an attacker attempts to override or manipulate an AI assistants instructions by inserting malicious text. Claude Code includes several safeguards against these attacks:  Core protections Permission system : Sensitive operations require explicit approval Context-aware analysis : Detects potentially harmful instructions by analyzing the full request Input sanitization : Prevents command injection by processing user inputs Command blocklist : Blocks risky commands that fetch arbitrary content from the web like curl and wget  Additional safeguards Network request approval : Tools that make network requests require user approval by default Isolated context windows : Web fetch uses a separate context window to avoid injecting potentially malicious prompts Trust verification : First-time codebase runs and new MCP servers require trust verification Command injection detection : Suspicious bash commands require manual approval even if previously allowlisted Fail-closed matching : Unmatched commands default to requiring manual approval Natural language descriptions : Complex bash commands include explanations for user understanding Best practices for working with untrusted content : Review suggested commands before approval Avoid piping untrusted content directly to Claude Verify proposed changes to critical files Use virtual machines (VMs) to run scripts and make tool calls, especially when interacting with external web services Report suspicious behavior with /bug While these protections significantly reduce risk, no system is completely immune to all attacks. Always maintain good security practices when working with any AI tool.  MCP security Claude Code allows users to configure Model Context Protocol (MCP) servers. The list of allowed MCP servers is configured in your source code, as part of Claude Code settings engineers check into source control. We encourage either writing your own MCP servers or using MCP servers from providers that you trust. You are able to configure Claude Code permissions for MCP servers. Anthropic does not manage or audit any MCP servers.  Security best practices  Working with sensitive code Review all suggested changes before approval Use project-specific permission settings for sensitive repositories Consider using devcontainers for additional isolation Regularly audit your permission settings with /permissions  Team security Use enterprise managed policies to enforce organizational standards Share approved permission configurations through version control Train team members on security best practices Monitor Claude Code usage through OpenTelemetry metrics  Reporting security issues If you discover a security vulnerability in Claude Code: Do not disclose it publicly Report it through our HackerOne program Include detailed reproduction steps Allow time for us to address the issue before public disclosure  Related resources Identity and Access Management - Configure permissions and access controls Monitoring usage - Track and audit Claude Code activity Development containers - Secure, isolated environments Anthropic Trust Center - Security certifications and compliance Was this page helpful? Yes No Identity and Access Management Monitoring On this page How we approach security Security foundation Permission-based architecture Built-in protections User responsibility Protect against prompt injection Core protections Additional safeguards MCP security Security best practices Working with sensitive code Team security Reporting security issues Related resources",109    "title": "Security - Anthropic",110    "url": "https://docs.anthropic.com/en/docs/claude-code/security",111    "word_count": 819,112    "char_count": 5950113  },114  {115    "chunk_id": 1,116    "text": "Anthropic home page English Search... Search... Navigation Build with Claude Add Claude Code to your IDE Welcome Developer Guide API Guide Claude Code Model Context Protocol (MCP) Resources Release Notes Documentation Developer Discord Support Getting started Overview Set up Quickstart Memory management Common workflows Build with Claude Add Claude Code to your IDE Model Context Protocol (MCP) GitHub Actions Claude Code SDK Troubleshooting Deployment Overview Amazon Bedrock Google Vertex AI Corporate proxy LLM gateway Development containers Administration Identity and Access Management Security Monitoring Costs Reference CLI reference Interactive mode Slash commands Settings Resources Data usage Legal and compliance Claude Code seamlessly integrates with popular Integrated Development Environments (IDEs) to enhance your coding workflow. This integration allows you to leverage Claudes capabilities directly within your preferred development environment.  Supported IDEs Claude Code currently supports two major IDE families: Visual Studio Code (including popular forks like Cursor and Windsurf) JetBrains IDEs (including PyCharm, WebStorm, IntelliJ, and GoLand)  Features Quick launch : Use Cmd+Esc (Mac) or Ctrl+Esc (Windows/Linux) to open Claude Code directly from your editor, or click the Claude Code button in the UI Diff viewing : Code changes can be displayed directly in the IDE diff viewer instead of the terminal. You can configure this in /config Selection context : The current selection/tab in the IDE is automatically shared with Claude Code File reference shortcuts : Use Cmd+Option+K (Mac) or Alt+Ctrl+K (Linux/Windows) to insert file references (e.g., @File#L1-99) Diagnostic sharing : Diagnostic errors (lint, syntax, etc.) from the IDE are automatically shared with Claude as you work  Installation  VS Code Open VSCode Open the integrated terminal Run claude - the extension will auto-install Going forward you can also use the /ide command in any external terminal to connect to the IDE. These installation instructions also apply to VS Code forks like Cursor and Windsurf.  JetBrains IDEs Install the Claude Code plugin from the marketplace and restart your IDE. The plugin may also be auto-installed when you run claude in the integrated terminal. The IDE must be restarted completely to take effect. Remote Development Limitations : When using JetBrains Remote Development, you must install the plugin in the remote host via Settings > Plugin (Host) .  Configuration Both integrations work with Claude Codes configuration system. To enable IDE-specific features: Connect Claude Code to your IDE by running claude in the built-in terminal Run the /config command Set the diff tool to auto for automatic IDE detection Claude Code will automatically use the appropriate viewer based on your IDE If youre using an external terminal (not the IDEs built-in terminal), you can still connect to your IDE by using the /ide command after launching Claude Code. This allows you to benefit from IDE integration features even when running Claude from a separate terminal application. This works for both VS Code and JetBrains IDEs. When using an external terminal, to ensure Claude has default access to the same files as your IDE, start Claude from the same directory as your IDE project root.  Troubleshooting  VS Code extension not installing Ensure youre running Claude Code from VS Codes integrated terminal Ensure that the CLI corresponding to your IDE is installed: For VS Code: code command should be available For Cursor: cursor command should be available For Windsurf: windsurf command should be available If not installed, use Cmd+Shift+P (Mac) or Ctrl+Shift+P (Windows/Linux) and search for Shell Command: Install code command in PATH (or the equivalent for your IDE) Check that VS Code has permission to install extensions  JetBrains plugin not working Ensure youre running Claude Code from the project root directory Check that the JetBrains plugin is enabled in the IDE settings Completely restart the IDE. You may need to do this multiple times For JetBrains Remote Development, ensure that the Claude Code plugin is installed in the remote host and not locally on the client For additional help, refer to our troubleshooting guide or reach out to support. Was this page helpful? Yes No Common workflows Model Context Protocol (MCP) On this page Supported IDEs Features Installation VS Code JetBrains IDEs Configuration Troubleshooting VS Code extension not installing JetBrains plugin not working",117    "title": "Add Claude Code to your IDE - Anthropic",118    "url": "https://docs.anthropic.com/en/docs/claude-code/ide-integrations",119    "word_count": 687,120    "char_count": 4537121  },122  {123    "chunk_id": 1,124    "text": "Anthropic home page English Search... Search... Navigation Deployment Development containers Welcome Developer Guide API Guide Claude Code Model Context Protocol (MCP) Resources Release Notes Documentation Developer Discord Support Getting started Overview Set up Quickstart Memory management Common workflows Build with Claude Add Claude Code to your IDE Model Context Protocol (MCP) GitHub Actions Claude Code SDK Troubleshooting Deployment Overview Amazon Bedrock Google Vertex AI Corporate proxy LLM gateway Development containers Administration Identity and Access Management Security Monitoring Costs Reference CLI reference Interactive mode Slash commands Settings Resources Data usage Legal and compliance The preconfigured devcontainer setup works seamlessly with VS Codes Remote - Containers extension and similar tools. The containers enhanced security measures (isolation and firewall rules) allow you to run claude --dangerously-skip-permissions to bypass permission prompts for unattended operation. Weve included a reference implementation that you can customize for your needs. While the devcontainer provides substantial protections, no system is completely immune to all attacks. Always maintain good security practices and monitor Claudes activities.  Key features Production-ready Node.js : Built on Node.js 20 with essential development dependencies Security by design : Custom firewall restricting network access to only necessary services Developer-friendly tools : Includes git, ZSH with productivity enhancements, fzf, and more Seamless VS Code integration : Pre-configured extensions and optimized settings Session persistence : Preserves command history and configurations between container restarts Works everywhere : Compatible with macOS, Windows, and Linux development environments  Getting started in 4 steps Install VS Code and the Remote - Containers extension Clone the Claude Code reference implementation repository Open the repository in VS Code When prompted, click Reopen in Container (or use Command Palette: Cmd+Shift+P  Remote-Containers: Reopen in Container)  Configuration breakdown The devcontainer setup consists of three primary components: devcontainer.json : Controls container settings, extensions, and volume mounts Dockerfile : Defines the container image and installed tools init-firewall.sh : Establishes network security rules  Security features The container implements a multi-layered security approach with its firewall configuration: Precise access control : Restricts outbound connections to whitelisted domains only (npm registry, GitHub, Anthropic API, etc.) Default-deny policy : Blocks all other external network access Startup verification : Validates firewall rules when the container initializes Isolation : Creates a secure development environment separated from your main system  Customization options The devcontainer configuration is designed to be adaptable to your needs: Add or remove VS Code extensions based on your workflow Modify resource allocations for different hardware environments Adjust network access permissions Customize shell configurations and developer tooling  Example use cases  Secure client work Use devcontainers to isolate different client projects, ensuring code and credentials never mix between environments.  Team onboarding New team members can get a fully configured development environment in minutes, with all necessary tools and settings pre-installed.  Consistent CI/CD environments Mirror your devcontainer configuration in CI/CD pipelines to ensure development and production environments match.  Related resources VS Code devcontainers documentation Claude Code security best practices Corporate proxy configuration Was this page helpful? Yes No LLM gateway Identity and Access Management On this page Key features Getting started in 4 steps Configuration breakdown Security features Customization options Example use cases Secure client work Team onboarding Consistent CI/CD environments Related resources",125    "title": "Development containers - Anthropic",126    "url": "https://docs.anthropic.com/en/docs/claude-code/devcontainer",127    "word_count": 526,128    "char_count": 4017129  },130  {131    "chunk_id": 1,132    "text": "Anthropic home page English Search... Search... Navigation Administration Identity and Access Management Welcome Developer Guide API Guide Claude Code Model Context Protocol (MCP) Resources Release Notes Documentation Developer Discord Support Getting started Overview Set up Quickstart Memory management Common workflows Build with Claude Add Claude Code to your IDE Model Context Protocol (MCP) GitHub Actions Claude Code SDK Troubleshooting Deployment Overview Amazon Bedrock Google Vertex AI Corporate proxy LLM gateway Development containers Administration Identity and Access Management Security Monitoring Costs Reference CLI reference Interactive mode Slash commands Settings Resources Data usage Legal and compliance  Authentication methods Setting up Claude Code requires access to Anthropic models. For teams, you can set up Claude Code access in one of three ways: Anthropic API via the Anthropic Console Amazon Bedrock Google Vertex AI  Anthropic API authentication To set up Claude Code access for your team via Anthropic API: Use your existing Anthropic Console account or create a new Anthropic Console account You can add users through either method below: Bulk invite users from within the Console (Console -> Settings -> Members -> Invite) Set up SSO When inviting users, they need one of the following roles: Claude Code role means users can only create Claude Code API keys Developer role means users can create any kind of API key Each invited user needs to complete these steps: Accept the Console invite Check system requirements Install Claude Code Login with Console account credentials  Cloud provider authentication To set up Claude Code access for your team via Bedrock or Vertex: Follow the Bedrock docs or Vertex docs Distribute the environment variables and instructions for generating cloud credentials to your users. Read more about how to manage configuration here . Users can install Claude Code  Access control and permissions We support fine-grained permissions so that youre able to specify exactly what the agent is allowed to do (e.g. run tests, run linter) and what it is not allowed to do (e.g. update cloud infrastructure). These permission settings can be checked into version control and distributed to all developers in your organization, as well as customized by individual developers.  Permission system Claude Code uses a tiered permission system to balance power and safety: Tool Type Example Approval Required Yes, dont ask again Behavior Read-only File reads, LS, Grep No N/A Bash Commands Shell execution Yes Permanently per project directory and command File Modification Edit/write files Yes Until session end  Configuring permissions You can view & manage Claude Codes tool permissions with /permissions . This UI lists all permission rules and the settings.json file they are sourced from. Allow rules will allow Claude Code to use the specified tool without further manual approval. Deny rules will prevent Claude Code from using the specified tool. Deny rules take precedence over allow rules. Additional directories extend Claudes file access to directories beyond the initial working directory. Default mode controls Claudes permission behavior when encountering new requests. Permission rules use the format: Tool(optional-specifier) A rule that is just the tool name matches any use of that tool. For example, adding Bash to the list of allow rules would allow Claude Code to use the Bash tool without requiring user approval.  Permission modes Claude Code supports several permission modes that can be set as the defaultMode in settings files : Mode Description default Standard behavior - prompts for permission on first use of each tool acceptEdits Automatically accepts file edit permissions for the session plan Plan mode - Claude can analyze but not modify files or execute commands bypassPermissions Skips all permission prompts (requires safe environment - see warning below)  Working directories By default, Claude has access to files in the directory where it was launched. You can extend this access: During startup : Use --add-dir <path> CLI argument During session : Use /add-dir slash command Persistent configuration : Add to additionalDirectories in settings files Files in additional directories follow the same permission rules as the original working directory - they become readable without prompts, and file editing permissions follow the current permission mode.  Tool-specific permission rules Some tools use the optional specifier for more fine-grained permission controls. For example, an allow rule with Bash(git diff:*) would allow Bash commands that start with git diff . The following tools support permission rules with specifiers: Bash Bash(npm run build) Matches the exact Bash command npm run build Bash(npm run test:*) Matches Bash commands starting with npm run test . Claude Code is aware of shell operators (like && ) so a prefix match rule like Bash(safe-cmd:*) wont give it permission to run the command safe-cmd && other-cmd Read & Edit Edit rules apply to all built-in tools that edit files. Claude will make a best-effort attempt to apply Read rules to all built-in tools that read files like Grep, Glob, and LS. Read & Edit rules both follow the gitignore specification. Patterns are resolved relative to the directory containing .claude/settings.json . To reference an absolute path, use // . For a path relative to your home directory, use ~/ . Edit(docs/**) Matches edits to files in the docs directory of your project Read(~/.zshrc) Matches reads to your ~/.zshrc file Edit(//tmp/scratch.txt) Matches edits to /tmp/scratch.txt WebFetch WebFetch(domain:example.com) Matches fetch requests to example.com MCP mcp__puppeteer Matches any tool provided by the puppeteer server (name configured in Claude Code) mcp__puppeteer__puppeteer_navigate Matches the puppeteer_navigate tool provided by the puppeteer server  Enterprise managed policy settings For enterprise deployments of Claude Code, we support enterprise managed policy settings that take precedence over user and project settings. This allows system administrators to enforce security policies that users cannot override. System administrators can deploy policies to: macOS : /Library/Application Support/ClaudeCode/managed-settings.json Linux and Windows (via WSL) : /etc/claude-code/managed-settings.json These policy files follow the same format as regular settings files but cannot be overridden by user or project settings. This ensures consistent security policies across your organization.  Settings precedence When multiple settings sources exist, they are applied in the following order (highest to lowest precedence): Enterprise policies Command line arguments Local project settings ( .claude/settings.local.json ) Shared project settings ( .claude/settings.json ) User settings ( ~/.claude/settings.json ) This hierarchy ensures that organizational policies are always enforced while still allowing flexibility at the project and user levels where appropriate.  Credential management Claude Code supports authentication via Claude.ai credentials, Anthropic API credentials, Bedrock Auth, and Vertex Auth. On macOS, the API keys, OAuth tokens, and other credentials are stored on encrypted macOS Keychain. Alternately, the setting apiKeyHelper can be set to a shell script which returns an API key. By default, this helper is called after 5 minutes or on HTTP 401 response; specifying environment variable CLAUDE_CODE_API_KEY_HELPER_TTL_MS defines a custom refresh interval. Was this page helpful? Yes No Development containers Security On this page Authentication methods Anthropic API authentication Cloud provider authentication Access control and permissions Permission system Configuring permissions Permission modes Working directories Tool-specific permission rules Enterprise managed policy settings Settings precedence Credential management",133    "title": "Identity and Access Management - Anthropic",134    "url": "https://docs.anthropic.com/en/docs/claude-code/iam",135    "word_count": 1150,136    "char_count": 7927137  },138  {139    "chunk_id": 1,140    "text": "Anthropic home page English Search... Search... Navigation Build with Claude Model Context Protocol (MCP) Welcome Developer Guide API Guide Claude Code Model Context Protocol (MCP) Resources Release Notes Documentation Developer Discord Support Getting started Overview Set up Quickstart Memory management Common workflows Build with Claude Add Claude Code to your IDE Model Context Protocol (MCP) GitHub Actions Claude Code SDK Troubleshooting Deployment Overview Amazon Bedrock Google Vertex AI Corporate proxy LLM gateway Development containers Administration Identity and Access Management Security Monitoring Costs Reference CLI reference Interactive mode Slash commands Settings Resources Data usage Legal and compliance Model Context Protocol (MCP) is an open protocol that enables LLMs to access external tools and data sources. For more details about MCP, see the MCP documentation . Use third party MCP servers at your own risk. Make sure you trust the MCP servers, and be especially careful when using MCP servers that talk to the internet, as these can expose you to prompt injection risk.  Configure MCP servers 1 Add an MCP stdio Server claude mcp add < name > < command > [ args .. . ] claude mcp add my-server -e API_KEY = 123 -- /path/to/server arg1 arg2 2 Add an MCP SSE Server claude mcp add --transport sse < name > < url > claude mcp add --transport sse sse-server https://example.com/sse-endpoint claude mcp add --transport sse api-server https://api.example.com/mcp --header \"X-API-Key: your-key\" 3 Add an MCP HTTP Server claude mcp add --transport http < name > < url > claude mcp add --transport http http-server https://example.com/mcp claude mcp add --transport http secure-server https://api.example.com/mcp --header \"Authorization: Bearer your-token\" 4 Manage your MCP servers claude mcp list claude mcp get my-server claude mcp remove my-server Tips: Use the -s or --scope flag to specify where the configuration is stored: local (default): Available only to you in the current project (was called project in older versions) project : Shared with everyone in the project via .mcp.json file user : Available to you across all projects (was called global in older versions) Set environment variables with -e or --env flags (e.g., -e KEY=value ) Configure MCP server startup timeout using the MCP_TIMEOUT environment variable (e.g., MCP_TIMEOUT=10000 claude sets a 10-second timeout) Check MCP server status any time using the /mcp command within Claude Code MCP follows a client-server architecture where Claude Code (the client) can connect to multiple specialized servers Claude Code supports SSE (Server-Sent Events) and streamable HTTP servers for real-time communication Use /mcp to authenticate with remote servers that require OAuth 2.0 authentication  Understanding MCP server scopes MCP servers can be configured at three different scope levels, each serving distinct purposes for managing server accessibility and sharing. Understanding these scopes helps you determine the best way to configure servers for your specific needs.  Scope hierarchy and precedence MCP server configurations follow a clear precedence hierarchy. When servers with the same name exist at multiple scopes, the system resolves conflicts by prioritizing local-scoped servers first, followed by project-scoped servers, and finally user-scoped servers. This design ensures that personal configurations can override shared ones when needed.  Local scope Local-scoped servers represent the default configuration level and are stored in your project-specific user settings. These servers remain private to you and are only accessible when working within the current project directory. This scope is ideal for personal development servers, experimental configurations, or servers containing sensitive credentials that shouldnt be shared. claude mcp add my-private-server /path/to/server claude mcp add my-private-server -s local /path/to/server  Project scope Project-scoped servers enable team collaboration by storing configurations in a .mcp.json file at your projects root directory. This file is designed to be checked into version control, ensuring all team members have access to the same MCP tools and services. When you add a project-scoped server, Claude Code automatically creates or updates this file with the appropriate configuration structure. claude mcp add shared-server -s project /path/to/server The resulting .mcp.json file follows a standardized format: { \"mcpServers\" : { \"shared-server\" : { \"command\" : \"/path/to/server\" , \"args\" : [ ] , \"env\" : { } } } } For security reasons, Claude Code prompts for approval before using project-scoped servers from .mcp.json files. If you need to reset these approval choices, use the claude mcp reset-project-choices command.  User scope User-scoped servers provide cross-project accessibility, making them available across all projects on your machine while remaining private to your user account. This scope works well for personal utility servers, development tools, or services you frequently use across different projects. claude mcp add my-user-server -s user /path/to/server  Choosing the right scope Select your scope based on: Local scope : Personal servers, experimental configurations, or sensitive credentials specific to one project Project scope : Team-shared servers, project-specific tools, or services required for collaboration User scope : Personal utilities needed across multiple projects, development tools, or frequently-used services  Authenticate with remote MCP servers Many remote MCP servers require authentication. Claude Code supports OAuth 2.0 authentication flow for secure connection to these servers. 1 Add a remote server requiring authentication claude mcp add --transport sse github-server https://api.github.com/mcp 2 Authenticate using the /mcp command Within Claude Code, use the /mcp command to manage authentication: > /mcp This opens an interactive menu where you can: View connection status for all servers Authenticate with servers requiring OAuth Clear existing authentication View server capabilities 3 Complete the OAuth flow When you select Authenticate for a server: Your browser opens automatically to the OAuth provider Complete the authentication in your browser Claude Code receives and securely stores the access token The server connection becomes active Tips: Authentication tokens are stored securely and refreshed automatically Use Clear authentication in the /mcp menu to revoke access If your browser doesnt open automatically, copy the provided URL OAuth authentication works with both SSE and HTTP transports  Connect to a Postgres MCP server Suppose you want to give Claude read-only access to a PostgreSQL database for querying and schema inspection. 1 Add the Postgres MCP server claude mcp add postgres-server /path/to/postgres-mcp-server --connection-string \"postgresql://user:pass@localhost:5432/mydb\" 2 Query your database with Claude > describe the schema of our users table > what are the most recent orders in the system? > show me the relationship between customers and invoices Tips: The Postgres MCP server provides read-only access for safety Claude can help you explore database structure and run analytical queries You can use this to quickly understand database schemas in unfamiliar projects Make sure your connection string uses appropriate credentials with minimum required permissions  Add MCP servers from JSON configuration Suppose you have a JSON configuration for a single MCP server that you want to add to Claude Code. 1 Add an MCP server from JSON claude mcp add-json < name > '<json>' claude mcp add-json weather-api '{\"type\":\"stdio\",\"command\":\"/path/to/weather-cli\",\"args\":[\"--api-key\",\"abc123\"],\"env\":{\"CACHE_DIR\":\"/tmp\"}}' 2 Verify the server was added claude mcp get weather-api Tips: Make sure the JSON is properly escaped in your shell The JSON must conform to the MCP server configuration schema You can use -s global to add the server to your global configuration instead of the project-specific one  Import MCP servers from Claude Desktop Suppose you have already configured MCP servers in Claude Desktop and want to use the same servers in Claude Code without manually reconfiguring them. 1 Import servers from Claude Desktop claude mcp add-from-claude-desktop 2 Select which servers to import After running the command, youll see an interactive dialog that allows you to select which servers you want to import. 3 Verify the servers were imported claude mcp list Tips: This feature only works on macOS and Windows Subsystem for Linux (WSL) It reads the Claude Desktop configuration file from its standard location on those platforms Use the -s global flag to add servers to your global configuration Imported servers will have the same names as in Claude Desktop If servers with the same names already exist, they will get a numerical suffix (e.g., server_1 )  Use Claude Code as an MCP server Suppose you want to use Claude Code itself as an MCP server that other applications can connect to, providing them with Claudes tools and capabilities. 1 Start Claude as an MCP server claude mcp serve 2 Connect from another application You can connect to Claude Code MCP server from any MCP client, such as Claude Desktop. If youre using Claude Desktop, you can add the Claude Code MCP server using this configuration: { \"command\" : \"claude\" , \"args\" : [ \"mcp\" , \"serve\" ] , \"env\" : { } } Tips: The server provides access to Claudes tools like View, Edit, LS, etc. In Claude Desktop, try asking Claude to read files in a directory, make edits, and more. Note that this MCP server is simply exposing Claude Codes tools to your MCP client, so your own client is responsible for implementing user confirmation for individual tool calls.  Use MCP resources MCP servers can expose resources that you can reference using @ mentions, similar to how you reference files.  Reference MCP resources 1 List available resources Type @ in your prompt to see available resources from all connected MCP servers. Resources appear alongside files in the autocomplete menu. 2 Reference a specific resource Use the format @server:protocol://resource/path to reference a resource: > Can you analyze @github:issue://123 and suggest a fix? > Please review the API documentation at @docs:file://api/authentication 3 Multiple resource references You can reference multiple resources in a single prompt: > Compare @postgres:schema://users with @docs:file://database/user-model Tips: Resources are automatically fetched and included as attachments when referenced Resource paths are fuzzy-searchable in the @ mention autocomplete Claude Code automatically provides tools to list and read MCP resources when servers support them Resources can contain any type of content that the MCP server provides (text, JSON, structured data, etc.)  Use MCP prompts as slash commands MCP servers can expose prompts that become available as slash commands in Claude Code.  Execute MCP prompts 1 Discover available prompts Type / to see all available commands, including those from MCP servers. MCP prompts appear with the format /mcp__servername__promptname . 2 Execute a prompt without arguments > /mcp__github__list_prs 3 Execute a prompt with arguments Many prompts accept arguments. Pass them space-separated after the command: > /mcp__github__pr_review 456 > /mcp__jira__create_issue \"Bug in login flow\" high Tips: MCP prompts are dynamically discovered from connected servers Arguments are parsed based on the prompts defined parameters Prompt results are injected directly into the conversation Server and prompt names are normalized (spaces become underscores) Was this page helpful? Yes No Add Claude Code to your IDE GitHub Actions On this page Configure MCP servers Understanding MCP server scopes Scope hierarchy and precedence Local scope Project scope User scope Choosing the right scope Authenticate with remote MCP servers Connect to a Postgres MCP server Add MCP servers from JSON configuration Import MCP servers from Claude Desktop Use Claude Code as an MCP server Use MCP resources Reference MCP resources Use MCP prompts as slash commands Execute MCP prompts",141    "title": "Model Context Protocol (MCP) - Anthropic",142    "url": "https://docs.anthropic.com/en/docs/claude-code/mcp",143    "word_count": 1812,144    "char_count": 12201145  },146  {147    "chunk_id": 1,148    "text": "Anthropic home page English Search... Search... Navigation Build with Claude Claude Code GitHub Actions Welcome Developer Guide API Guide Claude Code Model Context Protocol (MCP) Resources Release Notes Documentation Developer Discord Support Getting started Overview Set up Quickstart Memory management Common workflows Build with Claude Add Claude Code to your IDE Model Context Protocol (MCP) GitHub Actions Claude Code SDK Troubleshooting Deployment Overview Amazon Bedrock Google Vertex AI Corporate proxy LLM gateway Development containers Administration Identity and Access Management Security Monitoring Costs Reference CLI reference Interactive mode Slash commands Settings Resources Data usage Legal and compliance Claude Code GitHub Actions brings AI-powered automation to your GitHub workflow. With a simple @claude mention in any PR or issue, Claude can analyze your code, create pull requests, implement features, and fix bugs - all while following your projects standards. Claude Code GitHub Actions is currently in beta. Features and functionality may evolve as we refine the experience. Claude Code GitHub Actions is built on top of the Claude Code SDK , which enables programmatic integration of Claude Code into your applications. You can use the SDK to build custom automation workflows beyond GitHub Actions.  Why use Claude Code GitHub Actions? Instant PR creation : Describe what you need, and Claude creates a complete PR with all necessary changes Automated code implementation : Turn issues into working code with a single command Follows your standards : Claude respects your CLAUDE.md guidelines and existing code patterns Simple setup : Get started in minutes with our installer and API key Secure by default : Your code stays on Githubs runners  What can Claude do? Claude Code provides powerful GitHub Actions that transform how you work with code:  Claude Code Action This GitHub Action allows you to run Claude Code within your GitHub Actions workflows. You can use this to build any custom workflow on top of Claude Code. View repository   Claude Code Action (Base) The foundation for building custom GitHub workflows with Claude. This extensible framework gives you full access to Claudes capabilities for creating tailored automation. View repository   Setup  Quick setup The easiest way to set up this action is through Claude Code in the terminal. Just open claude and run /install-github-app . This command will guide you through setting up the GitHub app and required secrets. You must be a repository admin to install the GitHub app and add secrets This quickstart method is only available for direct Anthropic API users. If youre using AWS Bedrock or Google Vertex AI, please see the Using with AWS Bedrock & Google Vertex AI section.  Manual setup If the /install-github-app command fails or you prefer manual setup, please follow these manual setup instructions: Install the Claude GitHub app to your repository: https://github.com/apps/claude Add ANTHROPIC_API_KEY to your repository secrets ( Learn how to use secrets in GitHub Actions ) Copy the workflow file from examples/claude.yml into your repositorys .github/workflows/ After completing either the quickstart or manual setup, test the action by tagging @claude in an issue or PR comment!  Example use cases Claude Code GitHub Actions can help you with a variety of tasks. For complete working examples, see the examples directory .  Turn issues into PRs In an issue comment: @claude implement this feature based on the issue description Claude will analyze the issue, write the code, and create a PR for review.  Get implementation help In a PR comment: @claude how should I implement user authentication for this endpoint? Claude will analyze your code and provide specific implementation guidance.  Fix bugs quickly In an issue: @claude fix the TypeError in the user dashboard component Claude will locate the bug, implement a fix, and create a PR.  Best practices  CLAUDE.md configuration Create a CLAUDE.md file in your repository root to define code style guidelines, review criteria, project-specific rules, and preferred patterns. This file guides Claudes understanding of your project standards.  Security considerations Never commit API keys directly to your repository! Always use GitHub Secrets for API keys: Add your API key as a repository secret named ANTHROPIC_API_KEY Reference it in workflows: anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }} Limit action permissions to only whats necessary Review Claudes suggestions before merging Always use GitHub Secrets (e.g., ${{ secrets.ANTHROPIC_API_KEY }} ) rather than hardcoding API keys directly in your workflow files.  Optimizing performance Use issue templates to provide context, keep your CLAUDE.md concise and focused, and configure appropriate timeouts for your workflows.  CI costs When using Claude Code GitHub Actions, be aware of the associated costs: GitHub Actions costs: Claude Code runs on GitHub-hosted runners, which consume your GitHub Actions minutes See GitHubs billing documentation for detailed pricing and minute limits API costs: Each Claude interaction consumes API tokens based on the length of prompts and responses Token usage varies by task complexity and codebase size See Claudes pricing page for current token rates Cost optimization tips: Use specific @claude commands to reduce unnecessary API calls Configure appropriate max_turns limits to prevent excessive iterations Set reasonable timeout_minutes to avoid runaway workflows Consider using GitHubs concurrency controls to limit parallel runs  Configuration examples For ready-to-use workflow configurations for different use cases, including: Basic workflow setup for issue and PR comments Automated code reviews on pull requests Custom implementations for specific needs Visit the examples directory in the Claude Code Action repository. The examples repository includes complete, tested workflows that you can copy directly into your .github/workflows/ directory.  Using with AWS Bedrock & Google Vertex AI For enterprise environments, you can use Claude Code GitHub Actions with your own cloud infrastructure. This approach gives you control over data residency and billing while maintaining the same functionality.  Prerequisites Before setting up Claude Code GitHub Actions with cloud providers, you need:  For Google Cloud Vertex AI: A Google Cloud Project with Vertex AI enabled Workload Identity Federation configured for GitHub Actions A service account with the required permissions A GitHub App (recommended) or use the default GITHUB_TOKEN  For AWS Bedrock: An AWS account with Amazon Bedrock enabled GitHub OIDC Identity Provider configured in AWS An IAM role with Bedrock permissions A GitHub App (recommended) or use the default GITHUB_TOKEN 1 Create a custom GitHub App (Recommended for 3P Providers) For best control and security when using 3P providers like Vertex AI or Bedrock, we recommend creating your own GitHub App: Go to https://github.com/settings/apps/new Fill in the basic information: GitHub App name : Choose a unique name (e.g., YourOrg Claude Assistant) Homepage URL : Your organizations website or the repository URL Configure the app settings: Webhooks : Uncheck Active (not needed for this integration) Set the required permissions: Repository permissions : Contents: Read & Write Issues: Read & Write Pull requests: Read & Write Click Create GitHub App After creation, click Generate a private key and save the downloaded .pem file Note your App ID from the app settings page Install the app to your repository: From your apps settings page, click Install App in the left sidebar Select your account or organization Choose Only select repositories and select the specific repository Click Install Add the private key as a secret to your repository: Go to your repositorys Settings  Secrets and variables  Actions Create a new secret named APP_PRIVATE_KEY with the contents of the .pem file Add the App ID as a secret: Create a new secret named APP_ID with your GitHub Apps ID This app will be used with the actions/create-github-app-token action to generate authentication tokens in your workflows. Alternative for Anthropic API or if you dont want to setup your own Github app : Use the official Anthropic app: Install from: https://github.com/apps/claude No additional configuration needed for authentication 2 Configure cloud provider authentication Choose your cloud provider and set up secure authentication: AWS Bedrock Configure AWS to allow GitHub Actions to authenticate securely without storing credentials. Security Note : Use repository-specific configurations and grant only the minimum required permissions. Required Setup : Enable Amazon Bedrock : Request access to Claude models in Amazon Bedrock For cross-region models, request access in all required regions Set up GitHub OIDC Identity Provider : Provider URL: https://token.actions.githubusercontent.com Audience: sts.amazonaws.com Create IAM Role for GitHub Actions : Trusted entity type: Web identity Identity provider: token.actions.githubusercontent.com Permissions: AmazonBedrockFullAccess policy Configure trust policy for your specific repository Required Values : After setup, youll need: AWS_ROLE_TO_ASSUME : The ARN of the IAM role you created OIDC is more secure than using static AWS access keys because credentials are temporary and automatically rotated. See AWS documentation for detailed OIDC setup instructions. Google Vertex AI Configure Google Cloud to allow GitHub Actions to authenticate securely without storing credentials. Security Note : Use repository-specific configurations and grant only the minimum required permissions. Required Setup : Enable APIs in your Google Cloud project: IAM Credentials API Security Token Service (STS) API Vertex AI API Create Workload Identity Federation resources : Create a Workload Identity Pool Add a GitHub OIDC provider with: Issuer: https://token.actions.githubusercontent.com Attribute mappings for repository and owner Security recommendation : Use repository-specific attribute conditions Create a Service Account : Grant only Vertex AI User role Security recommendation : Create a dedicated service account per repository Configure IAM bindings : Allow the Workload Identity Pool to impersonate the service account Security recommendation : Use repository-specific principal sets Required Values : After setup, youll need: GCP_WORKLOAD_IDENTITY_PROVIDER : The full provider resource name GCP_SERVICE_ACCOUNT : The service account email address Workload Identity Federation eliminates the need for downloadable service account keys, improving security. For detailed setup instructions, consult the Google Cloud Workload Identity Federation documentation . 3 Add Required Secrets Add the following secrets to your repository (Settings  Secrets and variables  Actions):  For Anthropic API (Direct): For API Authentication : ANTHROPIC_API_KEY : Your Anthropic API key from console.anthropic.com For GitHub App (if using your own app) : APP_ID : Your GitHub Apps ID APP_PRIVATE_KEY : The private key (.pem) content  For Google Cloud Vertex AI For GCP Authentication : GCP_WORKLOAD_IDENTITY_PROVIDER GCP_SERVICE_ACCOUNT For GitHub App (if using your own app) : APP_ID : Your GitHub Apps ID APP_PRIVATE_KEY : The private key (.pem) content  For AWS Bedrock For AWS Authentication : AWS_ROLE_TO_ASSUME For GitHub App (if using your own app) : APP_ID : Your GitHub Apps ID APP_PRIVATE_KEY : The private key (.pem) content 4 Create workflow files Create GitHub Actions workflow files that integrate with your cloud provider. The examples below show complete configurations for both AWS Bedrock and Google Vertex AI: AWS Bedrock workflow Prerequisites: AWS Bedrock access enabled with Claude model permissions GitHub configured as an OIDC identity provider in AWS IAM role with Bedrock permissions that trusts GitHub Actions Required GitHub secrets: Secret Name Description AWS_ROLE_TO_ASSUME ARN of the IAM role for Bedrock access APP_ID Your GitHub App ID (from app settings) APP_PRIVATE_KEY The private key you generated for your GitHub App name : Claude PR Action permissions : contents : write pull-requests : write issues : write id-token : write on : issue_comment : types : [ created ] pull_request_review_comment : types : [ created ] issues : types : [ opened , assigned ] jobs : claude - pr : if : | (github.event_name == 'issue_comment' && contains(github.event.comment.body , '@claude')) | | (github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body , '@claude')) | | (github.event_name == 'issues' && contains(github.event.issue.body , '@claude')) runs-on : ubuntu - latest env : AWS_REGION : us - west - 2 steps : - name : Checkout repository uses : actions/checkout@v4 - name : Generate GitHub App token id : app - token uses : actions/create - github - app - token@v2 with : app-id : $ { { secrets.APP_ID } } private-key : $ { { secrets.APP_PRIVATE_KEY } } - name : Configure AWS Credentials (OIDC) uses : aws - actions/configure - aws - credentials@v4 with : role-to-assume : $ { { secrets.AWS_ROLE_TO_ASSUME } } aws-region : us - west - 2 - uses : ./.github/actions/claude - pr - action with : trigger_phrase : \"@claude\" timeout_minutes : \"60\" github_token : $ { { steps.app - token.outputs.token } } use_bedrock : \"true\" model : \"us.anthropic.claude-3-7-sonnet-20250219-v1:0\" The model ID format for Bedrock includes the region prefix (e.g., us.anthropic.claude... ) and version suffix. Google Vertex AI workflow Prerequisites: Vertex AI API enabled in your GCP project Workload Identity Federation configured for GitHub Service account with Vertex AI permissions Required GitHub secrets: Secret Name Description GCP_WORKLOAD_IDENTITY_PROVIDER Workload identity provider resource name GCP_SERVICE_ACCOUNT Service account email with Vertex AI access APP_ID Your GitHub App ID (from app settings) APP_PRIVATE_KEY The private key you generated for your GitHub App name : Claude PR Action permissions : contents : write pull-requests : write issues : write id-token : write on : issue_comment : types : [ created ] pull_request_review_comment : types : [ created ] issues : types : [ opened , assigned ] jobs : claude - pr : if : | (github.event_name == 'issue_comment' && contains(github.event.comment.body , '@claude')) | | (github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body , '@claude')) | | (github.event_name == 'issues' && contains(github.event.issue.body , '@claude')) runs-on : ubuntu - latest steps : - name : Checkout repository uses : actions/checkout@v4 - name : Generate GitHub App token id : app - token uses : actions/create - github - app - token@v2 with : app-id : $ { { secrets.APP_ID } } private-key : $ { { secrets.APP_PRIVATE_KEY } } - name : Authenticate to Google Cloud id : auth uses : google - github - actions/auth@v2 with : workload_identity_provider : $ { { secrets.GCP_WORKLOAD_IDENTITY_PROVIDER } } service_account : $ { { secrets.GCP_SERVICE_ACCOUNT } } - uses : ./.github/actions/claude - pr - action with : trigger_phrase : \"@claude\" timeout_minutes : \"60\" github_token : $ { { steps.app - token.outputs.token } } use_vertex : \"true\" model : \"claude-3-7-sonnet@20250219\" env : ANTHROPIC_VERTEX_PROJECT_ID : $ { { steps.auth.outputs.project_id } } CLOUD_ML_REGION : us - east5 VERTEX_REGION_CLAUDE_3_7_SONNET : us - east5 The project ID is automatically retrieved from the Google Cloud authentication step, so you dont need to hardcode it.  Troubleshooting  Claude not responding to @claude commands Verify the GitHub App is installed correctly, check that workflows are enabled, ensure API key is set in repository secrets, and confirm the comment contains @claude (not /claude ).  CI not running on Claudes commits Ensure youre using the GitHub App or custom app (not Actions user), check workflow triggers include the necessary events, and verify app permissions include CI triggers.  Authentication errors Confirm API key is valid and has sufficient permissions. For Bedrock/Vertex, check credentials configuration and ensure secrets are named correctly in workflows.  Advanced configuration  Action parameters The Claude Code Action supports these key parameters: Parameter Description Required prompt The prompt to send to Claude Yes* prompt_file Path to file containing prompt Yes* anthropic_api_key Anthropic API key Yes** max_turns Maximum conversation turns No timeout_minutes Execution timeout No *Either prompt or prompt_file required **Required for direct Anthropic API, not for Bedrock/Vertex  Alternative integration methods While the /install-github-app command is the recommended approach, you can also: Custom GitHub App : For organizations needing branded usernames or custom authentication flows. Create your own GitHub App with required permissions (contents, issues, pull requests) and use the actions/create-github-app-token action to generate tokens in your workflows. Manual GitHub Actions : Direct workflow configuration for maximum flexibility MCP Configuration : Dynamic loading of Model Context Protocol servers See the Claude Code Action repository for detailed documentation.  Customizing Claudes behavior You can configure Claudes behavior in two ways: CLAUDE.md : Define coding standards, review criteria, and project-specific rules in a CLAUDE.md file at the root of your repository. Claude will follow these guidelines when creating PRs and responding to requests. Check out our Memory documentation for more details. Custom prompts : Use the prompt parameter in the workflow file to provide workflow-specific instructions. This allows you to customize Claudes behavior for different workflows or tasks. Claude will follow these guidelines when creating PRs and responding to requests. Was this page helpful? Yes No Model Context Protocol (MCP) Claude Code SDK On this page Why use Claude Code GitHub Actions? What can Claude do? Claude Code Action Claude Code Action (Base) Setup Quick setup Manual setup Example use cases Turn issues into PRs Get implementation help Fix bugs quickly Best practices CLAUDE.md configuration Security considerations Optimizing performance CI costs Configuration examples Using with AWS Bedrock & Google Vertex AI Prerequisites For Google Cloud Vertex AI: For AWS Bedrock: Troubleshooting Claude not responding to @claude commands CI not running on Claudes commits Authentication errors Advanced configuration Action parameters Alternative integration methods Customizing Claudes behavior",149    "title": "Claude Code GitHub Actions - Anthropic",150    "url": "https://docs.anthropic.com/en/docs/claude-code/github-actions",151    "word_count": 2734,152    "char_count": 18597153  },154  {155    "chunk_id": 1,156    "text": "Anthropic home page English Search... Search... Navigation Getting started Claude Code overview Welcome Developer Guide API Guide Claude Code Model Context Protocol (MCP) Resources Release Notes Documentation Developer Discord Support Getting started Overview Set up Quickstart Memory management Common workflows Build with Claude Add Claude Code to your IDE Model Context Protocol (MCP) GitHub Actions Claude Code SDK Troubleshooting Deployment Overview Amazon Bedrock Google Vertex AI Corporate proxy LLM gateway Development containers Administration Identity and Access Management Security Monitoring Costs Reference CLI reference Interactive mode Slash commands Settings Resources Data usage Legal and compliance By integrating directly with your development environment, Claude Code streamlines your workflow without requiring additional servers or complex setup.  Basic usage To install Claude Code, use NPM: npm install -g @anthropic-ai/claude-code For more detailed installation instructions, see Set up Claude Code . To run Claude Code, simply call the claude CLI: claude You can then prompt Claude directly from the interactive Claude Code REPL session. For more usage instructions, see Quickstart .  Why Claude Code?  Accelerate development Use Claude Code to accelerate development with the following key capabilities: Editing files and fixing bugs across your codebase Answering questions about your codes architecture and logic Executing and fixing tests, linting, and other commands Searching through git history, resolving merge conflicts, and creating commits and PRs Browsing documentation and resources from the internet using web search  Security and privacy by design Your codes security is paramount. Claude Codes architecture ensures: Direct API connection : Your queries go straight to Anthropics API without intermediate servers Works where you work : Operates directly in your terminal Understands context : Maintains awareness of your entire project structure Takes action : Performs real operations like editing files and creating commits  Enterprise integration Claude Code seamlessly integrates with enterprise AI platforms. You can connect to Amazon Bedrock or Google Vertex AI for secure, compliant deployments that meet your organizations requirements.  Next steps Setup Install and authenticate Claude Code Quickstart See Claude Code in action with practical examples Commands Learn about CLI commands and controls Configuration Customize Claude Code for your workflow  Additional resources Common workflows Step-by-step guides for common workflows Troubleshooting Solutions for common issues with Claude Code Bedrock & Vertex integrations Configure Claude Code with Amazon Bedrock or Google Vertex AI Reference implementation Clone our development container reference implementation. Was this page helpful? Yes No Set up On this page Basic usage Why Claude Code? Accelerate development Security and privacy by design Enterprise integration Next steps Additional resources",157    "title": "Claude Code overview - Anthropic",158    "url": "https://docs.anthropic.com/en/docs/claude-code",159    "word_count": 416,160    "char_count": 3006161  },162  {163    "chunk_id": 1,164    "text": "Anthropic home page English Search... Search... Navigation Reference Slash commands Welcome Developer Guide API Guide Claude Code Model Context Protocol (MCP) Resources Release Notes Documentation Developer Discord Support Getting started Overview Set up Quickstart Memory management Common workflows Build with Claude Add Claude Code to your IDE Model Context Protocol (MCP) GitHub Actions Claude Code SDK Troubleshooting Deployment Overview Amazon Bedrock Google Vertex AI Corporate proxy LLM gateway Development containers Administration Identity and Access Management Security Monitoring Costs Reference CLI reference Interactive mode Slash commands Settings Resources Data usage Legal and compliance  Built-in slash commands Command Purpose /add-dir Add additional working directories /bug Report bugs (sends conversation to Anthropic) /clear Clear conversation history /compact [instructions] Compact conversation with optional focus instructions /config View/modify configuration /cost Show token usage statistics /doctor Checks the health of your Claude Code installation /help Get usage help /init Initialize project with CLAUDE.md guide /login Switch Anthropic accounts /logout Sign out from your Anthropic account /mcp Manage MCP server connections and OAuth authentication /memory Edit CLAUDE.md memory files /model Select or change the AI model /permissions View or update permissions /pr_comments View pull request comments /review Request code review /status View account and system statuses /terminal-setup Install Shift+Enter key binding for newlines (iTerm2 and VSCode only) /vim Enter vim mode for alternating insert and command modes  Custom slash commands Custom slash commands allow you to define frequently-used prompts as Markdown files that Claude Code can execute. Commands are organized by scope (project-specific or personal) and support namespacing through directory structures.  Syntax /<prefix>:<command-name> [arguments]  Parameters Parameter Description <prefix> Command scope ( project for project-specific, user for personal) <command-name> Name derived from the Markdown filename (without .md extension) [arguments] Optional arguments passed to the command  Command types  Project commands Commands stored in your repository and shared with your team. Location : .claude/commands/ Prefix : /project: In the following example, we create the /project:optimize command: mkdir -p .claude/commands echo \"Analyze this code for performance issues and suggest optimizations:\" > .claude/commands/optimize.md  Personal commands Commands available across all your projects. Location : ~/.claude/commands/ Prefix : /user: In the following example, we create the /user:security-review command: mkdir -p ~/.claude/commands echo \"Review this code for security vulnerabilities:\" > ~/.claude/commands/security-review.md  Features  Namespacing Organize commands in subdirectories to create namespaced commands. Structure : <prefix>:<namespace>:<command> For example, a file at .claude/commands/frontend/component.md creates the command /project:frontend:component  Arguments Pass dynamic values to commands using the $ARGUMENTS placeholder. For example: echo \"Fix issue # $ARGUMENTS following our coding standards\" > .claude/commands/fix-issue.md > /project:fix-issue 123  Bash command execution Execute bash commands before the slash command runs using the ! prefix. The output is included in the command context. For example: --- allowed-tools: Bash(git add: * ), Bash(git status: * ), Bash(git commit:*) description: Create a git commit --- ## Context - Current git status: ! `git status` - Current git diff (staged and unstaged changes): ! `git diff HEAD` - Current branch: ! `git branch --show-current` - Recent commits: ! `git log --oneline -10` ## Your task Based on the above changes, create a single git commit.  File references Include file contents in commands using the @ prefix to reference files . For example: # Reference a specific file Review the implementation in @src/utils/helpers.js # Reference multiple files Compare @src/old-version.js with @src/new-version.js  Thinking mode Slash commands can trigger extended thinking by including extended thinking keywords .  File format Command files support: Markdown format ( .md extension) YAML frontmatter for metadata: allowed-tools : List of tools the command can use description : Brief description of the command Dynamic content with bash commands ( ! ) and file references ( @ ) Prompt instructions as the main content  MCP slash commands MCP servers can expose prompts as slash commands that become available in Claude Code. These commands are dynamically discovered from connected MCP servers.  Command format MCP commands follow the pattern: /mcp__<server-name>__<prompt-name> [arguments]  Features  Dynamic discovery MCP commands are automatically available when: An MCP server is connected and active The server exposes prompts through the MCP protocol The prompts are successfully retrieved during connection  Arguments MCP prompts can accept arguments defined by the server: # Without arguments > /mcp__github__list_prs # With arguments > /mcp__github__pr_review 456 > /mcp__jira__create_issue \"Bug title\" high  Naming conventions Server and prompt names are normalized Spaces and special characters become underscores Names are lowercased for consistency  Managing MCP connections Use the /mcp command to: View all configured MCP servers Check connection status Authenticate with OAuth-enabled servers Clear authentication tokens View available tools and prompts from each server  See also Interactive mode - Shortcuts, input modes, and interactive features CLI reference - Command-line flags and options Settings - Configuration options Memory management - Managing Claudes memory across sessions Was this page helpful? Yes No Interactive mode Settings On this page Built-in slash commands Custom slash commands Syntax Parameters Command types Project commands Personal commands Features Namespacing Arguments Bash command execution File references Thinking mode File format MCP slash commands Command format Features Dynamic discovery Arguments Naming conventions Managing MCP connections See also",165    "title": "Slash commands - Anthropic",166    "url": "https://docs.anthropic.com/en/docs/claude-code/slash-commands",167    "word_count": 832,168    "char_count": 6196169  },170  {171    "chunk_id": 1,172    "text": "Anthropic home page English Search... Search... Navigation Deployment Enterprise deployment overview Welcome Developer Guide API Guide Claude Code Model Context Protocol (MCP) Resources Release Notes Documentation Developer Discord Support Getting started Overview Set up Quickstart Memory management Common workflows Build with Claude Add Claude Code to your IDE Model Context Protocol (MCP) GitHub Actions Claude Code SDK Troubleshooting Deployment Overview Amazon Bedrock Google Vertex AI Corporate proxy LLM gateway Development containers Administration Identity and Access Management Security Monitoring Costs Reference CLI reference Interactive mode Slash commands Settings Resources Data usage Legal and compliance This page provides an overview of available deployment options and helps you choose the right configuration for your organization.  Provider comparison Feature Anthropic Amazon Bedrock Google Vertex AI Regions Supported countries Multiple AWS regions Multiple GCP regions Prompt caching Enabled by default Enabled by default Contact Google for enablement Authentication API key AWS credentials (IAM) GCP credentials (OAuth/Service Account) Cost tracking Dashboard AWS Cost Explorer GCP Billing Enterprise features Teams, usage monitoring IAM policies, CloudTrail IAM roles, Cloud Audit Logs  Cloud providers Amazon Bedrock Use Claude models through AWS infrastructure with IAM-based authentication and AWS-native monitoring Google Vertex AI Access Claude models via Google Cloud Platform with enterprise-grade security and compliance  Corporate infrastructure Corporate Proxy Configure Claude Code to work with your organizations proxy servers and SSL/TLS requirements LLM Gateway Deploy centralized model access with usage tracking, budgeting, and audit logging  Configuration overview Claude Code supports flexible configuration options that allow you to combine different providers and infrastructure: Understand the difference between: Corporate proxy : An HTTP/HTTPS proxy for routing traffic (set via HTTPS_PROXY or HTTP_PROXY ) LLM Gateway : A service that handles authentication and provides provider-compatible endpoints (set via ANTHROPIC_BASE_URL , ANTHROPIC_BEDROCK_BASE_URL , or ANTHROPIC_VERTEX_BASE_URL ) Both configurations can be used in tandem.  Using Bedrock with corporate proxy Route Bedrock traffic through a corporate HTTP/HTTPS proxy: export CLAUDE_CODE_USE_BEDROCK = 1 export AWS_REGION = us-east-1 export HTTPS_PROXY = 'https://proxy.example.com:8080'  Using Bedrock with LLM Gateway Use a gateway service that provides Bedrock-compatible endpoints: export CLAUDE_CODE_USE_BEDROCK = 1 export ANTHROPIC_BEDROCK_BASE_URL = 'https://your-llm-gateway.com/bedrock' export CLAUDE_CODE_SKIP_BEDROCK_AUTH = 1  Using Vertex AI with corporate proxy Route Vertex AI traffic through a corporate HTTP/HTTPS proxy: export CLAUDE_CODE_USE_VERTEX = 1 export CLOUD_ML_REGION = us-east5 export ANTHROPIC_VERTEX_PROJECT_ID = your-project-id export HTTPS_PROXY = 'https://proxy.example.com:8080'  Using Vertex AI with LLM Gateway Combine Google Vertex AI models with an LLM gateway for centralized management: export CLAUDE_CODE_USE_VERTEX = 1 export ANTHROPIC_VERTEX_BASE_URL = 'https://your-llm-gateway.com/vertex' export CLAUDE_CODE_SKIP_VERTEX_AUTH = 1  Authentication configuration Claude Code uses the ANTHROPIC_AUTH_TOKEN for both Authorization and Proxy-Authorization headers when needed. The SKIP_AUTH flags ( CLAUDE_CODE_SKIP_BEDROCK_AUTH , CLAUDE_CODE_SKIP_VERTEX_AUTH ) are used in LLM gateway scenarios where the gateway handles provider authentication.  Choosing the right deployment configuration Consider these factors when selecting your deployment approach:  Direct provider access Best for organizations that: Want the simplest setup Have existing AWS or GCP infrastructure Need provider-native monitoring and compliance  Corporate proxy Best for organizations that: Have existing corporate proxy requirements Need traffic monitoring and compliance Must route all traffic through specific network paths  LLM Gateway Best for organizations that: Need usage tracking across teams Want to dynamically switch between models Require custom rate limiting or budgets Need centralized authentication management  Debugging When debugging your deployment: Use the claude /status slash command . This command provides observability into any applied authentication, proxy, and URL settings. Set environment variable export ANTHROPIC_LOG=debug to log requests.  Best practices for organizations We strongly recommend investing in documentation so that Claude Code understands your codebase. Many organizations make a CLAUDE.md file (which we also refer to as memory) in the root of the repository that contains the system architecture, how to run tests and other common commands, and best practices for contributing to the codebase. This file is typically checked into source control so that all users can benefit from it. Learn more . If you have a custom development environment, we find that creating a one click way to install Claude Code is key to growing adoption across an organization. Encourage new users to try Claude Code for codebase Q&A, or on smaller bug fixes or feature requests. Ask Claude Code to make a plan. Check Claudes suggestions and give feedback if its off-track. Over time, as users understand this new paradigm better, then theyll be more effective at letting Claude Code run more agentically. Security teams can configure managed permissions for what Claude Code is and is not allowed to do, which cannot be overwritten by local configuration. Learn more . MCP is a great way to give Claude Code more information, such as connecting to ticket management systems or error logs. We recommend that one central team configures MCP servers and checks a .mcp.json configuration into the codebase so that all users benefit. Learn more . At Anthropic, we trust Claude Code to power development across every Anthropic codebase. We hope you enjoy using Claude Code as much as we do!  Next steps Set up Amazon Bedrock for AWS-native deployment Configure Google Vertex AI for GCP deployment Implement Corporate Proxy for network requirements Deploy LLM Gateway for enterprise management Settings for configuration options and environment variables Was this page helpful? Yes No Troubleshooting Amazon Bedrock On this page Provider comparison Cloud providers Corporate infrastructure Configuration overview Using Bedrock with corporate proxy Using Bedrock with LLM Gateway Using Vertex AI with corporate proxy Using Vertex AI with LLM Gateway Authentication configuration Choosing the right deployment configuration Direct provider access Corporate proxy LLM Gateway Debugging Best practices for organizations Next steps",173    "title": "Enterprise deployment overview - Anthropic",174    "url": "https://docs.anthropic.com/en/docs/claude-code/bedrock-vertex-proxies",175    "word_count": 916,176    "char_count": 6770177  },178  {179    "chunk_id": 1,180    "text": "Anthropic home page English Search... Search... Navigation Reference Claude Code settings Welcome Developer Guide API Guide Claude Code Model Context Protocol (MCP) Resources Release Notes Documentation Developer Discord Support Getting started Overview Set up Quickstart Memory management Common workflows Build with Claude Add Claude Code to your IDE Model Context Protocol (MCP) GitHub Actions Claude Code SDK Troubleshooting Deployment Overview Amazon Bedrock Google Vertex AI Corporate proxy LLM gateway Development containers Administration Identity and Access Management Security Monitoring Costs Reference CLI reference Interactive mode Slash commands Settings Resources Data usage Legal and compliance Claude Code offers a variety of settings to configure its behavior to meet your needs. You can configure Claude Code by running the /config command when using the interactive REPL.  Settings files The settings.json file is our official mechanism for configuring Claude Code through hierarchical settings: User settings are defined in ~/.claude/settings.json and apply to all projects. Project settings are saved in your project directory: .claude/settings.json for settings that are checked into source control and shared with your team .claude/settings.local.json for settings that are not checked in, useful for personal preferences and experimentation. Claude Code will configure git to ignore .claude/settings.local.json when it is created. For enterprise deployments of Claude Code, we also support enterprise managed policy settings . These take precedence over user and project settings. System administrators can deploy policies to /Library/Application Support/ClaudeCode/managed-settings.json on macOS and /etc/claude-code/managed-settings.json on Linux and Windows via WSL. Example settings.json { \"permissions\" : { \"allow\" : [ \"Bash(npm run lint)\" , \"Bash(npm run test:*)\" , \"Read(~/.zshrc)\" ] , \"deny\" : [ \"Bash(curl:*)\" ] } , \"env\" : { \"CLAUDE_CODE_ENABLE_TELEMETRY\" : \"1\" , \"OTEL_METRICS_EXPORTER\" : \"otlp\" } }  Available settings settings.json supports a number of options: Key Description Example apiKeyHelper Custom script, to be executed in /bin/sh , to generate an auth value. This value will generally be sent as X-Api-Key , Authorization: Bearer , and Proxy-Authorization: Bearer headers for model requests /bin/generate_temp_api_key.sh cleanupPeriodDays How long to locally retain chat transcripts (default: 30 days) 20 env Environment variables that will be applied to every session {\"FOO\": \"bar\"} includeCoAuthoredBy Whether to include the co-authored-by Claude byline in git commits and pull requests (default: true ) false permissions See table below for structure of permissions.  Permission settings Keys Description Example allow Array of permission rules to allow tool use [ \"Bash(git diff:*)\" ] deny Array of permission rules to deny tool use [ \"WebFetch\", \"Bash(curl:*)\" ] additionalDirectories Additional working directories that Claude has access to [ \"../docs/\" ] defaultMode Default permission mode when opening Claude Code \"allowEdits\" disableBypassPermissionsMode Set to \"disable\" to prevent bypassPermissions mode from being activated. See managed policy settings \"disable\"  Settings precedence Settings are applied in order of precedence: Enterprise policies (see IAM documentation ) Command line arguments Local project settings Shared project settings User settings  Environment variables Claude Code supports the following environment variables to control its behavior: All environment variables can also be configured in settings.json . This is useful as a way to automatically set environment variables for each session, or to roll out a set of environment variables for your whole team or organization. Variable Purpose ANTHROPIC_API_KEY API key sent as X-Api-Key header, typically for the Claude SDK (for interactive usage, run /login ) ANTHROPIC_AUTH_TOKEN Custom value for the Authorization and Proxy-Authorization headers (the value you set here will be prefixed with Bearer ) ANTHROPIC_CUSTOM_HEADERS Custom headers you want to add to the request (in Name: Value format) ANTHROPIC_MODEL Name of custom model to use (see Model Configuration ) ANTHROPIC_SMALL_FAST_MODEL Name of Haiku-class model for background tasks BASH_DEFAULT_TIMEOUT_MS Default timeout for long-running bash commands BASH_MAX_TIMEOUT_MS Maximum timeout the model can set for long-running bash commands BASH_MAX_OUTPUT_LENGTH Maximum number of characters in bash outputs before they are middle-truncated CLAUDE_BASH_MAINTAIN_PROJECT_WORKING_DIR Return to the original working directory after each Bash command CLAUDE_CODE_API_KEY_HELPER_TTL_MS Interval in milliseconds at which credentials should be refreshed (when using apiKeyHelper ) CLAUDE_CODE_MAX_OUTPUT_TOKENS Set the maximum number of output tokens for most requests CLAUDE_CODE_USE_BEDROCK Use Bedrock (see Bedrock & Vertex ) CLAUDE_CODE_USE_VERTEX Use Vertex (see Bedrock & Vertex ) CLAUDE_CODE_SKIP_BEDROCK_AUTH Skip AWS authentication for Bedrock (e.g. when using an LLM gateway) CLAUDE_CODE_SKIP_VERTEX_AUTH Skip Google authentication for Vertex (e.g. when using an LLM gateway) CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC Equivalent of setting DISABLE_AUTOUPDATER , DISABLE_BUG_COMMAND , DISABLE_ERROR_REPORTING , and DISABLE_TELEMETRY DISABLE_AUTOUPDATER Set to 1 to disable the automatic updater DISABLE_BUG_COMMAND Set to 1 to disable the /bug command DISABLE_COST_WARNINGS Set to 1 to disable cost warning messages DISABLE_ERROR_REPORTING Set to 1 to opt out of Sentry error reporting DISABLE_NON_ESSENTIAL_MODEL_CALLS Set to 1 to disable model calls for non-critical paths like flavor text DISABLE_TELEMETRY Set to 1 to opt out of Statsig telemetry (note that Statsig events do not include user data like code, file paths, or bash commands) HTTP_PROXY Specify HTTP proxy server for network connections HTTPS_PROXY Specify HTTPS proxy server for network connections MAX_THINKING_TOKENS Force a thinking for the model budget MCP_TIMEOUT Timeout in milliseconds for MCP server startup MCP_TOOL_TIMEOUT Timeout in milliseconds for MCP tool execution MAX_MCP_OUTPUT_TOKENS Maximum number of tokens allowed in MCP tool responses (default: 25000)  Configuration options We are in the process of migrating global configuration to settings.json . claude config will be deprecated in place of settings.json To manage your configurations, use the following commands: List settings: claude config list See a setting: claude config get <key> Change a setting: claude config set <key> <value> Push to a setting (for lists): claude config add <key> <value> Remove from a setting (for lists): claude config remove <key> <value> By default config changes your project configuration. To manage your global configuration, use the --global (or -g ) flag.  Global configuration To set a global configuration, use claude config set -g <key> <value> : Key Description Example autoUpdaterStatus Enable or disable the auto-updater (default: enabled ) disabled preferredNotifChannel Where you want to receive notifications (default: iterm2 ) iterm2 , iterm2_with_bell , terminal_bell , or notifications_disabled theme Color theme dark , light , light-daltonized , or dark-daltonized verbose Whether to show full bash and command outputs (default: false ) true  Tools available to Claude Claude Code has access to a set of powerful tools that help it understand and modify your codebase: Tool Description Permission Required Agent Runs a sub-agent to handle complex, multi-step tasks No Bash Executes shell commands in your environment Yes Edit Makes targeted edits to specific files Yes Glob Finds files based on pattern matching No Grep Searches for patterns in file contents No LS Lists files and directories No MultiEdit Performs multiple edits on a single file atomically Yes NotebookEdit Modifies Jupyter notebook cells Yes NotebookRead Reads and displays Jupyter notebook contents No Read Reads the contents of files No TodoRead Reads the current sessions task list No TodoWrite Creates and manages structured task lists No WebFetch Fetches content from a specified URL Yes WebSearch Performs web searches with domain filtering Yes Write Creates or overwrites files Yes Permission rules can be configured using /allowed-tools or in permission settings .  See also Identity and Access Management - Learn about Claude Codes permission system IAM and access control - Enterprise policy management Troubleshooting - Solutions for common configuration issues Was this page helpful? Yes No Slash commands Data usage On this page Settings files Available settings Permission settings Settings precedence Environment variables Configuration options Global configuration Tools available to Claude See also",181    "title": "Claude Code settings - Anthropic",182    "url": "https://docs.anthropic.com/en/docs/claude-code/settings",183    "word_count": 1217,184    "char_count": 8773185  },186  {187    "chunk_id": 1,188    "text": "Anthropic home page English Search... Search... Navigation Getting started Set up Claude Code Welcome Developer Guide API Guide Claude Code Model Context Protocol (MCP) Resources Release Notes Documentation Developer Discord Support Getting started Overview Set up Quickstart Memory management Common workflows Build with Claude Add Claude Code to your IDE Model Context Protocol (MCP) GitHub Actions Claude Code SDK Troubleshooting Deployment Overview Amazon Bedrock Google Vertex AI Corporate proxy LLM gateway Development containers Administration Identity and Access Management Security Monitoring Costs Reference CLI reference Interactive mode Slash commands Settings Resources Data usage Legal and compliance  System requirements Operating Systems : macOS 10.15+, Ubuntu 20.04+/Debian 10+, or Windows via WSL Hardware : 4GB RAM minimum Software : Node.js 18+ git 2.23+ (optional) GitHub or GitLab CLI for PR workflows (optional) Network : Internet connection required for authentication and AI processing Location : Available only in supported countries  Install and authenticate 1 Install Claude Code Install NodeJS 18+ , then run: npm install -g @anthropic-ai/claude-code Do NOT use sudo npm install -g as this can lead to permission issues and security risks. If you encounter permission errors, see configure Claude Code for recommended solutions. 2 Navigate to your project cd your-project-directory 3 Start Claude Code claude 4 Complete authentication Claude Code offers multiple authentication options: Anthropic Console : The default option. Connect through the Anthropic Console and complete the OAuth process. Requires active billing at console.anthropic.com . Claude App (with Pro or Max plan) : Subscribe to Claudes Pro or Max plan for a unified subscription that includes both Claude Code and the web interface. Get more value at the same price point while managing your account in one place. Log in with your Claude.ai account. During launch, choose the option that matches your subscription type. Enterprise platforms : Configure Claude Code to use Amazon Bedrock or Google Vertex AI for enterprise deployments with your existing cloud infrastructure.  Initialize your project For first-time users, we recommend: 1 Start Claude Code claude 2 Run a simple command > summarize this project 3 Generate a CLAUDE.md project guide /init 4 Commit the generated CLAUDE.md file Ask Claude to commit the generated CLAUDE.md file to your repository.  Troubleshooting  Troubleshooting WSL installation Currently, Claude Code does not run directly in Windows, and instead requires WSL. You might encounter the following issues in WSL: OS/platform detection issues : If you receive an error during installation, WSL may be using Windows npm . Try: Run npm config set os linux before installation Install with npm install -g @anthropic-ai/claude-code --force --no-os-check (Do NOT use sudo ) Node not found errors : If you see exec: node: not found when running claude , your WSL environment may be using a Windows installation of Node.js. You can confirm this with which npm and which node , which should point to Linux paths starting with /usr/ rather than /mnt/c/ . To fix this, try installing Node via your Linux distributions package manager or via nvm .  Optimize your terminal setup Claude Code works best when your terminal is properly configured. Follow these guidelines to optimize your experience. Supported shells : Bash Zsh Fish  Themes and appearance Claude cannot control the theme of your terminal. Thats handled by your terminal application. You can match Claude Codes theme to your terminal during onboarding or any time via the /config command  Line breaks You have several options for entering linebreaks into Claude Code: Quick escape : Type  followed by Enter to create a newline Keyboard shortcut : Press Option+Enter (Meta+Enter) with proper configuration To set up Option+Enter in your terminal: For Mac Terminal.app: Open Settings  Profiles  Keyboard Check Use Option as Meta Key For iTerm2 and VSCode terminal: Open Settings  Profiles  Keys Under General, set Left/Right Option key to Esc+ Tip for iTerm2 and VSCode users : Run /terminal-setup within Claude Code to automatically configure Shift+Enter as a more intuitive alternative.  Notification setup Never miss when Claude completes a task with proper notification configuration:  Terminal bell notifications Enable sound alerts when tasks complete: claude config set --global preferredNotifChannel terminal_bell For macOS users : Dont forget to enable notification permissions in System Settings  Notifications  [Your Terminal App].  iTerm 2 system notifications For iTerm 2 alerts when tasks complete: Open iTerm 2 Preferences Navigate to Profiles  Terminal Enable Silence bell and Filter Alerts  Send escape sequence-generated alerts Set your preferred notification delay Note that these notifications are specific to iTerm 2 and not available in the default macOS Terminal.  Handling large inputs When working with extensive code or long instructions: Avoid direct pasting : Claude Code may struggle with very long pasted content Use file-based workflows : Write content to a file and ask Claude to read it Be aware of VS Code limitations : The VS Code terminal is particularly prone to truncating long pastes  Vim Mode Claude Code supports a subset of Vim keybindings that can be enabled with /vim or configured via /config . The supported subset includes: Mode switching: Esc (to NORMAL), i / I , a / A , o / O (to INSERT) Navigation: h / j / k / l , w / e / b , 0 / $ /  , gg / G Editing: x , dw / de / db / dd / D , cw / ce / cb / cc / C , . (repeat) Was this page helpful? Yes No Overview Quickstart On this page System requirements Install and authenticate Initialize your project Troubleshooting Troubleshooting WSL installation Optimize your terminal setup Themes and appearance Line breaks Notification setup Terminal bell notifications iTerm 2 system notifications Handling large inputs Vim Mode",189    "title": "Set up Claude Code - Anthropic",190    "url": "https://docs.anthropic.com/en/docs/claude-code/setup",191    "word_count": 936,192    "char_count": 5997193  },194  {195    "chunk_id": 1,196    "text": "Anthropic home page English Search... Search... Navigation Reference Interactive mode Welcome Developer Guide API Guide Claude Code Model Context Protocol (MCP) Resources Release Notes Documentation Developer Discord Support Getting started Overview Set up Quickstart Memory management Common workflows Build with Claude Add Claude Code to your IDE Model Context Protocol (MCP) GitHub Actions Claude Code SDK Troubleshooting Deployment Overview Amazon Bedrock Google Vertex AI Corporate proxy LLM gateway Development containers Administration Identity and Access Management Security Monitoring Costs Reference CLI reference Interactive mode Slash commands Settings Resources Data usage Legal and compliance  Keyboard shortcuts  General controls Shortcut Description Context Ctrl+C Cancel current input or generation Standard interrupt Ctrl+D Exit Claude Code session EOF signal Ctrl+L Clear terminal screen Keeps conversation history Up/Down arrows Navigate command history Recall previous inputs Esc + Esc Edit previous message Double-escape to modify  Multiline input Method Shortcut Context Quick escape  + Enter Works in all terminals macOS default Option+Enter Default on macOS Terminal setup Shift+Enter After /terminal-setup Paste mode Paste directly For code blocks, logs  Quick commands Shortcut Description Notes # at start Memory shortcut - add to CLAUDE.md Prompts for file selection / at start Slash command See slash commands  Vim mode Enable vim-style editing with /vim command or configure permanently via /config .  Mode switching Command Action From mode Esc Enter NORMAL mode INSERT i Insert before cursor NORMAL I Insert at beginning of line NORMAL a Insert after cursor NORMAL A Insert at end of line NORMAL o Open line below NORMAL O Open line above NORMAL  Navigation (NORMAL mode) Command Action h / j / k / l Move left/down/up/right w Next word e End of word b Previous word 0 Beginning of line $ End of line  First non-blank character gg Beginning of input G End of input  Editing (NORMAL mode) Command Action x Delete character dd Delete line D Delete to end of line dw / de / db Delete word/to end/back cc Change line C Change to end of line cw / ce / cb Change word/to end/back . Repeat last change Configure your preferred line break behavior in terminal settings. Run /terminal-setup to install Shift+Enter binding for iTerm2 and VSCode terminals.  Command history Claude Code maintains command history for the current session: History is stored per working directory Cleared with /clear command Use Up/Down arrows to navigate (see keyboard shortcuts above) Ctrl+R : Reverse search through history (if supported by terminal) Note : History expansion ( ! ) is disabled by default  See also Slash commands - Interactive session commands CLI reference - Command-line flags and options Settings - Configuration options Memory management - Managing CLAUDE.md files Was this page helpful? Yes No CLI reference Slash commands On this page Keyboard shortcuts General controls Multiline input Quick commands Vim mode Mode switching Navigation (NORMAL mode) Editing (NORMAL mode) Command history See also",197    "title": "Interactive mode - Anthropic",198    "url": "https://docs.anthropic.com/en/docs/claude-code/interactive-mode",199    "word_count": 475,200    "char_count": 3125201  },202  {203    "chunk_id": 1,204    "text": "Anthropic home page English Search... Search... Navigation Resources Data usage Welcome Developer Guide API Guide Claude Code Model Context Protocol (MCP) Resources Release Notes Documentation Developer Discord Support Getting started Overview Set up Quickstart Memory management Common workflows Build with Claude Add Claude Code to your IDE Model Context Protocol (MCP) GitHub Actions Claude Code SDK Troubleshooting Deployment Overview Amazon Bedrock Google Vertex AI Corporate proxy LLM gateway Development containers Administration Identity and Access Management Security Monitoring Costs Reference CLI reference Interactive mode Slash commands Settings Resources Data usage Legal and compliance  Data policies  Data training policy By default, Anthropic does not train generative models using code or prompts that are sent to Claude Code. We aim to be fully transparent about how we use your data. We may use feedback to improve our products and services, but we will not train generative models using your feedback from Claude Code.  Development Partner Program If you explicitly opt in to methods to provide us with materials to train on, such as via the Development Partner Program , we may use those materials provided to train our models. An organization admin can expressly opt-in to the Development Partner Program for their organization. Note that this program is available only for Anthropic first-party API, and not for Bedrock or Vertex users.  Feedback transcripts If you choose to send us feedback about Claude Code, such as transcripts of your usage, Anthropic may use that feedback to debug related issues and improve Claude Codes functionality (e.g., to reduce the risk of similar bugs occurring in the future). We will not train generative models using this feedback. Given their potentially sensitive nature, we store user feedback transcripts for only 30 days.  Data retention You can use an API key from a zero data retention organization. When doing so, Claude Code will not retain your chat transcripts on our servers. Users local Claude Code clients may store sessions locally for up to 30 days so that users can resume them. This behavior is configurable.  Privacy safeguards We have implemented several safeguards to protect your data, including: Limited retention periods for sensitive information Restricted access to user session data Clear policies against using feedback for model training For full details, please review our Commercial Terms of Service and Privacy Policy .  Data flow and dependencies Claude Code is installed from NPM . Claude Code runs locally. In order to interact with the LLM, Claude Code sends data over the network. This data includes all user prompts and model outputs. The data is encrypted in transit via TLS and is not encrypted at rest. Claude Code is compatible with most popular VPNs and LLM proxies. Claude Code is built on Anthropics APIs. For details regarding our APIs security controls, including our API logging procedures, please refer to compliance artifacts offered in the Anthropic Trust Center .  Telemetry services Claude Code connects from users machines to the Statsig service to log operational metrics such as latency, reliability, and usage patterns. This logging does not include any code or file paths. Data is encrypted in transit using TLS and at rest using 256-bit AES encryption. Read more in the Statsig security documentation . To opt out of Statsig telemetry, set the DISABLE_TELEMETRY environment variable. Claude Code connects from users machines to Sentry for operational error logging. The data is encrypted in transit using TLS and at rest using 256-bit AES encryption. Read more in the Sentry security documentation . To opt out of error logging, set the DISABLE_ERROR_REPORTING environment variable. When users run the /bug command, a copy of their full conversation history including code is sent to Anthropic. The data is encrypted in transit and at rest. Optionally, a Github issue is created in our public repository. To opt out of bug reporting, set the DISABLE_BUG_COMMAND environment variable.  Default behaviors by API provider By default, we disable all non-essential traffic (including error reporting, telemetry, and bug reporting functionality) when using Bedrock or Vertex. You can also opt out of all of these at once by setting the CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC environment variable. Here are the full default behaviors: Service Anthropic API Vertex API Bedrock API Statsig (Metrics) Default on. DISABLE_TELEMETRY=1 to disable. Default off. CLAUDE_CODE_USE_VERTEX must be 1. Default off. CLAUDE_CODE_USE_BEDROCK must be 1. Sentry (Errors) Default on. DISABLE_ERROR_REPORTING=1 to disable. Default off. CLAUDE_CODE_USE_VERTEX must be 1. Default off. CLAUDE_CODE_USE_BEDROCK must be 1. Anthropic API ( /bug reports) Default on. DISABLE_BUG_COMMAND=1 to disable. Default off. CLAUDE_CODE_USE_VERTEX must be 1. Default off. CLAUDE_CODE_USE_BEDROCK must be 1. All environment variables can be checked into settings.json ( read more ). Was this page helpful? Yes No Settings Legal and compliance On this page Data policies Data training policy Development Partner Program Feedback transcripts Data retention Privacy safeguards Data flow and dependencies Telemetry services Default behaviors by API provider",205    "title": "Data usage - Anthropic",206    "url": "https://docs.anthropic.com/en/docs/claude-code/data-usage",207    "word_count": 803,208    "char_count": 5327209  },210  {211    "chunk_id": 1,212    "text": "Anthropic home page English Search... Search... Navigation Deployment LLM gateway configuration Welcome Developer Guide API Guide Claude Code Model Context Protocol (MCP) Resources Release Notes Documentation Developer Discord Support Getting started Overview Set up Quickstart Memory management Common workflows Build with Claude Add Claude Code to your IDE Model Context Protocol (MCP) GitHub Actions Claude Code SDK Troubleshooting Deployment Overview Amazon Bedrock Google Vertex AI Corporate proxy LLM gateway Development containers Administration Identity and Access Management Security Monitoring Costs Reference CLI reference Interactive mode Slash commands Settings Resources Data usage Legal and compliance LLM gateways provide a centralized proxy layer between Claude Code and model providers, offering: Centralized authentication - Single point for API key management Usage tracking - Monitor usage across teams and projects Cost controls - Implement budgets and rate limits Audit logging - Track all model interactions for compliance Model routing - Switch between providers without code changes  LiteLLM configuration LiteLLM is a third-party proxy service. Anthropic doesnt endorse, maintain, or audit LiteLLMs security or functionality. This guide is provided for informational purposes and may become outdated. Use at your own discretion.  Prerequisites Claude Code updated to the latest version LiteLLM Proxy Server deployed and accessible Access to Claude models through your chosen provider  Basic LiteLLM setup Configure Claude Code :  Authentication methods Static API key Simplest method using a fixed API key: export ANTHROPIC_AUTH_TOKEN = sk-litellm-static-key { \"env\" : { \"ANTHROPIC_AUTH_TOKEN\" : \"sk-litellm-static-key\" } } This value will be sent as the Authorization and Proxy-Authorization headers, although Authorization may be overwritten (see Vertex Client-specified credentials below). Dynamic API key with helper For rotating keys or per-user authentication: Create an API key helper script: #!/bin/bash vault kv get -field = api_key secret/litellm/claude-code jwt encode  --secret = \" ${JWT_SECRET} \"  --exp = \"+1h\"  '{\"user\":\"' ${ USER } '\",\"team\":\"engineering\"}' Configure Claude Code settings to use the helper: { \"apiKeyHelper\" : \"~/bin/get-litellm-key.sh\" } Set token refresh interval: export CLAUDE_CODE_API_KEY_HELPER_TTL_MS = 3600000 This value will be sent as Authorization , Proxy-Authorization , and X-Api-Key headers, although Authorization may be overwritten (see Google Vertex AI through LiteLLM ). The apiKeyHelper has lower precedence than ANTHROPIC_AUTH_TOKEN or ANTHROPIC_API_KEY .  Provider-specific configurations Anthropic API through LiteLLM Using pass-through endpoint : export ANTHROPIC_BASE_URL = https://litellm-server:4000/anthropic Amazon Bedrock through LiteLLM Using pass-through endpoint : export ANTHROPIC_BEDROCK_BASE_URL = https://litellm-server:4000/bedrock export CLAUDE_CODE_SKIP_BEDROCK_AUTH = 1 export CLAUDE_CODE_USE_BEDROCK = 1 Google Vertex AI through LiteLLM Using pass-through endpoint : Recommended: Proxy-specified credentials export ANTHROPIC_VERTEX_BASE_URL = https://litellm-server:4000/vertex_ai/v1 export ANTHROPIC_VERTEX_PROJECT_ID = your-gcp-project-id export CLAUDE_CODE_SKIP_VERTEX_AUTH = 1 export CLAUDE_CODE_USE_VERTEX = 1 export CLOUD_ML_REGION = us-east5 Alternative: Client-specified credentials If you prefer to use local GCP credentials: Authenticate with GCP locally: gcloud auth application-default login Set Claude Code environment: export ANTHROPIC_VERTEX_BASE_URL = https://litellm-server:4000/vertex_ai/v1 export ANTHROPIC_VERTEX_PROJECT_ID = your-gcp-project-id export CLAUDE_CODE_USE_VERTEX = 1 export CLOUD_ML_REGION = us-east5 Update LiteLLM header configuration: Ensure your LiteLLM config has general_settings.litellm_key_header_name set to Proxy-Authorization , since the pass-through GCP token will be located on the Authorization header.  Unified endpoint Using LiteLLMs Anthropic format endpoint : export ANTHROPIC_BASE_URL = https://litellm-server:4000  Model selection By default, the models will use those specified in Model configuration . If you have configured custom model names in LiteLLM, set the aforementioned environment variables to those custom names. For more detailed information, refer to the LiteLLM documentation .  Additional resources LiteLLM documentation Claude Code settings Corporate proxy setup Third-party integrations overview Was this page helpful? Yes No Corporate proxy Development containers On this page LiteLLM configuration Prerequisites Basic LiteLLM setup Authentication methods Provider-specific configurations Unified endpoint Model selection Additional resources",213    "title": "LLM gateway configuration - Anthropic",214    "url": "https://docs.anthropic.com/en/docs/claude-code/llm-gateway",215    "word_count": 583,216    "char_count": 4716217  },218  {219    "chunk_id": 1,220    "text": "Anthropic home page English Search... Search... Navigation Deployment Corporate proxy configuration Welcome Developer Guide API Guide Claude Code Model Context Protocol (MCP) Resources Release Notes Documentation Developer Discord Support Getting started Overview Set up Quickstart Memory management Common workflows Build with Claude Add Claude Code to your IDE Model Context Protocol (MCP) GitHub Actions Claude Code SDK Troubleshooting Deployment Overview Amazon Bedrock Google Vertex AI Corporate proxy LLM gateway Development containers Administration Identity and Access Management Security Monitoring Costs Reference CLI reference Interactive mode Slash commands Settings Resources Data usage Legal and compliance Claude Code supports standard HTTP/HTTPS proxy configurations through environment variables. This allows you to route all Claude Code traffic through your organizations proxy servers for security, compliance, and monitoring purposes.  Basic proxy configuration  Environment variables Claude Code respects standard proxy environment variables: export HTTPS_PROXY = https://proxy.example.com:8080 export HTTP_PROXY = http://proxy.example.com:8080 Claude Code currently does not support the NO_PROXY environment variable. All traffic will be routed through the configured proxy. Claude Code does not support SOCKS proxies.  Authentication  Basic authentication If your proxy requires basic authentication, include credentials in the proxy URL: export HTTPS_PROXY = http://username:password@proxy.example.com:8080 Avoid hardcoding passwords in scripts. Use environment variables or secure credential storage instead. For proxies requiring advanced authentication (NTLM, Kerberos, etc.), consider using an LLM Gateway service that supports your authentication method.  SSL certificate issues If your proxy uses custom SSL certificates, you may encounter certificate errors. Ensure that you set the correct certificate bundle path: export SSL_CERT_FILE = /path/to/certificate-bundle.crt export NODE_EXTRA_CA_CERTS = /path/to/certificate-bundle.crt  Network access requirements Claude Code requires access to the following URLs: api.anthropic.com - Claude API endpoints statsig.anthropic.com - Telemetry and metrics sentry.io - Error reporting Ensure these URLs are allowlisted in your proxy configuration and firewall rules. This is especially important when using Claude Code in containerized or restricted network environments.  Additional resources Claude Code settings Environment variables reference Troubleshooting guide Was this page helpful? Yes No Google Vertex AI LLM gateway On this page Basic proxy configuration Environment variables Authentication Basic authentication SSL certificate issues Network access requirements Additional resources",221    "title": "Corporate proxy configuration - Anthropic",222    "url": "https://docs.anthropic.com/en/docs/claude-code/corporate-proxy",223    "word_count": 343,224    "char_count": 2769225  }226]