# Experimental Features **Note:** Experimental features are considered unstable and not supported for production use. They may change or be removed at any time. ## Automatic Mode Detection The action intelligently detects the appropriate execution mode based on your workflow context, eliminating the need for manual mode configuration. ### Interactive Mode (Tag Mode) Activated when Claude detects @mentions, issue assignments, or labels—without an explicit `prompt`. - **Triggers**: `@claude` mentions in comments, issue assignment to claude user, label application - **Features**: Creates tracking comments with progress checkboxes, full implementation capabilities - **Use case**: Interactive code assistance, Q&A, and implementation requests ```yaml - uses: anthropics/claude-code-action@v1 with: anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }} # No prompt needed - responds to @claude mentions ``` ### Automation Mode (Agent Mode) Automatically activated when you provide a `prompt` input. - **Triggers**: Any GitHub event when `prompt` input is provided - **Features**: Direct execution without requiring @claude mentions, streamlined for automation - **Use case**: Automated PR reviews, scheduled tasks, workflow automation ```yaml - uses: anthropics/claude-code-action@v1 with: anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }} prompt: | Check for outdated dependencies and create an issue if any are found. # Automatically runs in agent mode when prompt is provided ``` ### How It Works The action uses this logic to determine the mode: 1. **If `prompt` is provided** → Runs in **agent mode** for automation 2. **If no `prompt` but @claude is mentioned** → Runs in **tag mode** for interaction 3. **If neither** → No action is taken This automatic detection ensures your workflows are simpler and more intuitive, without needing to understand or configure different modes. ### Advanced Mode Control For specialized use cases, you can fine-tune behavior using `claude_args`: ```yaml - uses: anthropics/claude-code-action@v1 with: prompt: "Review this PR" claude_args: | --max-turns 20 --system-prompt "You are a code review specialist" anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }} ``` ## Network Restrictions For enhanced security, you can restrict Claude's network access to specific domains only. This feature is particularly useful for: - Enterprise environments with strict security policies - Preventing access to external services - Limiting Claude to only your internal APIs and services When `experimental_allowed_domains` is set, Claude can only access the domains you explicitly list. You'll need to include the appropriate provider domains based on your authentication method. ### Provider-Specific Examples #### If using Anthropic API or subscription ```yaml - uses: anthropics/claude-code-action@v1 with: anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }} # Or: claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }} experimental_allowed_domains: | .anthropic.com ``` #### If using AWS Bedrock ```yaml - uses: anthropics/claude-code-action@v1 with: use_bedrock: "true" experimental_allowed_domains: | bedrock.*.amazonaws.com bedrock-runtime.*.amazonaws.com ``` #### If using Google Vertex AI ```yaml - uses: anthropics/claude-code-action@v1 with: use_vertex: "true" experimental_allowed_domains: | *.googleapis.com vertexai.googleapis.com ``` ### Common GitHub Domains In addition to your provider domains, you may need to include GitHub-related domains. For GitHub.com users, common domains include: ```yaml - uses: anthropics/claude-code-action@v1 with: anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }} experimental_allowed_domains: | .anthropic.com # For Anthropic API .github.com .githubusercontent.com ghcr.io .blob.core.windows.net ``` For GitHub Enterprise users, replace the GitHub.com domains above with your enterprise domains (e.g., `.github.company.com`, `packages.company.com`, etc.). To determine which domains your workflow needs, you can temporarily run without restrictions and monitor the network requests, or check your GitHub Enterprise configuration for the specific services you use.