|
| 1 | +--- |
| 2 | +title: "Claude Code Integration" |
| 3 | +sidebarTitle: "Claude Code" |
| 4 | +icon: "code" |
| 5 | +--- |
| 6 | + |
| 7 | +Claude Code brings the power of Anthropic's coding assistant directly into your development workflow through Codegen. Whether you're running Claude locally or in the cloud, Codegen provides the infrastructure to enhance your AI coding experience with telemetry, integrations, and seamless deployment options. |
| 8 | + |
| 9 | +<Frame> |
| 10 | + <video |
| 11 | + controls |
| 12 | + src="https://res.cloudinary.com/dbikr6pew/video/upload/v1757996504/Claude_Code_Integration_coe5sm.mp4" |
| 13 | + className="aspect-[3340/2160]" |
| 14 | + /> |
| 15 | +</Frame> |
| 16 | + |
| 17 | +## Cloud Logging for Local Sessions |
| 18 | + |
| 19 | +Every local Claude Code session is automatically logged to the cloud through the Codegen CLI. This seamless integration means your local development gains enterprise-grade observability without any extra configuration. |
| 20 | + |
| 21 | +When you run Claude through `codegen`, you get: |
| 22 | + |
| 23 | +- **Persistent history** across all your local Claude sessions |
| 24 | +- **Searchable conversations** accessible from any device |
| 25 | +- **Team visibility** into AI-assisted development patterns |
| 26 | +- **Audit trails** for compliance and debugging |
| 27 | + |
| 28 | +<Note> |
| 29 | + Sessions appear instantly at [codegen.com/agents](https://codegen.com/agents), |
| 30 | + making it easy to share context with teammates or continue work from another |
| 31 | + machine. |
| 32 | +</Note> |
| 33 | + |
| 34 | +## MCP Server Integration |
| 35 | + |
| 36 | +Claude Code running through Codegen automatically gains access to all your connected integrations via MCP (Model Context Protocol). This transforms Claude from a coding assistant into a full development platform orchestrator. |
| 37 | + |
| 38 | +Your existing Codegen integrations work seamlessly: |
| 39 | + |
| 40 | +- **Slack** - Send updates and coordinate with your team |
| 41 | +- **Linear/Jira** - Update tickets and track progress |
| 42 | +- **GitHub** - Create PRs and manage repositories |
| 43 | +- **Databases** - Query and modify data safely |
| 44 | +- **Custom tools** - Any MCP server you've configured |
| 45 | + |
| 46 | +No additional setup required - if it's connected to Codegen, Claude can use it. |
| 47 | + |
| 48 | +<Tip> |
| 49 | + MCP integration means Claude can perform complex workflows like "When tests |
| 50 | + fail, create a Linear ticket and notify the team on Slack" - all in a single |
| 51 | + command. |
| 52 | +</Tip> |
| 53 | + |
| 54 | +## Background Terminal Agents |
| 55 | + |
| 56 | +Keep your terminal free while Claude handles long-running tasks. Background agents run asynchronously, perfect for automation that doesn't need constant supervision. |
| 57 | + |
| 58 | +```bash |
| 59 | +# Start a background agent to handle PR reviews |
| 60 | +codegen agent create --background "Review all open PRs and suggest improvements" |
| 61 | + |
| 62 | +# Continue working while the agent runs |
| 63 | +# Check status anytime at codegen.com/agents |
| 64 | +``` |
| 65 | + |
| 66 | +Common use cases for background agents: |
| 67 | + |
| 68 | +- Automated code reviews on new PRs |
| 69 | +- Continuous monitoring of test suites |
| 70 | +- Documentation generation from code changes |
| 71 | +- Dependency updates and security patches |
| 72 | + |
| 73 | +<Note> |
| 74 | + Background agents support scheduling with flags like `--repeat-daily` or |
| 75 | + `--repeat-weekly`, turning one-off tasks into automated workflows. |
| 76 | +</Note> |
| 77 | + |
| 78 | +## Remote Sandbox Execution |
| 79 | + |
| 80 | +Configure Claude Code as your default agent to run in Codegen's secure cloud sandboxes. This provides consistent, scalable environments for all your AI-assisted development. |
| 81 | + |
| 82 | +<Card |
| 83 | + title="Set Claude Code as Default" |
| 84 | + icon="toggle-on" |
| 85 | + href="https://codegen.com/settings/model" |
| 86 | +> |
| 87 | + Enable Claude Code mode to run all agents in secure sandboxes with full |
| 88 | + integration support. |
| 89 | +</Card> |
| 90 | + |
| 91 | +Remote execution benefits: |
| 92 | + |
| 93 | +- **Consistent environments** across your team |
| 94 | +- **Pre-configured tools** and dependencies |
| 95 | +- **Scalable compute** for resource-intensive tasks |
| 96 | +- **Security isolation** from your local machine |
| 97 | + |
| 98 | +## Getting Started |
| 99 | + |
| 100 | +### Local Claude with Cloud Benefits |
| 101 | + |
| 102 | +Get up and running in three simple steps: |
| 103 | + |
| 104 | +1. Install the Codegen CLI: |
| 105 | + |
| 106 | + ```bash |
| 107 | + uv tool install codegen |
| 108 | + ``` |
| 109 | + |
| 110 | +2. Authenticate with your account: |
| 111 | + |
| 112 | + ```bash |
| 113 | + codegen login |
| 114 | + ``` |
| 115 | + |
| 116 | +3. Run Claude with full telemetry: |
| 117 | + ```bash |
| 118 | + codegen claude "Help me refactor this authentication module" |
| 119 | + ``` |
| 120 | + |
| 121 | +Your session immediately appears in the cloud with full integration access. |
| 122 | + |
| 123 | +<Tip> |
| 124 | + The first time you run `codegen claude`, it will download the Claude Code |
| 125 | + binary. Subsequent runs start instantly. |
| 126 | +</Tip> |
| 127 | + |
| 128 | +### Enable Organization-Wide |
| 129 | + |
| 130 | +For teams ready to standardize on Claude Code: |
| 131 | + |
| 132 | +1. Navigate to [Model Settings](https://codegen.com/settings/model) |
| 133 | +2. Enable "Claude Code Mode" |
| 134 | +3. Select Claude 4 Sonnet (recommended) |
| 135 | +4. All agents now run with Claude Code capabilities |
| 136 | + |
| 137 | +## Real-World Workflows |
| 138 | + |
| 139 | +### Continuous PR Monitoring |
| 140 | + |
| 141 | +Set up automated review cycles that run in the background: |
| 142 | + |
| 143 | +```bash |
| 144 | +# Daily PR reviews with actionable feedback |
| 145 | +codegen agent create --background --repeat-daily \ |
| 146 | + "Review new PRs in myrepo and suggest improvements" |
| 147 | +``` |
| 148 | + |
| 149 | +The agent runs daily, reviewing PRs and posting suggestions directly to GitHub. |
| 150 | + |
| 151 | +### Local Development with Team Visibility |
| 152 | + |
| 153 | +Perfect for pair programming or mentoring sessions: |
| 154 | + |
| 155 | +```bash |
| 156 | +# Start a traced Claude session |
| 157 | +codegen claude |
| 158 | + |
| 159 | +# Your team can follow along at codegen.com/agents |
| 160 | +# All integrations available through MCP |
| 161 | +``` |
| 162 | + |
| 163 | +Team members can observe your AI interactions in real-time, learning from your prompting patterns and problem-solving approaches. |
| 164 | + |
| 165 | +### Hybrid Workflow |
| 166 | + |
| 167 | +Start locally, deploy to cloud when ready: |
| 168 | + |
| 169 | +```bash |
| 170 | +# Prototype locally with Claude |
| 171 | +codegen claude "Build a new API endpoint for user profiles" |
| 172 | + |
| 173 | +# Happy with the approach? Deploy to sandbox |
| 174 | +codegen agent create "Implement the user profile API we discussed" |
| 175 | +``` |
| 176 | + |
| 177 | +<Note> |
| 178 | + Context from your local Claude sessions carries over to cloud agents, |
| 179 | + maintaining continuity across environments. |
| 180 | +</Note> |
| 181 | + |
| 182 | +## Advanced Configuration |
| 183 | + |
| 184 | +### Custom MCP Servers |
| 185 | + |
| 186 | +Extend Claude's capabilities with your own tools: |
| 187 | + |
| 188 | +```bash |
| 189 | +# Configure custom MCP server |
| 190 | +codegen mcp add my-tool https://my-mcp-server.com |
| 191 | + |
| 192 | +# Now available in all Claude sessions |
| 193 | +codegen claude "Use my-tool to generate test data" |
| 194 | +``` |
| 195 | + |
| 196 | +### Session Management |
| 197 | + |
| 198 | +Powerful commands for working with Claude sessions: |
| 199 | + |
| 200 | +```bash |
| 201 | +# List recent sessions |
| 202 | +codegen sessions list |
| 203 | + |
| 204 | +# Resume a previous session |
| 205 | +codegen sessions resume <session-id> |
| 206 | + |
| 207 | +# Export session for sharing |
| 208 | +codegen sessions export <session-id> > session.md |
| 209 | +``` |
| 210 | + |
| 211 | +## Best Practices |
| 212 | + |
| 213 | +### When to Run Locally vs Remote |
| 214 | + |
| 215 | +**Run locally when:** |
| 216 | + |
| 217 | +- Prototyping and experimenting |
| 218 | +- Working with sensitive code |
| 219 | +- Need immediate feedback |
| 220 | +- Debugging specific issues |
| 221 | + |
| 222 | +**Run in sandboxes when:** |
| 223 | + |
| 224 | +- Executing long-running tasks |
| 225 | +- Need consistent environments |
| 226 | +- Collaborating with team |
| 227 | +- Running automated workflows |
| 228 | + |
| 229 | +### Effective Background Agents |
| 230 | + |
| 231 | +Keep background agents focused: |
| 232 | + |
| 233 | +- Single responsibility per agent |
| 234 | +- Clear success criteria |
| 235 | +- Reasonable time bounds |
| 236 | +- Proper error handling |
| 237 | + |
| 238 | +<Tip> |
| 239 | + Use descriptive names for background agents - they appear in your dashboard |
| 240 | + and help teammates understand what's running. |
| 241 | +</Tip> |
| 242 | + |
| 243 | +### Integration Patterns |
| 244 | + |
| 245 | +Leverage MCP for complex workflows: |
| 246 | + |
| 247 | +```bash |
| 248 | +# Agent that coordinates across tools |
| 249 | +codegen agent create "When tests fail on PR #123, \ |
| 250 | + create a Linear ticket and notify #eng-team on Slack" |
| 251 | +``` |
| 252 | + |
| 253 | +## Monitoring and Debugging |
| 254 | + |
| 255 | +All Claude Code sessions include comprehensive telemetry: |
| 256 | + |
| 257 | +- **Execution traces** showing every tool invocation |
| 258 | +- **Token usage** per request and response |
| 259 | +- **Error logs** with full stack traces |
| 260 | +- **Performance metrics** for optimization |
| 261 | + |
| 262 | +Access logs at [codegen.com/agents](https://codegen.com/agents) or via CLI: |
| 263 | + |
| 264 | +```bash |
| 265 | +# View recent agent runs |
| 266 | +codegen agents list |
| 267 | + |
| 268 | +# Stream logs for active agent |
| 269 | +codegen agents logs <agent-id> --follow |
| 270 | +``` |
| 271 | + |
| 272 | +<Note> |
| 273 | + Logs are retained for 30 days and can be exported for compliance or analysis |
| 274 | + purposes. |
| 275 | +</Note> |
| 276 | + |
| 277 | +## Analytics and Insights |
| 278 | + |
| 279 | +Transform your Claude Code usage into actionable intelligence. The analytics dashboard provides deep insights into how AI is transforming your development workflow. |
| 280 | + |
| 281 | +Track key metrics: |
| 282 | + |
| 283 | +- **Token usage** to understand costs and optimize prompts |
| 284 | +- **Task completion rates** and success patterns |
| 285 | +- **Integration usage** showing which tools Claude uses most |
| 286 | +- **Team adoption** identifying power users and best practices |
| 287 | + |
| 288 | +Access detailed analytics at [codegen.com/analytics](https://codegen.com/analytics). |
| 289 | + |
| 290 | +<Tip> |
| 291 | + Use analytics to identify repetitive tasks that could be automated with |
| 292 | + background agents, maximizing your team's productivity gains. |
| 293 | +</Tip> |
| 294 | + |
| 295 | +## What's Next |
| 296 | + |
| 297 | +Claude Code integration is just the beginning. We're actively working on: |
| 298 | + |
| 299 | +- OpenAI Codex support for GPT-4 workflows |
| 300 | +- Gemini CLI integration for Google's models |
| 301 | +- Enhanced MCP protocol features |
| 302 | +- Custom model deployment options |
| 303 | + |
| 304 | +Join our [community Slack](https://community.codegen.com) to stay updated and share your Claude Code workflows with other developers. |
0 commit comments