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.
14.9k
1[2 {3 "chunk_id": 1,4 "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",5 "title": "Claude Code GitHub Actions - Anthropic",6 "url": "https://docs.anthropic.com/en/docs/claude-code/github-actions",7 "word_count": 2734,8 "char_count": 185979 }10]