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

# Overview

> Learn how to use Alex Sidebar's chat for code assistance

Alex Sidebar's chat feature enables code discussions and improvements in Xcode running on the side. By prompting your queries, you can assist your coding process and resolve issues more quickly.

## Quick Actions

<CardGroup cols={2}>
  <Card title="Build & Fix Errors" icon="hammer">
    Click this button in the main view to automatically build your project and fix all compilation errors in a continuous loop until success.
  </Card>

  <Card title="Command + L" icon="message-bot">
    Select code in Xcode to start a **new chat**. The selected content will automatically be added as a reference.
  </Card>

  <Card title="Command + Shift + L" icon="plus">
    Add selected code to your existing chat without opening a new window. Perfect for building context incrementally.
  </Card>

  <Card title="Command + Enter" icon="code">
    Start a chat with entire codebase as context. Useful for high-level questions
    about your project.
  </Card>

  <Card title="@ Commands" icon="at" href="/commands">
    Access documentation, add more files and more using the @ menu in your chat.
  </Card>

  <Card title="Image Support" icon="image" href="/image-to-code">
    Copy-paste or drag images directly into chat for design analysis and code generation. Perfect for UI discussions and visual debugging.
  </Card>
</CardGroup>

## Copy Request Button

Perfect for using the most powerful models like o3 Pro or models with massive context windows like Gemini 2.5 Pro (1M+ tokens).

<video autoPlay muted loop playsInline src="https://mintcdn.com/alex/zS4a0pdjtofRLVUw/videos/copy-request.mp4?fit=max&auto=format&n=zS4a0pdjtofRLVUw&q=85&s=1c1373a5668998084ecab64d81629958" alt="Demonstration of using Copy Request button to export chat context" title="Copy Request Button Demo" data-path="videos/copy-request.mp4" />

The Copy Request button lets you export your code context to use with external AI services:

<Steps>
  <Step title="Find the Copy Button">
    Look for the copy icon at the bottom of any message in your chat
  </Step>

  <Step title="Click to Copy">
    Clicking copies:

    * All code context and file contents
    * Your current query
    * Formatted for easy pasting
  </Step>

  <Step title="Use with Any AI Service">
    Paste the copied content into:

    * **ChatGPT o3-pro** - For the most powerful reasoning
    * **Google AI Studio** - For Gemini 2.5 Pro with 1M+ token context
  </Step>
</Steps>

## Getting Started

<Steps>
  <Step title="Select Code">
    In Xcode's editor window, highlight the code you want to discuss or improve.

    <Note>
      Providing relevant code context helps the AI better understand your
      question and provide more accurate responses.
    </Note>
  </Step>

  <Step title="Start Chat">
    Select code and press **Command + L** to start a chat.

    <video autoPlay muted loop playsInline src="https://mintcdn.com/alex/zS4a0pdjtofRLVUw/videos/start-new-chat.mp4?fit=max&auto=format&n=zS4a0pdjtofRLVUw&q=85&s=edb475e980d7d544789e4da824640fc5" alt="Demonstration of starting a new chat in Alex Sidebar using Command + L and other methods" title="Alex Sidebar New Chat Creation Demo" data-path="videos/start-new-chat.mp4" />

    Additional ways to start a chat:

    * Click the chat (plus) icon in the top right of the sidebar
    * Click the **"Build & Fix Errors"** button for automatic error resolution
    * Use **Command + Enter** for a new chat with full codebase context

    <video autoPlay muted loop playsInline src="https://mintcdn.com/alex/zS4a0pdjtofRLVUw/videos/start-codebase-chat.mp4?fit=max&auto=format&n=zS4a0pdjtofRLVUw&q=85&s=480866078bcabe856a77474439f2c01c" alt="Demonstration of starting a new chat with full codebase context using Command + Enter" title="Alex Sidebar Full Codebase Chat Demo" data-path="videos/start-codebase-chat.mp4" />
  </Step>

  <Step title="Add Context">
    <Note>
      The more relevant context you provide, the more accurate and helpful the
      responses will be.
    </Note>
  </Step>
</Steps>

## Context Management

<CardGroup cols={2}>
  <Card title="History Management" icon="clock-rotate-left" href="/chat/history">
    * Chats are automatically saved
    * Access previous chats from history
    * Clear individual history
  </Card>

  <Card title="Multi-File Support" icon="folder-tree">
    * Reference multiple files in one chat
    * Generate changes for multiple files
  </Card>
</CardGroup>

## Common Use Cases

<AccordionGroup>
  <Accordion title="Code Understanding">
    * Select complex functions or blocks
    * Press **Command + L**
    * Ask for step-by-step explanations
    * Get detailed breakdowns of code behavior
  </Accordion>

  <Accordion title="Refactoring Assistance">
    * Highlight code that needs improvement
    * Start a chat with **Command + L**
    * Request refactoring suggestions
    * Apply changes directly from chat
  </Accordion>

  <Accordion title="Bug Resolution">
    * Select problematic code sections
    * Include error messages if available
    * Ask for debugging assistance
    * Get targeted solutions and fixes
  </Accordion>
</AccordionGroup>

## Applying Changes

<Card title="Apply" icon="bolt">
  * Smart and fast code diff
  * Handles both simple and complex changes
  * Chunks mode enabled by default for better handling
  * Quick Apply for instant changes without diff panel
  * Fast-forward button (⏩) for instant application
  * Perfect for all types of code modifications from quick fixes to refactoring
</Card>

## Think First Mode

The "Think First" option combines DeepSeek R1's reasoning capabilities with Claude's responses for the best possible results. When enabled:

1. DeepSeek R1 first reasons about the problem using thinking tokens
2. This analysis is then used to guide Claude's response
3. Results in more thorough and accurate solutions

<Note>
  Think First mode can be toggled for individual messages using the "Think first" option under each message input.
</Note>

## Best Practices

<CardGroup cols={2}>
  <Card title="Writing Effective Prompts" icon="pencil" href="/chat/best-practices#writing-effective-prompts">
    * Be specific about what you want
    * Provide necessary context
    * Use appropriate commands
    * Break complex questions into smaller parts
  </Card>

  <Card title="Managing Context" icon="layer-group" href="/chat/best-practices#managing-context">
    * Keep context focused and relevant
    * Remove unnecessary files
    * Update context when switching tasks
    * Clear context for new topics
  </Card>
</CardGroup>

<Note>
  Need more detailed guidance? Learn more about best practices in our [Best Practices guide](/best-practices).
</Note>

## Web Search Integration

<Frame>
  <img src="https://mintcdn.com/alex/zS4a0pdjtofRLVUw/images/web-search-demo.png?fit=max&auto=format&n=zS4a0pdjtofRLVUw&q=85&s=95f34af63bffc9e3de1b48922cf061ab" alt="Web search feature showing iOS-specific search results" width="1348" height="1070" data-path="images/web-search-demo.png" />
</Frame>

The **Web** button in chat provides access to curated iOS development resources. When enabled:

* Automatically searches popular iOS development blogs
* Finds relevant GitHub repositories and discussions
* Retrieves up-to-date documentation and examples

### Using Web Search

1. Click the "Web" button in chat
2. Alex searches relevant iOS resources
3. Results are automatically added as context
4. Get responses based on the latest information

<Note>
  The web search feature ensures you get the most current solutions and best practices from the iOS development community.
</Note>
