|
| 1 | +--- |
| 2 | +title: "Claude Code" |
| 3 | +sidebarTitle: "Claude Code" |
| 4 | +icon: "code" |
| 5 | +--- |
| 6 | + |
| 7 | +Claude Code is an enhanced agent implementation that leverages Anthropic's Claude Code SDK to provide superior coding capabilities. When enabled, your Codegen agents run within the Claude Code harness by default, offering improved code understanding, generation, and debugging capabilities. |
| 8 | + |
| 9 | +## What is Claude Code? |
| 10 | + |
| 11 | +Claude Code is Anthropic's specialized coding environment that provides: |
| 12 | + |
| 13 | +- **Enhanced Code Understanding**: Better comprehension of complex codebases and architectural patterns |
| 14 | +- **Advanced Tool Integration**: Seamless integration with development tools through MCP (Model Context Protocol) |
| 15 | +- **Improved Code Generation**: More accurate and contextually appropriate code suggestions |
| 16 | +- **Better Error Handling**: Enhanced debugging and error resolution capabilities |
| 17 | +- **Validation Hooks**: Built-in validation to ensure proper tool usage and workflow completion |
| 18 | + |
| 19 | +## Enabling Claude Code |
| 20 | + |
| 21 | +Claude Code can be enabled at the organization level through your model configuration settings: |
| 22 | + |
| 23 | +1. Navigate to [**codegen.com/settings/model**](https://codegen.com/settings/model) |
| 24 | +2. Locate the "Claude Code Mode" section |
| 25 | +3. Toggle the setting to "Enabled" |
| 26 | +4. Select your preferred Claude Code model (typically Claude 4 Sonnet) |
| 27 | + |
| 28 | +<Frame caption="Claude Code configuration in model settings"> |
| 29 | + <img src="/images/claude-code-settings.png" alt="Claude Code Settings UI" /> |
| 30 | +</Frame> |
| 31 | + |
| 32 | +## How It Works |
| 33 | + |
| 34 | +When Claude Code is enabled, Codegen automatically: |
| 35 | + |
| 36 | +1. **Agent Selection**: Uses the Claude Code agent implementation instead of the default LangGraph agent |
| 37 | +2. **Tool Integration**: Provides access to all Codegen tools through MCP (Model Context Protocol) |
| 38 | +3. **Sandbox Environment**: Runs within a specialized Modal sandbox with Claude Code SDK |
| 39 | +4. **Validation**: Applies configurable hooks to ensure proper workflow completion |
| 40 | + |
| 41 | +## Key Features |
| 42 | + |
| 43 | +### MCP Integration |
| 44 | + |
| 45 | +Claude Code agents automatically use MCP (Model Context Protocol) for tool integration, providing: |
| 46 | + |
| 47 | +- Standardized tool interfaces |
| 48 | +- Better error handling and validation |
| 49 | +- Consistent tool behavior across different environments |
| 50 | +- Enhanced debugging capabilities |
| 51 | + |
| 52 | +### Validation Hooks |
| 53 | + |
| 54 | +Claude Code supports validation hooks that ensure agents complete required actions: |
| 55 | + |
| 56 | +- **Message Validation**: Ensures agents send appropriate messages before completing tasks |
| 57 | +- **PR Creation Validation**: Verifies that pull requests are created when required |
| 58 | +- **Custom Validations**: Organization-specific validation rules can be configured |
| 59 | + |
| 60 | +### Enhanced Capabilities |
| 61 | + |
| 62 | +- **Better Code Analysis**: Improved understanding of code structure and dependencies |
| 63 | +- **Contextual Awareness**: Better retention of conversation context across long interactions |
| 64 | +- **Tool Coordination**: More effective coordination between different development tools |
| 65 | +- **Error Recovery**: Enhanced ability to recover from and resolve errors |
| 66 | + |
| 67 | +## Supported Channels |
| 68 | + |
| 69 | +Claude Code is available across all Codegen integration channels: |
| 70 | + |
| 71 | +- **Slack**: Enhanced responses and code assistance in Slack channels |
| 72 | +- **GitHub**: Improved PR reviews, issue resolution, and code suggestions |
| 73 | +- **API**: Full Claude Code capabilities available through the Codegen API |
| 74 | +- **Linear**: Better integration with Linear workflows and issue management |
| 75 | + |
| 76 | +## Model Selection |
| 77 | + |
| 78 | +When Claude Code is enabled, you can choose from available Claude models: |
| 79 | + |
| 80 | +- **Claude 4 Sonnet** (Recommended): Best balance of performance and cost |
| 81 | +- **Claude 4 Opus**: Maximum capability for complex tasks |
| 82 | +- **Claude 4 Haiku**: Faster responses for simpler tasks |
| 83 | + |
| 84 | +<Tip> |
| 85 | + Claude 4 Sonnet is recommended for most use cases as it provides excellent |
| 86 | + performance while maintaining cost efficiency. Our prompts and workflows are |
| 87 | + optimized for this model. |
| 88 | +</Tip> |
| 89 | + |
| 90 | +## User Preferences |
| 91 | + |
| 92 | +Individual users can override the organization-wide Claude Code setting through their personal preferences, allowing for: |
| 93 | + |
| 94 | +- **Per-user enablement**: Users can opt into Claude Code even if not enabled organization-wide |
| 95 | +- **Per-user disabling**: Users can opt out of Claude Code if they prefer the standard agent |
| 96 | +- **Flexible adoption**: Teams can gradually adopt Claude Code at their own pace |
| 97 | + |
| 98 | +## Best Practices |
| 99 | + |
| 100 | +### When to Use Claude Code |
| 101 | + |
| 102 | +Claude Code is particularly effective for: |
| 103 | + |
| 104 | +- **Complex Refactoring**: Large-scale code changes and architectural improvements |
| 105 | +- **Debugging**: Investigating and resolving complex bugs |
| 106 | +- **Code Reviews**: Comprehensive analysis of pull requests |
| 107 | +- **Documentation**: Generating and updating technical documentation |
| 108 | +- **Integration Work**: Connecting different systems and APIs |
| 109 | + |
| 110 | +### Configuration Tips |
| 111 | + |
| 112 | +- **Start with Organization-wide**: Enable Claude Code at the organization level for consistent experience |
| 113 | +- **Monitor Performance**: Track agent performance and user feedback during initial rollout |
| 114 | +- **Customize Validations**: Configure validation hooks based on your team's workflow requirements |
| 115 | +- **Model Selection**: Use Claude 4 Sonnet unless you have specific needs for other models |
| 116 | + |
| 117 | +## Troubleshooting |
| 118 | + |
| 119 | +### Common Issues |
| 120 | + |
| 121 | +**Claude Code not activating:** |
| 122 | +- Verify the setting is enabled in organization model configuration |
| 123 | +- Check that feature flags are properly configured for your organization |
| 124 | +- Ensure users have the appropriate permissions |
| 125 | + |
| 126 | +**Tool integration problems:** |
| 127 | +- MCP integration is automatic with Claude Code - no additional configuration needed |
| 128 | +- Check sandbox logs for any MCP server startup issues |
| 129 | +- Verify that required tools are available in your organization's configuration |
| 130 | + |
| 131 | +**Performance concerns:** |
| 132 | +- Claude Code may have slightly different response times compared to standard agents |
| 133 | +- Monitor usage patterns and adjust model selection if needed |
| 134 | +- Consider user preferences for performance-sensitive workflows |
| 135 | + |
| 136 | +### Getting Help |
| 137 | + |
| 138 | +If you encounter issues with Claude Code: |
| 139 | + |
| 140 | +1. Check the agent run logs for detailed error information |
| 141 | +2. Verify your organization's model configuration settings |
| 142 | +3. Contact support with specific error messages and agent run IDs |
| 143 | + |
| 144 | +<Note> |
| 145 | + Claude Code is a premium feature that may require specific plan levels or |
| 146 | + feature flag enablement. Contact your Codegen representative if you don't |
| 147 | + see the Claude Code options in your settings. |
| 148 | +</Note> |
| 149 | + |
| 150 | +## Migration from Standard Agents |
| 151 | + |
| 152 | +Switching to Claude Code is seamless: |
| 153 | + |
| 154 | +- **No workflow changes**: Existing integrations and workflows continue to work |
| 155 | +- **Same tool access**: All existing Codegen tools remain available |
| 156 | +- **Backward compatibility**: Can switch back to standard agents at any time |
| 157 | +- **Gradual rollout**: Enable for specific users or channels as needed |
| 158 | + |
| 159 | +The transition to Claude Code enhances your existing Codegen experience without requiring changes to how you interact with the platform. |
0 commit comments