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

# Linear Integration

> Linking Linear workspaces allows Charlie to open PRs, respond to comments, and more directly from your Linear workspace.

## What Charlie can do

Once connected, Charlie will be able to:

* **Respond in-thread with answers and code.** Ask **@Charlie** follow-up questions or clarifications right on the issue.
* **Enrich the ticket with deeper context.** `@Charlie, enrich this issue` pulls stack traces, touched files, recent commits, and related PRs.
* **Draft a ready-made implementation plan.** `@Charlie, write an implementation plan` returns a step-by-step roadmap with code changes, tests, and rollout notes.
* **Open a pull-request from the issue.** Mention `@Charlie, open a PR for this` **or assign the issue to him**—he spins up a branch, pushes commits, and opens a PR that references the ticket.
* **Keep tracking in lockstep.** Commits, PRs, and issue states stay linked automatically, and Charlie surfaces missing requirements when reviewing the PR.
* **Understand your team’s priorities.** Has a high‑level understanding of the initiatives and projects that are in flight.

## Daemons and Linear events

After you connect a Linear workspace, issue events can wake daemon `watch` conditions when the issue's Linear team is mapped to the repo. Use this when issue hygiene should happen from Linear activity, not only when someone explicitly asks Charlie to help.

Supported routed Linear event families include:

* issue creation (`Issue.create`)
* issue mentions
* issue comments
* issues assigned to Charlie

Project and initiative activity comments are not generally supported routed daemon wakes yet. Issue updates, status changes, label changes, and arbitrary assignment changes are also not currently routed daemon wakes. Linear event wakes require the Linear integration to be connected and the issue's Linear team to be mapped to the intended repo.

Mentions and assignment wakes are useful for direct asks. For daemons, prefer passive issue-hygiene workflows that start from issue creation, issue comments, or scheduled surveys without requiring someone to invoke Charlie.

Good daemon patterns for Linear include:

* triaging newly created issues into labels, owners, or reproduction requests
* reviewing new issue comments for blockers, reproduction details, ownership changes, or priority changes
* asking for missing details when an issue does not include enough context to act safely
* keeping follow-up hygiene current by finding stale asks, unclear owners, or mismatched linked PR state

Use provider-visible `watch` wording for issue-created or comment-created workflows, for example:

```yaml theme={null}
watch:
  - A Linear issue is created.
  - A Linear issue comment is added on an issue.
```

For passive hygiene that is not tied to one creation event, use `schedule` and inspect Linear state during execution:

```yaml theme={null}
schedule: "0 16 * * 1-5"
```

## Quick Setup

Follow these steps to connect your Linear workspace with Charlie:

<Steps>
  <Step title="Navigate to Integrations">
    Navigate to [dashboard.charlielabs.ai/integrations](https://dashboard.charlielabs.ai/integrations) and log into your account.

    <Note>
      If you have multiple GitHub organizations, you'll be prompted to select your organization before accessing the integrations page.
    </Note>

    <img src="https://mintcdn.com/charlie-7b05a877/2r0ElgcKfSZdeFDW/images/linear/dashboard.png?fit=max&auto=format&n=2r0ElgcKfSZdeFDW&q=85&s=b80ee5c301ab2d840a32f497901a2b16" alt="linear-dashboard" width="2102" height="1468" data-path="images/linear/dashboard.png" />
  </Step>

  <Step title="Connect Linear Workspace">
    Click **Connect Linear** to initiate the integration process.
  </Step>

  <Step title="Complete OAuth Connection">
    Follow the Linear OAuth connection flow to authorize Charlie to access your
    Linear workspace.
  </Step>

  <Step title="Return to Dashboard">
    After successfully linking your Linear workspace, you will be redirected back
    to the Charlie dashboard.
  </Step>

  <Step title="Connect Repository to Linear Team(s)">
    Go to your organization settings, select the repository, then select the Linear team(s) to connect to that repository. OAuth is workspace-scoped; repository routing is team-specific.

    <img src="https://mintcdn.com/charlie-7b05a877/2r0ElgcKfSZdeFDW/images/linear/connect-linear-team.gif?s=512880ab50293e23612fd713eec57dbc" alt="connect-linear-team" width="1315" height="933" data-path="images/linear/connect-linear-team.gif" />
  </Step>
</Steps>
