Build AI agents in Linear with Trigger.dev

Build AI agents that run in Linear. Assign one an issue or @mention it, and it gets to work, from triaging a bug to writing the fix.

Get started now

Two-way, not just webhooks in

Webhooks bring Linear events in, and the connector answers back in the same place.

Linear agents

@trigger.dev/linear
Linear → your agent
  • A @mention in an issue
  • An issue assigned to the agent
  • Follow-up prompts and approval choices
Your agent → Linear
  • Thoughts and actions as the agent works
  • A plan, and an approval card when it needs a decision
  • A response when it's done, all in Linear's agent session UI

Handled for you

Verification, the 5-second acknowledgement, the first activity Linear expects within 10 seconds, and dedup of Linear's retries.

What your agent can do

Each session is durable

Every Linear agent session becomes a Trigger.dev session. The user's prompt runs as a turn, and follow-ups in the session keep the context.

What the agent sees

On the first turn the model gets who summoned it and on which issue, your workspace's guidance for agents, the issue's context and comments, and the comment that mentioned it.

What Linear shows

A thought when a turn starts, each tool call as an action with its result, the reply as a response, and an error if a turn fails. Tool mirroring is on by default.

A plan the model keeps up to date

Add linearPlanTool() and Linear shows the agent's plan as a checklist, updated as steps finish.

Approvals and choices

A tool with no execute posts an approval card with Approve and Deny. interactions gives a tool its own options, and the choice resumes the run.

Stop

Pressing Stop in Linear aborts the running turn, and the text written so far posts as the response.

Prompts while it's working

A prompt sent mid-turn gets a thought straight away ("Got it, I'll take that into account.") and runs next, or is folded into the work in progress.

Helpers for full control

Post a thought or an action, replace the plan, add a link to the session header, or set its summary.

Answer from anywhere

Another webhook routed to the same session, a Sentry alert keyed on the issue for example, can answer into the Linear session as a response.

Get started

  1. 1

    Set up the agent

    Copy the starter prompt into your coding agent, like Claude Code, Cursor or Codex. It creates a Trigger.dev project and writes your Linear agent. Prefer to write it yourself? Start from the example below.

  2. 2

    Create a Linear app

    In Linear, under Settings, API, create an OAuth app with agent session webhooks turned on, and set its webhook URL to your agent's Trigger.dev URL.

  3. 3

    Install it as an agent

    A workspace admin installs the app as an agent, so people can assign it issues and @mention it. Then copy its signing secret into Trigger.dev.

  4. 4

    Try it

    Assign an issue to the agent, or @mention it in a comment. Linear shows its first thought within a few seconds, then its work.

Example

A Linear triage agent

One endpoint for Linear's agent session events, and an AI agent with tools and a plan that Linear shows as a checklist.

import { webhooks } from "@trigger.dev/sdk";
import { chat } from "@trigger.dev/sdk/ai";
import { linear, linearPlanTool, webhookSource } from "@trigger.dev/linear";
import { anthropic } from "@ai-sdk/anthropic";
const linearEvents = webhooks.endpoint.define({
id: "linear",
source: webhookSource(),
});
export const triage = chat.agent({
id: "triage",
channels: [
linear({
id: "linear",
endpoint: linearEvents,
token: process.env.LINEAR_ACCESS_TOKEN!,
}),
],
tools: { searchDocs, createSubIssues, updatePlan: linearPlanTool() },
run: async ({ messages, tools, signal, streamText }) =>
streamText({
model: anthropic("claude-sonnet-4-5"),
system:
"You triage Linear issues. Find the cause, propose sub-issues and ask before creating them. " +
"Start by setting a short plan with updatePlan and keep it current as you work.",
messages,
tools,
abortSignal: signal,
}),
});

Related integrations

Ready to put your agent in Linear?

Declare an endpoint, run trigger dev, and paste the URL into your app's settings.

Get started for free