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

# Quickstart

> Set up your Magnet workspace and launch your first AI coding session in under 5 minutes.

## Prerequisites

* A Magnet account at [magnet.run](https://magnet.run)
* A GitHub account with at least one repository
* An Anthropic API key ([get one here](https://console.anthropic.com/settings/keys))

## Setup

When you first navigate to **Sessions**, Magnet walks you through a three-step setup wizard. You only need to do this once.

### Step 1: Connect GitHub

Install the Magnet GitHub App on your GitHub account or organization. This lets the agent clone your repositories and open pull requests.

1. Click **Connect GitHub** in the setup wizard
2. Select which repositories the app can access (all or specific ones)
3. Approve the permissions

### Step 2: Add your Anthropic API key

Magnet uses your own Anthropic API key to run Claude Code in sessions. This key is stored securely and used for all sessions in your workspace.

1. Go to the [Anthropic Console](https://console.anthropic.com/settings/keys) and create an API key
2. Paste it into the setup wizard
3. Click **Save API Key**

<Tip>
  You can update your API key later in **Settings** > **Sandbox**.
</Tip>

### Step 3: Create an environment

An environment defines how the sandbox is configured for your sessions — which repository to clone, what setup commands to run, and how to start a dev server.

1. Click **Set Up Environment** in the wizard
2. Select a **GitHub repository** from the dropdown
3. Choose the **branch** to base changes on (defaults to `main`)
4. Optionally configure:
   * **Setup script** — commands to run after cloning (e.g., `pnpm install`)
   * **Run script** — start a dev server (e.g., `pnpm dev`)
   * **Preview port** — the port your dev server listens on, for live preview
   * **Environment variables** — any secrets or config your project needs
5. Click **Create Environment**

<Note>
  See [Environments](/environments) for a full guide on configuring environments.
</Note>

## Launch your first session

Once setup is complete, you're ready to create sessions.

<Steps>
  <Step title="Open the Sessions page">
    Navigate to **Sessions** in the sidebar.
  </Step>

  <Step title="Create a new session">
    Type a prompt describing the task you want the agent to do. For example:

    > Add input validation to the signup form. Email should be validated, and passwords need at least 8 characters.

    Select which environment to use (if you have more than one), then send.
  </Step>

  <Step title="Watch the agent work">
    The session opens a real-time view where you can see the agent:

    * Think through the problem
    * Read and edit files
    * Run commands
    * Make commits
  </Step>

  <Step title="Review the pull request">
    When the agent finishes, it opens a PR on GitHub. You can review the diff in Magnet or directly on GitHub.
  </Step>
</Steps>

## Next steps

<CardGroup cols={2}>
  <Card title="Environments" icon="gear" href="/environments">
    Learn how to configure environments for your projects.
  </Card>

  <Card title="Sessions Overview" icon="layer-group" href="/sessions/overview">
    Deep dive into how sessions work.
  </Card>

  <Card title="GitHub Integration" icon="github" href="/integrations/github">
    Learn more about the GitHub integration.
  </Card>

  <Card title="MCP Server" icon="plug" href="/integrations/mcp-server">
    Connect your coding tools to Magnet.
  </Card>
</CardGroup>
