Use Claude Code on Codegen
Enable Claude Code mode in your model configuration settings to enhance agent
capabilities.
OpenAI Codex and Gemini CLI support are coming soon.
What is Claude Code?
Claude Code is Anthropic’s specialized coding environment that provides:- Enhanced Code Understanding: Better comprehension of complex codebases and architectural patterns
- Advanced Tool Integration: Seamless integration with development tools through MCP (Model Context Protocol)
- Improved Code Generation: More accurate and contextually appropriate code suggestions
- Better Error Handling: Enhanced debugging and error resolution capabilities
- Validation Hooks: Built-in validation to ensure proper tool usage and workflow completion
Enabling Claude Code
Claude Code can be enabled at the organization level through your model configuration settings:- Navigate to codegen.com/settings/model
- Locate the “Claude Code Mode” section
- Toggle the setting to “Enabled”
- Select your preferred Claude Code model (typically Claude 4 Sonnet)
How It Works
When Claude Code is enabled, Codegen automatically:- Sandbox Execution: Runs Claude Code in a secure sandbox environment for safe code execution and testing
- MCP Integration: Provides access to all your integrations through MCP (Model Context Protocol) for seamless tool coordination
- Enhanced Logging: Captures detailed logs using Claude Code hooks, which are displayed in the agent UI on codegen.com for full transparency and debugging
- Full Feature Compatibility: Manages interactions with Slack, Linear, and other project management tools, while maintaining the complete PR lifecycle including automatic check fixing and code reviews
Key Features
MCP Integration
Claude Code agents automatically use MCP (Model Context Protocol) for tool integration, providing:- Standardized tool interfaces
- Better error handling and validation
- Consistent tool behavior across different environments
- Enhanced debugging capabilities
Validation Hooks
Claude Code supports validation hooks that ensure agents complete required actions:- Message Validation: Ensures agents send appropriate messages before completing tasks
- PR Creation Validation: Verifies that pull requests are created when required
- Custom Validations: Organization-specific validation rules can be configured
Enhanced Capabilities
- Better Code Analysis: Improved understanding of code structure and dependencies
- Contextual Awareness: Better retention of conversation context across long interactions
- Tool Coordination: More effective coordination between different development tools
- Error Recovery: Enhanced ability to recover from and resolve errors
Supported Channels
Claude Code is available across all Codegen integration channels:- Slack: Enhanced responses and code assistance in Slack channels
- GitHub: Improved PR reviews, issue resolution, and code suggestions
- API: Full Claude Code capabilities available through the Codegen API
- Linear: Better integration with Linear workflows and issue management
Model Selection
When Claude Code is enabled, you can choose from available Claude models:- Claude 4 Sonnet (Recommended): Best balance of performance and cost
- Claude 4 Opus: Maximum capability for complex tasks
- Claude 4 Haiku: Faster responses for simpler tasks
Claude 4 Sonnet is recommended for most use cases as it provides excellent
performance while maintaining cost efficiency. Our prompts and workflows are
optimized for this model.
User Preferences
Individual users can override the organization-wide Claude Code setting through their personal preferences, allowing for:- Per-user enablement: Users can opt into Claude Code even if not enabled organization-wide
- Per-user disabling: Users can opt out of Claude Code if they prefer the standard agent
- Flexible adoption: Teams can gradually adopt Claude Code at their own pace
Best Practices
When to Use Claude Code
Claude Code is particularly effective for:- Complex Refactoring: Large-scale code changes and architectural improvements
- Debugging: Investigating and resolving complex bugs
- Code Reviews: Comprehensive analysis of pull requests
- Documentation: Generating and updating technical documentation
- Integration Work: Connecting different systems and APIs
Configuration Tips
- Start with Organization-wide: Enable Claude Code at the organization level for consistent experience
- Monitor Performance: Track agent performance and user feedback during initial rollout
- Customize Validations: Configure validation hooks based on your team’s workflow requirements
- Model Selection: Use Claude 4 Sonnet unless you have specific needs for other models
Troubleshooting
Common Issues
Claude Code not activating:- Verify the setting is enabled in organization model configuration
- Check that feature flags are properly configured for your organization
- Ensure users have the appropriate permissions
- MCP integration is automatic with Claude Code - no additional configuration needed
- Check sandbox logs for any MCP server startup issues
- Verify that required tools are available in your organization’s configuration
- Claude Code may have slightly different response times compared to standard agents
- Monitor usage patterns and adjust model selection if needed
- Consider user preferences for performance-sensitive workflows
Getting Help
If you encounter issues with Claude Code:- Check the agent run logs for detailed error information
- Verify your organization’s model configuration settings
- Contact support with specific error messages and agent run IDs
Claude Code is a premium feature that may require specific plan levels or
feature flag enablement. Contact your Codegen representative if you don’t see
the Claude Code options in your settings.
Migration from Standard Agents
Switching to Claude Code is seamless:- No workflow changes: Existing integrations and workflows continue to work
- Same tool access: All existing Codegen tools remain available
- Backward compatibility: Can switch back to standard agents at any time
- Gradual rollout: Enable for specific users or channels as needed