> ## Documentation Index
> Fetch the complete documentation index at: https://codegeninc-codegen-bot-update-claude-code-docs-use-cases-17.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Claude Code Integration

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.

<Note>
  For comprehensive Claude Code documentation, visit the [official Claude Code docs](https://docs.claude.com/en/docs/claude-code/overview).
</Note>

<Frame>
  <video controls src="https://res.cloudinary.com/dbikr6pew/video/upload/v1757996504/Claude_Code_Integration_coe5sm.mp4" className="aspect-[3340/2160]" />
</Frame>

## Common Use Cases

Claude Code excels at a wide range of development tasks. Here are some of the most popular workflows:

### Code Understanding & Exploration

* **Understand new codebases** - Get quick overviews of unfamiliar projects and their architecture
* **Find relevant code** - Locate specific functions, patterns, or implementations across large codebases
* **Trace code paths** - Follow execution flows and understand how different components interact

### Development & Refactoring

* **Refactor legacy code** - Modernize old code while preserving functionality
* **Add new features** - Implement new functionality with proper integration into existing systems
* **Fix bugs and issues** - Debug problems and implement comprehensive fixes
* **Write tests** - Generate unit tests, integration tests, and test coverage improvements

### Documentation & Maintenance

* **Generate documentation** - Create README files, API docs, and inline code comments
* **Code reviews** - Get detailed feedback on code quality, security, and best practices
* **Dependency updates** - Safely upgrade libraries and handle breaking changes
* **Performance optimization** - Identify bottlenecks and implement performance improvements

### DevOps & Automation

* **CI/CD pipeline setup** - Configure GitHub Actions, GitLab CI, and other automation
* **Infrastructure as code** - Write and maintain Terraform, Docker, and Kubernetes configurations
* **Deployment scripts** - Create reliable deployment and rollback procedures

<Tip>
  Claude Code understands your entire codebase context, making it particularly effective for complex, multi-file changes that require understanding relationships between different parts of your system.
</Tip>

## Cloud Logging for Local Sessions

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.

When you run Claude through `codegen`, you get:

* **Persistent history** across all your local Claude sessions
* **Searchable conversations** accessible from any device
* **Team visibility** into AI-assisted development patterns
* **Audit trails** for compliance and debugging

<Note>
  Sessions appear instantly at [codegen.com/agents](https://codegen.com/agents),
  making it easy to share context with teammates or continue work from another
  machine.
</Note>

## Connect Claude Code to Codegen Tools

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.

Your existing Codegen integrations work seamlessly:

* **Slack** - Send updates and coordinate with your team
* **Linear/Jira** - Update tickets and track progress
* **GitHub** - Create PRs and manage repositories
* **Databases** - Query and modify data safely
* **Custom tools** - Any MCP server you've configured

No additional setup required - if it's connected to Codegen, Claude can use it.

<Tip>
  MCP integration means Claude can perform complex workflows like "When tests
  fail, create a Linear ticket and notify the team on Slack" - all in a single
  command.
</Tip>

## Run Background Agents from your Terminal

Keep your terminal free while Claude handles long-running tasks. Background agents run asynchronously, perfect for automation that doesn't need constant supervision.

## Remote Sandbox Execution

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.

<Card title="Set Claude Code as Default" icon="toggle-on" href="https://codegen.com/settings/model">
  Enable Claude Code mode to run all agents in secure sandboxes with full
  integration support.
</Card>

Remote execution benefits:

* **Consistent environments** across your team
* **Pre-configured tools** and dependencies
* **Scalable compute** for resource-intensive tasks
* **Security isolation** from your local machine

## Getting Started

### Local Claude with Cloud Benefits

Get up and running in three simple steps:

1. Install the Codegen CLI:

   ```bash
   uv tool install codegen
   ```

2. Authenticate with your account:

   ```bash
   codegen login
   ```

3. Run Claude with full telemetry:
   ```bash
   codegen claude "Help me refactor this authentication module"
   ```

Your session immediately appears in the cloud with full integration access.

<Tip>
  To use claude with codegen, ensure you have claude installed and available on your system.
</Tip>

## Analytics and Insights

Transform your Claude Code usage into actionable intelligence. The analytics dashboard provides deep insights into how AI is transforming your development workflow.

Track key metrics:

* **Token usage** to understand costs and optimize prompts
* **Task completion rates** and success patterns
* **Integration usage** showing which tools Claude uses most
* **Team adoption** identifying power users and best practices

Access detailed analytics at [codegen.com/analytics](https://codegen.com/analytics).

<Tip>
  Use analytics to identify repetitive tasks that could be automated with
  background agents, maximizing your team's productivity gains.
</Tip>

## What's Next

Claude Code integration is just the beginning. We're actively working on:

* OpenAI Codex support for GPT-4 workflows
* Gemini CLI integration for Google's models
* Enhanced MCP protocol features
* Custom model deployment options

Join our [community Slack](https://community.codegen.com) to stay updated and share your Claude Code workflows with other developers.
