> ## Documentation Index
> Fetch the complete documentation index at: https://tempolabsinc.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Claude Code Integration

> Connect your Tempo project to Claude Code for enhanced AI-powered coding assistance

<Info>
  Pre-requisites

  * A Tempo Project
  * Either a Max subscription (recommended) or Anthropic API key
  * Access to Tempo's built-in terminal (Claude Code is pre-installed)
</Info>

Claude Code integration brings Anthropic's powerful coding assistant directly into your Tempo workspace, enabling advanced file editing, code generation, and project management capabilities.

## Connection Methods

There are two ways to connect Claude Code with your Tempo project:

<CardGroup cols={2}>
  <Card title="Max Subscription" icon="crown" href="#max-subscription-recommended">
    Recommended method using OAuth authentication
  </Card>

  <Card title="Anthropic API" icon="key" href="#anthropic-api-method">
    Direct API integration using your Anthropic API key
  </Card>
</CardGroup>

***

## Max Subscription (Recommended)

The Max subscription method provides seamless OAuth authentication and is the preferred way to connect Claude Code.

### Step 1: Open a new Terminal in Tempo

<Check>
  Claude Code comes pre-installed on all Tempo canvases! No local installation required.
</Check>

Claude Code is pre-installed on all Tempo canvases, so you don't need to install anything locally.

1. Open a new terminal in your Tempo workspace
2. Verify Claude Code is available by running:

```bash theme={null}
which claude
```

This should return the path to Claude Code (e.g., `/usr/local/bin/claude`)

<img src="https://mintcdn.com/tempolabsinc/i1Kb0DqyxUCv-eMh/Claude%20Code/cc_create_new_terminal.png?fit=max&auto=format&n=i1Kb0DqyxUCv-eMh&q=85&s=144256b818c2a1ad4b227df396c41301" alt="Create New Terminal in Tempo" width="1194" height="198" data-path="Claude Code/cc_create_new_terminal.png" />

<img src="https://mintcdn.com/tempolabsinc/i1Kb0DqyxUCv-eMh/Claude%20Code/cc_check_claude_installation.png?fit=max&auto=format&n=i1Kb0DqyxUCv-eMh&q=85&s=7079822a117016480259edced0d4de6b" alt="Check Claude Installation" width="1190" height="268" data-path="Claude Code/cc_check_claude_installation.png" />

### Step 2: Setup Authentication Token

In the same Tempo terminal, run the setup command:

```bash theme={null}
claude setup-token
```

This command will:

* Open a browser window for authentication
* Redirect you to the Anthropic authorization page

### Step 3: Authorize Access

1. Click **Authorize** in the browser window that opens
2. Complete the OAuth flow in your browser
3. Return to your terminal - you'll see the authentication token displayed

<img src="https://mintcdn.com/tempolabsinc/iX4kZXfCVK7SaSNC/Claude%20Code/cc_max_setup_authorize.png?fit=max&auto=format&n=iX4kZXfCVK7SaSNC&q=85&s=e3501af13c83d36e0a1a537d5e5d3c87" alt="Claude Code Max Authorize" width="1550" height="1440" data-path="Claude Code/cc_max_setup_authorize.png" />

<img src="https://mintcdn.com/tempolabsinc/iX4kZXfCVK7SaSNC/Claude%20Code/cc_max_setup_cli.png?fit=max&auto=format&n=iX4kZXfCVK7SaSNC&q=85&s=4b13120e92828faca82a17938e0f8c06" alt="Claude Code Max Setup" width="1964" height="1092" data-path="Claude Code/cc_max_setup_cli.png" />

### Step 4: Configure Tempo Environment

1. Copy the token from your terminal
2. Open your Tempo project
3. Navigate to **Project Settings**
4. Add a new environment variable:
   * **Name**: `CLAUDE_CODE_OAUTH_TOKEN`
   * **Value**: \[Paste the copied token]

<img src="https://mintcdn.com/tempolabsinc/iX4kZXfCVK7SaSNC/Claude%20Code/cc_max_setup_env_var.png?fit=max&auto=format&n=iX4kZXfCVK7SaSNC&q=85&s=ca7fb54476c6147087d2207f21761b26" alt="Claude Code Max Setup Env variables on Tempo" width="1348" height="1386" data-path="Claude Code/cc_max_setup_env_var.png" />

<Check>
  Your Claude Code integration is now active! All the changes made using `Claude Code` model from Tempo will now use your Max subscription.
</Check>

***

## Anthropic API Method

If you prefer to use your own Anthropic API key, you can connect Claude Code directly through the API.

### Step 1: Get Your Anthropic API Key

1. Visit the [Claude Console](https://console.anthropic.com/)
2. Navigate to **API Keys** section from the Sidebar
3. Create a new API key or copy an existing one
4. Ensure your account has available credits (check the Billing section)

<img src="https://mintcdn.com/tempolabsinc/iX4kZXfCVK7SaSNC/Claude%20Code/cc_anthropic_console_api_key.png?fit=max&auto=format&n=iX4kZXfCVK7SaSNC&q=85&s=7626003389b7e52b50079ff43add6659" alt="Claude Code Setup Using Anthropic Console" width="3006" height="1286" data-path="Claude Code/cc_anthropic_console_api_key.png" />

<Info>
  Your Anthropic account must be funded with credits for the API key to work. Check your usage and billing status in the console before proceeding.
</Info>

For detailed instructions, refer to the [Anthropic SDK documentation](https://docs.anthropic.com/en/docs/claude-code/sdk/sdk-overview#authentication).

### Step 2: Configure Environment Variable

1. Open your Tempo project
2. Navigate to **Project Settings**
3. Add a new environment variable:
   * **Name**: `ANTHROPIC_API_KEY`
   * **Value**: \[Your Anthropic API key]

<img src="https://mintcdn.com/tempolabsinc/iX4kZXfCVK7SaSNC/Claude%20Code/cc_anthropic_console_env_var.png?fit=max&auto=format&n=iX4kZXfCVK7SaSNC&q=85&s=74833adc2be3e91bf5255d9db6436bd6" alt="Tempo Anthropic API Key Environment Variables Settings" width="1212" height="1266" data-path="Claude Code/cc_anthropic_console_env_var.png" />

<Warning>
  Keep your API key secure and never commit it to version control. Tempo automatically encrypts and secures your environment variables.
</Warning>

***

## Using Claude Code in Tempo

Claude Code is always visible as a model option in your AI chat interface. However, it requires proper authentication to function.

<Warning>
  If you haven't configured authentication (either OAuth token or API key), selecting Claude Code will result in an error message. You must complete one of the authentication methods above before Claude Code will work.
</Warning>

### Features

<AccordionGroup>
  <Accordion title="Advanced File Editing">
    Claude Code can read, edit, and create files across your entire project with precise context awareness.
  </Accordion>

  <Accordion title="Project-Wide Understanding">
    Unlike regular models, Claude Code maintains awareness of your complete project structure and dependencies.
  </Accordion>

  <Accordion title="Tool Integration">
    Access to specialized tools for terminal commands, file operations, and project management.
  </Accordion>

  <Accordion title="Real-time Collaboration">
    Changes made by Claude Code are immediately reflected in your Tempo workspace.
  </Accordion>
</AccordionGroup>

### Model Switching

* **Selecting Claude Code**: Automatically switches to the latest Claude Code conversation
* **Switching to Regular Models**: Automatically enables MAX mode and switches to your latest regular conversation

***

## Troubleshooting

<AccordionGroup>
  <Accordion title="Token Authentication Failed">
    If authentication fails:

    1. Run `claude setup-token` again in the Tempo terminal
    2. Ensure you complete the full OAuth flow in the browser
    3. Check that the token was copied correctly to Tempo settings
    4. Make sure you're using the Tempo terminal (not your local terminal)
  </Accordion>

  <Accordion title="Claude Code Shows Error When Selected">
    Claude Code is always visible in the model dropdown, but will fail if not authenticated:

    1. Verify you've set either `CLAUDE_CODE_OAUTH_TOKEN` or `ANTHROPIC_API_KEY`
    2. Check that the environment variable values are correct
    3. For Max subscription, ensure your subscription is active
    4. For API key, verify it's valid in the Anthropic Console
  </Accordion>

  <Accordion title="API Key Issues">
    For Anthropic API method:

    1. Verify your API key is valid in the Anthropic Console
    2. **Check that your account is funded** - API keys won't work without available credits
    3. Ensure the environment variable is named `ANTHROPIC_API_KEY`
    4. Review your API usage limits and billing status in the console
  </Accordion>
</AccordionGroup>

***

## Next Steps

1. **Test the Integration**: Select Claude Code from the model dropdown and try a simple file edit
2. **Explore Advanced Features**: Ask Claude Code to analyze your project structure or suggest improvements
3. **Combine with Other Tools**: Use Claude Code alongside Tempo's other AI models for comprehensive development assistance

<Check>
  You're all set! Claude Code is now integrated with your Tempo project and ready to supercharge your development workflow.
</Check>
