Skip to the content.

ClaudeCoderAction Documentation

Test Status Latest Release License Sponsor

Overview

ClaudeCoder is a GitHub Action that automatically processes pull requests using AWS Bedrock and Claude 3.7 Sonnet to suggest code changes. It analyzes your repository content and pull request descriptions to provide intelligent code suggestions, enhancing your development workflow.

✨ Key Features

📋 Prerequisites

Before you can use ClaudeCoderAction, you need to have:

  1. An AWS account with access to AWS Bedrock
  2. AWS credentials (Access Key ID and Secret Access Key) with permissions to invoke AWS Bedrock
  3. A GitHub repository where you want to use this action

🛠️ Setup Guide

  1. Add the following secrets to your GitHub repository:
    • AWS_ACCESS_KEY_ID: Your AWS Access Key ID
    • AWS_SECRET_ACCESS_KEY: Your AWS Secret Access Key
  2. Create a workflow file (e.g., .github/workflows/claudecoder.yml) in your repository with the following content:
name: ClaudeCoder

on:
  pull_request:
    types: [opened, edited, labeled]
  pull_request_review_comment:
    types: [created, edited]
  issue_comment:
    types: [created, edited]

jobs:
  process-pr:
    # Only run this job if the PR has the 'claudecoder' label
    # This is a recommended filter at the workflow level for efficiency
    if: contains(github.event.pull_request.labels.*.name, 'claudecoder')
    permissions: write-all
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v3
    - name: ClaudeCoderAction
      uses: EndemicMedia/claudecoder@v2.0.0
      with:
        aws-access-key-id: $
        aws-secret-access-key: $
        github-token: $
        # The following is optional - defaults to 'claudecoder'
        required-label: claudecoder

⚙️ Configuration Options

You can configure ClaudeCoderAction using the following inputs in your workflow file:

Basic Configuration

Advanced Claude 3.7 Sonnet Configuration

Example with Custom Configuration

- uses: EndemicMedia/claudecoder@v2.0.0
  with:
    aws-access-key-id: $
    aws-secret-access-key: $
    aws-region: eu-west-1
    max-requests: 5
    max-tokens: 32000
    enable-thinking: true
    thinking-budget: 2000
    extended-output: true
    request-timeout: 1800000
    required-label: 'ai-review' # Custom label

▶️ Usage

ClaudeCoderAction will automatically run on pull requests that have the “claudecoder” label. It will:

  1. Verify that the PR has the required label (default: “claudecoder”)
  2. Analyze the repository content and the pull request description
  3. Generate code suggestions using Claude 3.7 Sonnet
  4. Apply the suggested changes to the pull request branch
  5. Add a comment to the pull request with a summary of the changes

To use ClaudeCoderAction on a pull request:

  1. Create or edit a pull request
  2. Add the “claudecoder” label to the PR
  3. Wait for ClaudeCoder to process the PR and suggest changes

🏷️ Label Filtering Options

You can implement label filtering in two ways:

  1. Workflow-level filtering (recommended): Using the if condition in your workflow file as shown in the setup example:
    if: contains(github.event.pull_request.labels.*.name, 'claudecoder')
    

    This prevents the job from running entirely when the label is not present, saving computational resources.

  2. Action-level filtering (built-in): The action itself checks for the required label and exits gracefully if missing, adding a comment to inform users. This acts as a safety mechanism even if workflow-level filtering is not set up.

We recommend using both approaches for optimal efficiency and user experience.

⚠️ Limitations

👥 Contributing

Contributions to ClaudeCoderAction are welcome! Please see CONTRIBUTING.md for guidelines on commit messages, pull requests, and our development workflow.

Testing

ClaudeCoderAction repository includes a comprehensive test suite built with Jest. Tests cover:

To run the tests locally:

# Install dependencies
npm ci

# Run tests
npm test

# Run tests with coverage
npm run test:coverage

Windows users can use the provided batch file:

run-tests.bat

All pull requests are automatically tested using GitHub Actions.

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

❤️ Support

If you find ClaudeCoderAction valuable, please consider supporting the project:

Your support helps us maintain and improve ClaudeCoderAction. Every contribution makes a difference!

💬 Community

If you encounter any problems or have any questions about ClaudeCoderAction, please open an issue in the GitHub repository. We’re here to help!